/* kerfmaster shell — dock-first Workbench (A+C ruling). Dark is default; both
   themes ruled one-click (2026-08-19). Typography deliberate, not accreted. */
:root {
  --bg: #14171b; --panel: #1c2127; --edge: #2a313a; --ink: #dbe2ea;
  --dim: #8b97a5; --accent: #35b6ff; --good: #3ecf6f; --warn: #f2c037;
  --bad: #f25757; --pend: #5a6672; --canvas: #0f1216;
  --base-layer: #6b7684; --healed-line: #3ecf6f; --healed-arc: #35b6ff;
  /* canvas signal colors, DELIBERATELY separate from the interface accent
     (Jordan 2026-09-04: recoloring selection must not restyle the app) */
  --sel: #35b6ff; --toolpath: #35b6ff;
  /* One elevation recipe for every floating surface (Aristide,
     2026-09-11: modals and palettes must "come off the screen" in dark
     mode). A pure black drop shadow is invisible on a dark background;
     the lift comes from a hairline light rim + a soft glow + a deeper
     drop. Light mode floats on shadow alone. */
  --float: 0 0 0 1px rgba(255, 255, 255, .10),
    0 0 20px rgba(255, 255, 255, .07), 0 18px 48px rgba(0, 0, 0, .65);
}
[data-theme="light"] {
  --bg: #f2f4f6; --panel: #ffffff; --edge: #d6dce2; --ink: #1d2530;
  --dim: #5d6a78; --canvas: #fbfcfd; --base-layer: #9aa5b1; --pend: #b7c0c9;
  --float: 0 1px 3px rgba(0, 0, 0, .12), 0 18px 48px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink); overflow: hidden;
  font: 14px/1.45 "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}
#topbar {
  display: flex; align-items: center; gap: 14px; height: 46px;
  padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--edge);
}
#brand { font-weight: 700; letter-spacing: .06em; color: var(--accent);
  cursor: pointer; }
#brand:hover, #jobname:hover { text-decoration: underline; }
#jobname { color: var(--dim); cursor: pointer; white-space: nowrap;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
#jobname:hover { color: var(--ink); }
#tabs { display: flex; gap: 2px; flex: 1; justify-content: center; }
.tab {
  display: flex; align-items: center; gap: 7px; padding: 5px 13px;
  border-radius: 7px 7px 0 0; cursor: pointer; color: var(--dim);
  border: 1px solid transparent; user-select: none;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); background: var(--bg);
  border-color: var(--edge); border-bottom-color: var(--bg); }
.dot { width: 15px; height: 15px; border-radius: 50%; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #0d1013; font-weight: 700; background: var(--pend); }
.dot.done { background: var(--good); } .dot.flagged { background: var(--warn); }
.dot.blocked { background: var(--bad); }
/* Tab consolidation (2026-09-06): a merged tab's per-stage dots sit as
   one tight group before the label; a stage section inside the drawer
   opens with its own dot + name, separated like a ruled sheet. */
.tab .dots { display: inline-flex; gap: 3px; align-items: center; }
h4.stagehead { display: flex; align-items: center; gap: 7px;
  margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--edge); }
h4.stagehead:first-of-type { margin-top: 4px; padding-top: 0; border-top: 0; }
h4.stagehead .dot { width: 13px; height: 13px; font-size: 9px; }
#topright { display: flex; gap: 8px; }
.chip { background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

#workbench { display: flex; height: calc(100% - 46px); }

/* Panels & workspaces (brick 11) — the A+C ruling: docked Workbench is the
   ground state; a panel tears off into a floating window, snap-back is one
   click, and a panel can never be lost (floats clamp on-screen; Reset docks
   everything). Plain DOM + pointer events — identical on Web/Mac/PC shells. */
.panel { background: var(--panel); display: flex; flex-direction: column;
  flex-shrink: 0; }
.panel.dockleft { order: -1; border-right: 1px solid var(--edge); }
.panel.dockright { order: 1; border-left: 1px solid var(--edge); }
.panel[data-panel="tools"] { width: 56px; }
.panel[data-panel="checks"] { width: 300px; }
.panel[data-panel="healqc"] { width: 236px; }
.panel[data-panel="dims"] { width: 250px; }
.panel.floating { position: fixed; z-index: 40; border: 1px solid var(--edge);
  border-radius: 10px; box-shadow: var(--float);
  overflow: hidden; resize: both; min-width: 56px; min-height: 100px;
  width: 300px; }
.pgrip { display: flex; align-items: center; gap: 6px; padding: 5px 8px;
  border-bottom: 1px solid var(--edge); cursor: grab; user-select: none;
  color: var(--dim); font-weight: 600; letter-spacing: .04em;
  touch-action: none; }
.pgrip:active { cursor: grabbing; }
/* Visibility pass (Aristide 2026-09-11, item 1): header icons readable —
   the grip dots, collapse dash and tear-off arrow were near-invisible. */
.gdots { font-size: 15px; letter-spacing: -1px; }
.ptitle { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px; }
.panel[data-panel="tools"]:not(.collapsed) .ptitle { display: none; }
/* With the title hidden the dots stretch, so the narrow grip keeps a real
   drag target beside its two buttons. */
.panel[data-panel="tools"]:not(.collapsed) .gdots { flex: 1; }
/* Aristide 2026-09-11: at the readable icon sizes the 56px Tools header
   overflowed — the tear-off arrow clipped off the right edge. Tighter
   padding on THIS narrow header only, so all three glyphs fit inside. */
.panel[data-panel="tools"]:not(.collapsed) .pgrip { padding: 5px 4px; gap: 4px; }
.panel[data-panel="tools"]:not(.collapsed) .pbtn { padding: 0 2px; }
.pbtns { display: flex; gap: 2px; }
.pbtn { background: none; border: 0; color: var(--dim); cursor: pointer;
  padding: 0 4px; font-size: 16px; line-height: 1.2; }
.pbtn:hover { color: var(--ink); }
.pbody { flex: 1; min-height: 0; }
/* Double-click the header: a float minimizes to its title bar and back. */
.panel.floating.fmin { height: auto !important; min-height: 0; resize: none; }
.panel.floating.fmin .pbody { display: none; }
.panel.collapsed { width: 26px !important; }
.panel.collapsed .pbody, .panel.collapsed .pbtns,
.panel.collapsed .gdots { display: none; }
.panel.collapsed .pgrip { flex-direction: column; border-bottom: 0;
  height: 100%; cursor: pointer; padding: 10px 4px; }
.panel.collapsed .ptitle { writing-mode: vertical-rl; flex: 0 1 auto;
  display: block; }
#workbench.hintleft::after, #workbench.hintright::after {
  content: ""; position: fixed; top: 46px; bottom: 0; width: 6px;
  background: var(--accent); z-index: 50; opacity: .8; }
#workbench.hintleft::after { left: 0; }
#workbench.hintright::after { right: 0; }
#wsmenu { position: fixed; top: 50px; right: 14px; z-index: 60; width: 258px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 10px;
  padding: 10px 14px 12px; box-shadow: var(--float); }
.wsrow { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.wsrow .wsname { flex: 1; cursor: pointer; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.wsrow .wsname:hover { color: var(--accent); }

#toolbar { display: flex; flex-direction: column; gap: 4px; padding: 8px 6px;
  overflow-y: auto; }
.tool { width: 40px; height: 40px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--dim); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center; position: relative; }
.tool:hover { color: var(--ink); border-color: var(--edge); }
.tool.on { color: var(--accent); border-color: var(--accent); background: var(--bg); }
/* Visibility pass item 2 (Aristide 2026-09-11): key letters readable,
   icons are real SVGs (Lucide outlines, vendored inline — no emojis, no
   CDN), and a layer toggle wears ITS layer's legend color (inline style
   from the same CSS variables the canvas reads, so a Colors & legend
   pick follows onto the button live). V and F stay neutral. */
.tool .key { position: absolute; right: 3px; bottom: 1px; font-size: 11px;
  font-weight: 700; color: var(--dim); line-height: 1; }
.tool svg { width: 20px; height: 20px; display: block; }
.tool.lay:not(.on) { opacity: .55; }
.tool.lay:not(.on):hover { opacity: .85; }

#canvaswrap { flex: 1; position: relative; background: var(--canvas); }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#zoomui { position: absolute; left: 12px; bottom: 10px; display: flex;
  align-items: center; gap: 10px; background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--edge); border-radius: 8px; padding: 5px 10px; }
#zoompreset { background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 5px; padding: 2px 4px; }
#zoomreadout { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
#scalebar { display: flex; align-items: center; gap: 6px; }
#scalebarline { display: inline-block; height: 0; border-bottom: 2px solid var(--ink);
  border-left: 2px solid var(--ink); border-right: 2px solid var(--ink);
  padding: 3px 0 0; }
#scalebarlabel { color: var(--dim); font-size: 12px; }

#drawerbody { padding: 12px 14px; overflow-y: auto; }
.kv { display: flex; justify-content: space-between; padding: 3px 0; gap: 10px; }
.kv .k { color: var(--dim); } .kv .v { font-variant-numeric: tabular-nums; text-align: right; }
.banner { margin: 10px 0; padding: 8px 12px; border-radius: 7px; font-weight: 700;
  text-align: center; color: #0d1013; }
.banner.pass { background: var(--good); } .banner.flag { background: var(--warn); }
.banner.block { background: var(--bad); }
.drawernote { color: var(--dim); font-style: italic; margin-top: 8px; }
.drawernote.stale { color: var(--warn); font-style: normal; }
.layerrow { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.swatch { width: 14px; height: 3px; border-radius: 2px; }
h4.sect { margin: 12px 0 4px; color: var(--dim); font-size: 12px;
  text-transform: uppercase; letter-spacing: .08em; }

#jobshome { position: absolute; inset: 0; background: var(--bg); overflow-y: auto; }
#homeinner { max-width: 860px; margin: 40px auto; padding: 0 20px; }
#jobshome h1 { color: var(--accent); letter-spacing: .06em; }
#jobshome .sub { color: var(--dim); margin-bottom: 18px; }
#dropzone { border: 2px dashed var(--edge); border-radius: 12px; padding: 26px;
  text-align: center; color: var(--dim); margin-bottom: 24px; }
#dropzone.over { border-color: var(--accent); color: var(--ink); }
#browsebtn { margin: 10px 0; background: var(--accent); color: #0d1013;
  border: 0; border-radius: 7px; padding: 8px 18px; font-weight: 700; cursor: pointer; }
.unitfield { background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 5px; padding: 2px 7px; width: 90px; text-align: center; }
.hint { font-size: 12px; margin-top: 8px; }
.jobcard { display: flex; align-items: center; gap: 14px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 10px; padding: 12px 16px;
  margin-bottom: 10px; cursor: pointer; }
.jobcard:hover { border-color: var(--accent); }
.jobcard .jname { font-weight: 600; flex: 1; }
.jobcard .jdate { color: var(--dim); font-size: 12px; }
.ministrip { display: flex; gap: 4px; }
.ministrip .dot { width: 11px; height: 11px; font-size: 0; }

/* Filing: customer folders + search (jobs-home-filing, 2026-09-02) */
#jobsearch { display: block; width: 100%; box-sizing: border-box;
  margin: 18px 0 10px; padding: 9px 14px; background: var(--panel);
  color: var(--ink); border: 1px solid var(--edge); border-radius: 8px;
  font: inherit; }
#jobsearch:focus { outline: none; border-color: var(--accent); }
.custhead { display: flex; align-items: center; gap: 8px;
  padding: 10px 6px 6px; cursor: pointer; user-select: none;
  font-weight: 600; }
.custhead .chev { color: var(--dim); width: 14px; }
.custhead .ccount { color: var(--dim); font-size: 12px; font-weight: 400; }
.custhead:hover .cname { color: var(--accent); }
.jobcard .jref { color: var(--dim); font-size: 12px;
  border: 1px solid var(--edge); border-radius: 6px; padding: 1px 7px;
  white-space: nowrap; }
.filebtn { background: none; color: var(--dim); border: 1px solid var(--edge);
  border-radius: 6px; padding: 2px 9px; font-size: 12px; cursor: pointer; }
.filebtn:hover { color: var(--accent); border-color: var(--accent); }
.fileform { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: -4px 0 10px; padding: 9px 14px; background: var(--panel);
  border: 1px dashed var(--edge); border-radius: 10px; font-size: 12.5px; }
.fileform label { display: flex; gap: 6px; align-items: center;
  color: var(--dim); }
.fileform input, .fileform select { background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 5px; padding: 3px 8px;
  font: inherit; font-size: 12.5px; }
.fileform .fsave { background: var(--accent); color: var(--bg); border: 0;
  border-radius: 6px; padding: 4px 14px; font-weight: 700; cursor: pointer; }

/* Part review (brick 2) */
.findrow { margin: 6px 0; padding: 6px 9px; border-radius: 6px; font-size: 12.5px;
  cursor: pointer; border-left: 4px solid; background: var(--bg); }
.findrow.red { border-color: var(--bad); }
.findrow.yellow { border-color: var(--warn); }
.findrow:hover { outline: 1px solid var(--edge); }
/* A row that navigates says so: pointer + accent ring + a "go" glyph. Rows
   with no geometry to go to stay flat — honestly not navigable. */
.findrow.nav { cursor: pointer; }
.findrow.nav::after { content: " ⌖"; color: var(--accent); font-weight: 700; }
.findrow.nav:hover { outline: 1px solid var(--accent); }
/* Findings grouped by kind (visibility item 3): same-message findings fold
   under one chevron row; the rows inside still navigate individually. */
.findgrp { margin: 6px 0; border-left: 4px solid; border-radius: 6px;
  background: var(--bg); font-size: 12.5px; }
.findgrp.red { border-color: var(--bad); }
.findgrp.yellow { border-color: var(--warn); }
.findgrp > summary { cursor: pointer; padding: 6px 9px; font-weight: 600;
  list-style-position: inside; }
.findgrp > summary:hover { outline: 1px solid var(--edge); border-radius: 6px; }
.findgrp .findrow { margin: 2px 8px 6px 16px; border-left-width: 3px; }
/* Green-flags (pin warning-green-flags): a recorded sign-off — the row
   stays visible (judgment never silenced), marked green and calmed; the
   detail link expands the verbose message under the short label. */
.fvtog, .gfbtn { margin-left: 8px; font-size: 11px; color: var(--dim);
  text-decoration: none; white-space: nowrap; }
.fvtog:hover, .gfbtn:hover { color: var(--accent); }
.gfbtn { color: var(--good); }
.findrow.gflagged, .findgrp.gflagged { border-color: var(--good);
  opacity: 0.75; }
.findrow.gflagged .gfbtn, .findgrp.gflagged .gfbtn { font-weight: 700; }
/* A signed-off finding reads GREEN head to toe — the judgment words stay,
   only the colour stands down (Jordan's Yellow-or-Green catch,
   2026-09-18: the flag registered everywhere but changed the colour
   nowhere). The count suffixes (.gfnote) match. */
.findrow.gflagged, .findgrp.gflagged > summary { color: var(--good); }
.gfnote { color: var(--good); font-weight: 600; font-size: 11px; }
.fvmsg { margin-top: 5px; padding: 5px 7px; font-weight: 400;
  color: var(--dim); background: var(--panel); border-radius: 5px;
  cursor: default; }
/* Canvas screenshot buttons (visibility item 7) */
.shotbtn { background: none; border: 0; color: var(--dim); cursor: pointer;
  padding: 2px; display: flex; align-items: center; }
.shotbtn:hover { color: var(--ink); }
.shotbtn svg { width: 16px; height: 16px; display: block; }
.ovrow { display: flex; align-items: center; gap: 7px; padding: 3px 0;
  color: var(--dim); flex-wrap: wrap; }
.ovrow a { color: var(--accent); }
/* Every drawer link reads in the accent role -- the browser's default
   visited-purple is invisible on the dark theme (Jordan 2026-09-22, the
   approach-defaults link he could not see). Buttons keep their own ink. */
#drawerbody a:not(.btn) { color: var(--accent); }
.src { color: var(--dim); font-size: 11px; font-style: italic; }
.btn { background: var(--accent); color: #0d1013; border: 0; border-radius: 7px;
  padding: 6px 14px; font-weight: 700; cursor: pointer; margin-top: 6px; }
.btn.small { padding: 2px 9px; font-weight: 600; margin: 0; }
#drawerbody select { background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 5px; padding: 2px 5px;
  max-width: 190px; }

/* first-run tour + help + bug report (brick 13, sitting ruling 9).
   The tour dims the screen through a spotlight hole but NEVER blocks it:
   the container passes pointer events, only the card takes them — so a
   "try it now" step works live under the tour. Plain DOM, three lenses. */
#tour { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
#tourhole { position: fixed; border-radius: 10px; border: 2px solid var(--accent);
  box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .55); transition: all .22s; }
#tourhole.nohole { border-color: transparent; }
#tourcard { position: fixed; width: 340px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px 10px;
  box-shadow: var(--float); pointer-events: auto; }
#tourcard h4 { margin: 0 0 6px; color: var(--accent); }
#tourbody { font-size: 13px; }
#tourbody .dot { vertical-align: middle; }
#tourbtns { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
#tourstep { flex: 1; text-align: center; color: var(--dim); font-size: 12px;
  font-variant-numeric: tabular-nums; }
#tourskipall { display: block; margin: 8px auto 0; font-size: 11.5px; }
#helpmenu { position: fixed; top: 50px; right: 14px; z-index: 60; width: 258px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 10px;
  padding: 10px 14px 12px; box-shadow: var(--float); }
/* Onboarding wizard — the shop-setup modal (same [hidden] guard as the
   bug modal: display:flex outranks the UA's [hidden]). */
#wizmodal { position: fixed; inset: 0; z-index: 84;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#wizmodal[hidden] { display: none; }
#wizcard { width: 400px; background: var(--panel); border: 1px solid var(--edge);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--float);
  /* taller than a small window -> scroll inside the card, never
     overflow the heading/buttons off-screen (colcard precedent) */
  max-height: 88vh; overflow: auto; }
#wizcard h4 { margin: 0 0 4px; color: var(--accent); }
.wizq { font-weight: 700; margin: 10px 0 4px; }
.wizopt { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0;
  font-size: 12.5px; cursor: pointer; }
.wizopt input { margin-top: 2px; }

/* Start-point default magnets (pin start-default-modal): the sample
   shapes the marker drags on -- wizard row of three, modal of one. */
#sdmodal { position: fixed; inset: 0; z-index: 86;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#sdmodal[hidden] { display: none; }
#sdcard { width: 340px; background: var(--panel); border: 1px solid var(--edge);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--float);
  max-height: 88vh; overflow: auto; }
#sdcard h4 { margin: 0 0 4px; color: var(--accent); }
.sdrow { display: flex; gap: 10px; justify-content: center;
  margin: 8px 0; }
.sdmag { text-align: center; }
.sdmag svg { width: 96px; height: 96px; touch-action: none;
  cursor: grab; }
.sdcap { font-size: 11px; color: var(--dim); }
.sdlab { font-size: 11.5px; font-weight: 700; }
.sdshape { fill: none; stroke: var(--ink); stroke-width: 0.05; }
.sdghost { fill: none; stroke: var(--dim); stroke-width: 0.03;
  opacity: .5; }
.sdsnap { fill: var(--dim); opacity: .6; }
.sdmark { fill: var(--accent); stroke: var(--panel);
  stroke-width: 0.03; }

/* Approach defaults + the shared material group picker (pin
   approach-defaults-group-save): fields per class, sparse per field;
   the picker rides both this modal and the start-point modal. */
#admodal { position: fixed; inset: 0; z-index: 86;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#admodal[hidden] { display: none; }
#adcard { width: 560px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px;
  padding: 14px 16px; box-shadow: var(--float); max-height: 88vh;
  overflow: auto; }
#adcard h4 { margin: 0 0 4px; color: var(--accent); }
.adgrid { display: grid; grid-template-columns: 86px repeat(4, 1fr);
  gap: 4px 6px; align-items: center; margin: 8px 0; }
.adhead { font-size: 10.5px; color: var(--dim); line-height: 1.2; }
.adchip { display: inline-block; font-size: 9px; color: var(--warn,
  #b58900); border: 1px solid currentColor; border-radius: 6px;
  padding: 0 3px; }
.adcls { font-size: 11.5px; font-weight: 700; }
.adwrap { display: flex; align-items: center; gap: 2px; }
.adin { width: 100%; min-width: 0; font-size: 11.5px; padding: 3px 4px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px; }
.adin.adclr { border-style: dashed; }
.adx { font-size: 12px; color: var(--dim); text-decoration: none;
  padding: 0 2px; }
.adx:hover { color: var(--accent); }
.matpick { margin: 6px 0; border: 1px solid var(--edge);
  border-radius: 8px; padding: 6px; }
.matpickbar { display: flex; gap: 6px; align-items: center;
  flex-wrap: wrap; font-size: 11px; margin-bottom: 4px; }
.matpickbar select, .matpickbar input { font-size: 11px;
  padding: 2px 4px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px; }
.matpickbar input { width: 64px; }
.matpickbar a { color: var(--accent); font-size: 10.5px; }
.matpicklist { max-height: 150px; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px 8px; }
.mprow { font-size: 11px; display: flex; align-items: center;
  gap: 4px; cursor: pointer; }
.mprow[hidden] { display: none; }
.mprow.mpoff { opacity: .65; }

#bugmodal { position: fixed; inset: 0; z-index: 85;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
/* display:flex outranks the UA's [hidden]{display:none} — without this
   line the INVISIBLE modal covers the screen and eats every click
   (caught live by verify_tour phase 5). */
#bugmodal[hidden] { display: none; }
#bugcard { width: 360px; background: var(--panel); border: 1px solid var(--edge);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--float);
  max-height: 88vh; overflow: auto; }
#bugcard h4 { margin: 0 0 4px; }
#bugtext { width: 100%; margin-top: 8px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px; padding: 6px 8px;
  font: inherit; resize: vertical; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--edge); color: var(--ink);
  padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .25s;
  pointer-events: none; box-shadow: var(--float); }
#toast.show { opacity: 1; }

/* cut plan (brick 4): the ordered sequence list */
.seqrow { margin: 3px 0; padding: 4px 7px; border-radius: 6px;
  font-size: 12.5px; cursor: pointer; color: var(--dim);
  display: flex; align-items: center; gap: 7px; }
.seqrow:hover { outline: 1px solid var(--edge); }
.seqrow.selected { color: var(--ink); outline: 1px solid var(--accent); }
.seqnum { min-width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--dim); display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 11px;
  font-variant-numeric: tabular-nums; }
.seqnum.red { border-color: var(--bad); color: var(--bad); }
.seqnum.yellow { border-color: var(--warn); color: var(--warn); }

/* Active buttons show as pressed. Visibility pass item 9 (Aristide
   2026-09-11): the old outline ran OUTSIDE the footprint and overlapped
   crowded neighbors (Dimension kinds) — the active ring now draws inset,
   inside the button's own footprint, and button groups carry a breath of
   margin so no state ever paints over another control. */
.btn.on { box-shadow: inset 0 0 0 2px #0d1013; filter: brightness(1.15); }
.btn.small { margin: 2px 4px 2px 0; }

/* sketch (brick 10): typed-number primitive rows */
.primrow { display: flex; align-items: flex-end; gap: 4px; padding: 3px 0;
  flex-wrap: wrap; }
.primrow.bsel { outline: 1px solid var(--warn); border-radius: 4px;
  background: color-mix(in srgb, var(--warn) 12%, transparent); }
.fld { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; }
.fldl { font-size: 9px; color: var(--dim); line-height: 1.1;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.primtype { color: var(--dim); font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; min-width: 42px; }
.unitfield.mini { width: 62px; padding: 2px 4px; font-size: 11.5px; }
.btnrow { display: flex; gap: 6px; margin: 8px 0 4px; }
#sketchbtn { background: var(--accent); color: #0d1013; border: 0;
  border-radius: 6px; padding: 3px 12px; font-weight: 700; cursor: pointer; }
#sketchname { width: 120px; }

/* post (brick 5): program preview + the audit's own words */
.ncpre { background: var(--bg); border: 1px solid var(--edge);
  border-radius: 6px; padding: 8px 10px; font-size: 11px; line-height: 1.5;
  overflow-x: auto; white-space: pre; max-height: 260px; overflow-y: auto;
  font-variant-numeric: tabular-nums; }
.ncanom { margin: 4px 0; padding: 4px 8px; border-left: 3px solid var(--dim);
  color: var(--dim); font-size: 11.5px; background: var(--bg);
  border-radius: 4px; }
a.btn.small { text-decoration: none; display: inline-block;
  color: #0d1013; } /* .ovrow a's accent would paint accent-on-accent */

/* Heal/QC manual edit panel (brick F) */
#healqcbody .hqrow { display: flex; gap: 6px; align-items: center;
  margin: 4px 8px; }
#healqcbody .hqbtn { flex: 1; text-align: left; }
#healqcbody .hqrow.hqadd { flex-wrap: wrap; }
#dimsbody { padding: 10px 12px; overflow-y: auto; font-size: 12.5px; }
#dimsbody .hqrow { display: flex; gap: 6px; align-items: center;
  padding: 2px 0; }
#dimsbody .hqbtn { text-align: left; }
/* pressed lens keeps the shared .btn.on look (outline + brightness) —
   never accent text on the accent fill, which made the label invisible */
#healqcbody input.unitfield { width: 62px; flex-shrink: 0; }
/* Recorded edits read as actionable cards, not footnotes (visibility pass
   item 8, Aristide 2026-09-11) — bordered row + a real remove button. */
#healqcbody .hqedit { font-size: 11.5px; margin: 5px 8px; display: flex;
  gap: 8px; align-items: center; justify-content: space-between;
  background: var(--bg); border: 1px solid var(--edge); border-radius: 8px;
  padding: 6px 8px; }
.hqrm { background: none; border: 1px solid var(--edge); color: var(--dim);
  border-radius: 6px; padding: 2px 9px; font-size: 11.5px; cursor: pointer;
  flex: none; }
.hqrm:hover { color: var(--bad); border-color: var(--bad); }
#healqcbody .hqnote { font-size: 11px; color: var(--dim); margin: 8px; }
#healqcbody .hqnote2 { font-size: 10.5px; color: var(--dim); }
#healqcbody .hqnote2.skip { color: var(--warn); }
#healqcbody .hqnote2.dup { color: var(--warn); }
/* Duplicate-lens notes (pin healqc-drop-duplicates): the flag's own words
   in the panel, sized for its narrow column. */
#healqcbody .findrow.hqdup { font-size: 10.5px; margin: 4px 8px;
  padding: 5px 8px; }
#healqcbody .findgrp.hqdupgrp { margin: 4px 8px; }
#healqcbody .findgrp.hqdupgrp > summary { font-size: 10.5px; }

/* Colours & legend modal (Jordan 2026-09-04) — same [hidden] guard as the
   bug modal: display:flex outranks the UA's [hidden]. */
#colmodal { position: fixed; inset: 0; z-index: 85;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#colmodal[hidden] { display: none; }
#colcard { width: 430px; max-height: 82vh; overflow: auto;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); }
#colcard h4 { margin: 0 0 4px; }
.colrow { display: flex; align-items: center; gap: 10px; padding: 5px 0;
  border-bottom: 1px solid var(--edge); }
.colrow:last-child { border-bottom: 0; }
.colrow input[type="color"] { width: 34px; height: 24px; padding: 0;
  border: 1px solid var(--edge); border-radius: 5px; background: none;
  cursor: pointer; flex: none; }
.colrow .colname { font-weight: 600; white-space: nowrap; }
.colrow .colmeans { color: var(--dim); font-size: 12px; flex: 1; }
.colrow .colreset1 { color: var(--accent); font-size: 12px; cursor: pointer;
  flex: none; visibility: hidden; }
.colrow.changed .colreset1 { visibility: visible; }

/* Group membership on the Jobs home (grouped-upload-tray): a part-list
   card counts the part jobs living inside it; one click unfolds them
   as an indented sub-list. */
.memtoggle { background: none; border: 1px solid var(--edge);
  border-radius: 999px; color: var(--dim); font-size: 11px;
  padding: 1px 8px; cursor: pointer; }
.memtoggle:hover { color: var(--accent); border-color: var(--accent); }
.memlist { margin: 0 0 6px 26px; padding-left: 10px;
  border-left: 2px solid var(--edge); }
/* Jobs-home drag (grouped-upload-tray session 2): the grabbed card
   floats over the list, a group card under the cursor lights, and a
   fixed bar words the drop — the sorting tray's own vocabulary. */
.jobcard { user-select: none; }
.jobcard.dragging { position: relative; z-index: 5; cursor: grabbing;
  box-shadow: var(--float); opacity: .92; }
.jobcard.draghover { border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.dragbar { position: fixed; left: 50%; bottom: 18px;
  transform: translateX(-50%); background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px; padding: 8px 14px;
  font-size: 13px; z-index: 60; box-shadow: var(--float); max-width: 80vw; }

/* Add-existing-part picker (pin job-style-unification, stage 1): the
   run_partlist by-reference door made findable — Jobs-home folders +
   search inside one modal. Same [hidden] guard as every modal. */
#plpickmodal { position: fixed; inset: 0; z-index: 86;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#plpickmodal[hidden] { display: none; }
#plpickcard { width: min(640px, 92vw); background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); max-height: 84vh; display: flex;
  flex-direction: column; }
#plpickcard h4 { margin: 0 0 4px; color: var(--accent); }
#plpickq { width: 100%; margin: 6px 0; box-sizing: border-box; }
#plpicklist { overflow: auto; min-height: 120px;
  border: 1px solid var(--edge); border-radius: 6px; }
.plpickhead { padding: 4px 8px; font-weight: 600; color: var(--dim);
  background: var(--bg); position: sticky; top: 0; }
.plpickrow { display: flex; gap: 10px; align-items: baseline;
  padding: 4px 8px; cursor: pointer; border-top: 1px solid var(--edge); }
.plpickrow:hover { background: var(--bg); }
.plpickrow .ppsub { color: var(--dim); font-size: 12px; }
.plpickrow .ppadd { margin-left: auto; color: var(--accent);
  font-size: 12px; white-space: nowrap; }
/* The explicit fork (stage 2) — a quiet per-row control, deliberately
   dimmer than the default reference "add"; visible on hover/keyboard. */
.plpickrow .ppfork { margin-left: auto; color: var(--dim);
  font-size: 12px; white-space: nowrap; visibility: hidden;
  border: 1px solid var(--edge); border-radius: 3px; padding: 0 6px; }
.plpickrow:hover .ppfork { visibility: visible; }
.plpickrow .ppfork:hover { color: var(--accent);
  border-color: var(--accent); }
.plpickrow .ppfork + .ppadd { margin-left: 0; }

/* The sorting tray (grouped-upload-tray, Jordan 2026-09-14): file cards
   sort BEFORE anything uploads; drag one onto another to stack them
   into a group. Same [hidden] guard as every modal. */
#traymodal { position: fixed; inset: 0; z-index: 86;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#traymodal[hidden] { display: none; }
#traycard { width: min(720px, 92vw); background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); max-height: 88vh; overflow: auto; }
#traycard h4 { margin: 0 0 4px; color: var(--accent); }
#traygrid { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0;
  min-height: 90px; align-items: flex-start; }
.traybox { position: relative; width: 200px; background: var(--bg);
  border: 1px solid var(--edge); border-radius: 10px; padding: 10px;
  cursor: grab; touch-action: none; user-select: none;
  transition: box-shadow .12s, border-color .12s; }
.traybox.dragging { z-index: 5; cursor: grabbing; box-shadow: var(--float);
  opacity: .92; transition: none; }
.traybox.draghover { border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
/* A stack reads as physically stacked cards — two offset sheets behind. */
.traybox.stack::before, .traybox.stack::after { content: "";
  position: absolute; inset: 0; border: 1px solid var(--edge);
  border-radius: 10px; background: var(--bg); z-index: -1; }
.traybox.stack::before { transform: translate(3px, 3px); }
.traybox.stack::after { transform: translate(6px, 6px); opacity: .6; }
.tfname { font-weight: 600; font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tfsub { color: var(--dim); font-size: 11px; margin: 2px 0 8px; }
.tgname .tname { width: 100%; box-sizing: border-box; font-weight: 600;
  font-size: 13px; background: transparent; border: 1px solid transparent;
  border-radius: 6px; color: var(--ink); padding: 2px 4px; }
.tgname .tname:hover, .tgname .tname:focus { border-color: var(--edge);
  background: var(--panel); }
.tchips { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 8px; }
.tchip { display: flex; align-items: center; gap: 6px; font-size: 11.5px;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 6px; padding: 2px 6px; }
.tchip .tpop { margin-left: auto; background: none; border: none;
  color: var(--dim); cursor: pointer; font-size: 13px; padding: 0 2px; }
.tchip .tpop:hover { color: var(--bad); }
.traybox .tcust { width: 100%; box-sizing: border-box; font-size: 12px;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 6px; color: var(--ink); padding: 4px 6px; }

/* Units confirmation modal (Jordan, 2026-09-04): autodetected units with
   a one-click flip; the BIG RED warning only on the extremes. Same
   [hidden] guard as every modal (display:flex outranks the UA rule). */
/* Identical-shapes confirm (isolation session c): sits above the units
   modal — it answers a gesture just made on the canvas. */
#identmodal { position: fixed; inset: 0; z-index: 88;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#identmodal[hidden] { display: none; }
#identcard { width: 340px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); }
#identcard h4 { margin: 0 0 4px; color: var(--accent); }
.identbtns { display: flex; gap: 8px; margin: 10px 0 6px; }
.identbtns .isobtn { flex: 1; padding: 8px 10px; font-size: 13px; }

#unitsmodal { position: fixed; inset: 0; z-index: 86;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#unitsmodal[hidden] { display: none; }
#unitscard { width: 380px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); max-height: 88vh; overflow: auto; }
#unitscard h4 { margin: 0 0 4px; color: var(--accent); }

/* Movable modals (Aristide, 2026-09-11): the card drags by any
   non-control spot; the heading advertises the grab. */
#unitscard h4, #wizcard h4, #bugcard h4, #colcard h4 { cursor: grab; }
.unitsred { background: color-mix(in srgb, var(--bad) 18%, var(--panel));
  border: 1px solid var(--bad); color: var(--bad); font-weight: 700;
  border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
/* Radio rows (Aristide, 2026-09-11): the old two-button toggle lit the
   UNSELECTED side brighter than the selected one — inverted emphasis.
   Each row now carries its reading's size in the label. */
.unitspick { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.unitsopt { display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--bg); border: 1px solid var(--edge); border-radius: 8px;
  padding: 8px 10px; color: var(--ink); cursor: pointer; font: inherit;
  width: 100%; }
.unitsopt .uradio { width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--dim); flex: none; box-sizing: border-box; }
.unitsopt .ulab { display: flex; flex-direction: column; gap: 2px; }
.unitsopt .uname { font-weight: 700; font-size: 14px; }
.unitsopt .usub { font-size: 13px; color: var(--ink); }
.unitsopt .usub .uflag { color: var(--bad); font-weight: 700; }
.unitsopt .uname .utag { color: var(--dim); font-weight: 400;
  font-size: 12px; }
.unitsopt.on { border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent); }
.unitsopt.on .uradio { border-color: var(--accent);
  background: radial-gradient(circle,
    var(--accent) 0 4px, transparent 4.5px); }
.unitsopt.on .uname { color: var(--accent); }

/* Processing indicator (Jordan, 2026-09-04): an upload used to show
   nothing until the job appeared after a reload. */
#busy { position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, .35); display: flex; align-items: center;
  justify-content: center; }
#busy[hidden] { display: none; }
#busycard { display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 10px; padding: 12px 16px; font-size: 13px;
  box-shadow: var(--float); }
.spin { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--edge); border-top-color: var(--accent);
  animation: kmspin .8s linear infinite; }
/* STOP button on the packing busy card (Jordan 2026-09-30) */
#busycancel { flex: 0 0 auto; margin-left: 6px; font-size: 12px;
  padding: 4px 10px; border: 1px solid var(--warn, #c90);
  color: var(--warn, #c90); background: transparent;
  border-radius: 6px; cursor: pointer; }
#busycancel:disabled { opacity: .6; cursor: default; }
@keyframes kmspin { to { transform: rotate(360deg); } }

/* Tool palettes (Jordan, 2026-09-04): a slight white glow in dark mode,
   a slight drop shadow in light — strengthened 2026-09-11 (Aristide).
   Floating panels ride the shared --float recipe (theme-aware). */
.panel { box-shadow: 0 0 14px rgba(255, 255, 255, .10); }
.panel.floating { box-shadow: var(--float); }
[data-theme="light"] .panel { box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
[data-theme="light"] .panel.floating { box-shadow: var(--float); }

/* Isolation drill-down breadcrumb (pin isolation-drilldown-editing) */
#isobar, #plhbar { position: absolute; left: 12px; top: 10px; display: flex;
  align-items: center; gap: 6px; flex-wrap: wrap; max-width: calc(100% - 24px);
  background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--edge);
  border-radius: 8px; padding: 5px 10px; font-size: 12px;
  box-shadow: var(--float); z-index: 5; }
#isobar[hidden], #plhbar[hidden] { display: none; }
.isocrumb { color: var(--accent); cursor: pointer; }
.isocrumb:hover { text-decoration: underline; }
.isocrumb.cur { color: var(--ink); font-weight: 600; cursor: default; }
.isocrumb.cur:hover { text-decoration: none; }
.isosep { color: var(--dim); }
.isohint { color: var(--dim); font-size: 11px; }
.isoacts { display: flex; align-items: center; gap: 5px; margin-left: 8px; }
.isoinp { width: 58px; font-size: 12px; padding: 2px 5px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 5px; }
.isobtn { font-size: 12px; padding: 2px 9px; cursor: pointer;
  background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 5px; }
.isobtn:hover { border-color: var(--accent); color: var(--accent); }

/* Global undo (pin global-undo): heavy-step confirm modal + the
   return-to-where-I-was chip after an undo run lands elsewhere. */
#undomodal { position: fixed; inset: 0; z-index: 87;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#undomodal[hidden] { display: none; }
#undocard { width: 360px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); }
#undoreturn { position: fixed; bottom: 16px; left: 50%;
  transform: translateX(-50%); z-index: 60; box-shadow: var(--float); }

/* Right-click context menu (pin global-controls item 3): one floating
   menu, every item a drawer/panel function — never a parallel path. */
#ctxmenu { position: fixed; z-index: 90; min-width: 190px;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 8px; padding: 4px 0; font-size: 12.5px;
  box-shadow: var(--float); user-select: none; }
#ctxmenu .ctxtitle { padding: 5px 12px 4px; font-size: 11px;
  color: var(--dim); border-bottom: 1px solid var(--edge);
  margin-bottom: 3px; white-space: nowrap; }
#ctxmenu .ctxitem { padding: 5px 12px; cursor: pointer;
  color: var(--ink); white-space: nowrap; }
#ctxmenu .ctxitem:hover { background: var(--bg); color: var(--accent); }
#ctxmenu .ctxsep { border-top: 1px solid var(--edge); margin: 4px 0; }

/* Draw parameter bar (item 4, Jordan 2026-09-19) -- the MetaCam-style
   field row at the bottom of the canvas while a draw chain is live. */
#drawbar { position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 14px; display: flex; gap: 7px; align-items: center;
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 6px; padding: 5px 10px; font-size: 12px; z-index: 40; }
#drawbar label { display: flex; align-items: center; gap: 4px;
  color: var(--dim); font-family: ui-monospace, SFMono-Regular, Menlo,
  monospace; font-size: 11px; }
#drawbar input { width: 60px; font-size: 12px; padding: 2px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 3px; }
#drawbar input:disabled { opacity: .4; }
#drawbar input.locked { border-color: var(--accent);
  color: var(--accent); }
#drawbar .dbhint { color: var(--dim); margin-left: 4px;
  white-space: nowrap; }

/* Part-list preview cards (Jordan 2026-09-20): thumbnail + full name +
   overall size per row; the selected card is the part on the canvas. */
.plrow { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0;
  padding: 4px; border: 1px solid var(--edge); border-radius: 6px;
  cursor: pointer; }
.plrow.sel { border-color: var(--sel);
  background: color-mix(in srgb, var(--sel) 8%, transparent); }
/* band-selected cards (2026-09-22, the global shift-drag gesture on the
   card list) — same warn accent the sketch rows' band carries. */
.plrow.bsel { border-color: var(--warn);
  outline: 1px solid var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent); }
#plband { position: fixed; z-index: 300; pointer-events: none;
  border: 1px dashed var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, transparent); }
#plband[hidden] { display: none; }
.plthumb { background: var(--canvas); border: 1px solid var(--edge);
  border-radius: 4px; flex: none; }
.plrmain { flex: 1; min-width: 0; }
.plrline { display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  margin: 2px 0; }
.plrline select[data-pl^="job"] { flex: 1; min-width: 0; }
.plsize { color: var(--dim); font-size: 11px;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.plfull { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Per-card in/mm toggle (Jordan 2026-09-20): the current reading lit;
   clicking the other flips the FILE's units (a kit flips as a set). */
.plu { display: inline-flex; border: 1px solid var(--edge);
  border-radius: 5px; overflow: hidden; flex: none; }
.plubtn { padding: 1px 6px; font-size: 10px; background: var(--bg);
  color: var(--dim); border: 0; cursor: pointer; }
.plubtn + .plubtn { border-left: 1px solid var(--edge); }
.plubtn.on { background: color-mix(in srgb, var(--sel) 18%, var(--bg));
  color: var(--ink); font-weight: 700; cursor: default; }
.plubtn:not(.on):hover { color: var(--ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }

/* Extremes-only units check at the tray door (2026-09-20). */
#uxmodal { position: fixed; inset: 0; z-index: 86;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#uxmodal[hidden] { display: none; }
#uxcard { width: 460px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); max-height: 88vh; overflow: auto; }
#uxcard h4 { margin: 0 0 4px; color: var(--accent); }
.uxrow { border: 1px solid var(--edge); border-radius: 8px;
  padding: 8px 10px; margin: 8px 0; }
.uxname { font-weight: 700; font-size: 13px; }
.uxpick { display: flex; gap: 6px; margin-top: 6px; }
.uxpick .plubtn { border: 1px solid var(--edge); border-radius: 5px;
  padding: 6px 8px; font-size: 12px; flex: 1; }

/* Cut-geometry color pick (fix b, Jordan 2026-09-30). z 95: the modal
   opens MID-BATCH inside the upload's busy overlay (z 90) — the pick
   must land before the file's parts become list rows, so it sits above
   the busy card and stays clickable. */
#ckmodal { position: fixed; inset: 0; z-index: 95;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#ckmodal[hidden] { display: none; }
#ckcard { width: 520px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--float); max-height: 88vh; overflow: auto; }
#ckcard h4 { margin: 0 0 4px; color: var(--accent); }
.ckrow { border: 1px solid var(--edge); border-radius: 8px;
  padding: 8px 10px; margin: 8px 0; }
.ckname { font-weight: 700; font-size: 13px; }
.ckchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ckchip { display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--edge); border-radius: 5px; padding: 5px 8px;
  font-size: 12px; cursor: pointer; opacity: .45; }
.ckchip.on { opacity: 1; border-color: var(--accent); }
.cksw { width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid var(--edge); display: inline-block; }

/* Sibling strip on a part opened from a list (Jordan 2026-09-20): the
   listed parts ride the Geometry/Tooling drawer — one click switches. */
.plsibs { margin: 2px 0 8px; padding: 6px; border: 1px solid var(--edge);
  border-radius: 6px; }
.plsiblbl { display: block; color: var(--dim); font-size: 11px;
  margin-bottom: 4px; }
.plsibrow { display: flex; gap: 6px; flex-wrap: wrap; }
.plsib { display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 4px 6px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px; cursor: pointer;
  font-size: 10px; max-width: 96px; }
.plsib span { overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 84px; }
.plsib:hover { border-color: var(--accent); }
.plsib.cur { border-color: var(--sel); cursor: default;
  background: color-mix(in srgb, var(--sel) 8%, transparent); }
