/* 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; --etch: #3fd46a; --chop: #ff9f1a;
  /* O79 chunk b: light-green note -- a pierce as good as the shape allows */
  --note: #b8f0a8;
  /* O78 (Jordan 2026-11-01): a feature's line says what it is --
     closed outer dark blue, closed inner light blue, open gray, etch
     green; defaults only, every one changeable under Colours & legend */
  --closed-outer: #3d7be0; --closed-inner: #8fd6ff; --open-line: #9aa3ad;
  /* 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;
  --closed-outer: #1d4fa8; --closed-inner: #3fa9e6; --open-line: #8a939c;
  --etch: #1f9d4a;
  --note: #74c25e;
  --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); }
/* Fix list item 1 (Jordan 2026-10-15): an unflagged RED finding turns
   its dot AND its whole tab red -- distinct glyph from yellow's "!". */
.dot.red { background: var(--bad); color: #fff; }
.tab.redtab { color: var(--bad); box-shadow: inset 0 3px 0 var(--bad); }
.tab.redtab.active { color: 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); }
.chip.grouplabel { cursor: default; }
.chip.grouplabel:hover { border-color: var(--edge); }

#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; }
/* New layout, step 3: a panel this tab does not use (menubar.js) */
.panel.kmstagehide { display: none !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); }
/* Queue cards (#7, New/Clear): where every job stands, one click filters */
#jobqueues { margin: 18px 0 0; }
#jobqueues[hidden] { display: none; }
#jobqueues .qhead { font-weight: 600; margin-bottom: 8px; }
#jobqueues .qhead .drawernote { display: inline; font-weight: 400; margin-left: 8px; }
#jobqueues .qrow { display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
#jobqueues .qcard { display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; text-align: left; padding: 8px 8px; min-height: 100px; min-width: 0;
  background: var(--panel); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 8px; cursor: pointer; font: inherit; box-shadow: none; }
#jobqueues .qcard:hover { border-color: var(--accent); }
#jobqueues .qcard.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#jobqueues .qcard.empty { opacity: .55; }
#jobqueues .qtitle { font-size: 12px; font-weight: 600; }
#jobqueues .qn { font-size: 26px; font-weight: 600; line-height: 1.1; }
#jobqueues .qsub { font-size: 11px; color: var(--dim); }
#jobqueues .qjobs { display: flex; flex-direction: column; width: 100%;
  margin-top: 4px; font-size: 11px; color: var(--dim); }
#jobqueues .qjobs span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#jobqueues .q-red .qn, #jobqueues .q-red .qtitle { color: var(--bad); }
#jobqueues .q-blocked .qn { color: var(--warn); }
#jobqueues .q-done .qn { color: var(--good); }
.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); }
.findrow.fsel { outline: 2px 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; }
/* Floor stations on Shop setup (pin engine-side-ui-state, chunk D2) */
#wizstname { flex: 1; min-width: 0; }
.wizst { margin: 4px 0 8px; font-size: 12px; max-height: 220px; overflow: auto; }
.wizstrow { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px solid var(--edge); }
.wizstlog { padding: 1px 0; }

/* 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; }

/* 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; }
/* R3 quick look (speed 1-120): the canvas shows through, card on top */
#busy.quick { background: rgba(0, 0, 0, .06); align-items: flex-start;
  padding-top: 56px; }
#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; }
/* Options bar (New layout, step 4): the active tool's choices, top centre */
#dmbar, #hqbar { position: absolute; left: 50%; transform: translateX(-50%); top: 10px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  width: max-content; max-width: calc(100% - 24px);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--edge); border-radius: 8px; padding: 5px 10px;
  font-size: 12px; box-shadow: var(--float); z-index: 6; }
#dmbar[hidden], #hqbar[hidden] { display: none; }
#dmbar .dmtitle, #hqbar .dmtitle { font-weight: 600; margin-right: 4px; }
/* the kinds read as one switch: the chosen one lit, the rest quiet */
#dmbar .dmkind, #hqbar .dmkind { background: var(--bg); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--edge); margin: 0; }
#dmbar .dmkind.on, #hqbar .dmkind.on { background: var(--accent); color: #0d1013; box-shadow: none; filter: none; }
#dmbar .drawernote, #hqbar .drawernote { display: inline; margin: 0 4px; }
#hqbar .fld { display: inline-flex; align-items: center; gap: 3px; }
#hqbar .unitfield.mini { width: 70px; }
/* Context bar (New layout, step 6): the selection's likely next actions,
   floating just above it; More… = the full right-click list */
#kmctxbar { position: absolute; display: flex; align-items: center; gap: 5px;
  width: max-content; max-width: calc(100% - 16px); flex-wrap: wrap;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--edge); border-radius: 8px; padding: 4px 8px;
  font-size: 12px; box-shadow: var(--float); z-index: 5; }
#kmctxbar[hidden] { display: none; }
#kmctxbar .cbtitle { color: var(--dim); margin-right: 3px; white-space: nowrap; }
.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); }
#leavemodal { position: fixed; inset: 0; z-index: 88;
  background: rgba(0, 0, 0, .45); display: flex; align-items: center;
  justify-content: center; }
#leavemodal[hidden] { display: none; }
#leavecard { width: 380px; 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 classic-CAM 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 solid var(--warn);
  background: color-mix(in srgb, var(--warn) 8%, transparent); }
#plband.cross { border-style: dashed; }
#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); }
/* Source-mode filter panel (pin source-truth-view): floats over the
   canvas, top-right; display-only checkboxes. */
/* Source-mode inspector card (chunk C): one clicked entity, read-only. */
#srcinsp { position: absolute; z-index: 31; width: 300px; padding: 6px 10px 8px;
  background: var(--panel, #1c2128); border: 1px solid var(--edge);
  border-radius: 6px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#srcinsp .si-h { font-weight: 600; display: flex; align-items: center; gap: 6px;
  color: var(--accent, #4da3ff); margin-bottom: 4px; }
#srcinsp .si-n { color: var(--dim, #8b97a5); font-weight: 400; }
#srcinsp .si-x { margin-left: auto; background: none; border: 0; color: var(--dim);
  font-size: 15px; cursor: pointer; }
#srcinsp .si-r { display: flex; gap: 8px; padding: 1px 0; }
#srcinsp .si-k { width: 58px; flex: none; color: var(--dim, #8b97a5); }
#srcinsp .si-v { flex: 1; }
#srcinsp .si-v a { color: var(--accent, #4da3ff); }
#srcinsp .si-note { margin-top: 5px; color: var(--dim, #8b97a5); font-size: 11px; }
#srcinsp .srcf-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  vertical-align: middle; }
/* Source-mode feature report card: read-only, top-left of the canvas. */
#srcfr { position: absolute; top: 52px; left: 12px; z-index: 31; width: 340px;
  max-height: calc(100% - 70px); overflow: auto; padding: 6px 10px 8px;
  background: var(--panel, #1c2128); border: 1px solid var(--edge);
  border-radius: 6px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#srcfr .si-h { font-weight: 600; display: flex; align-items: center; gap: 6px;
  color: var(--accent, #4da3ff); margin-bottom: 4px; }
#srcfr .si-n { color: var(--dim, #8b97a5); font-weight: 400; }
#srcfr .si-x { margin-left: auto; background: none; border: 0; color: var(--dim);
  font-size: 15px; cursor: pointer; }
#srcfr .si-r { display: flex; gap: 8px; padding: 1px 0; }
#srcfr .si-k { width: 40px; flex: none; color: var(--dim, #8b97a5); }
#srcfr .si-note, #srcfr .fr-dim { color: var(--dim, #8b97a5); font-size: 11px; margin-top: 3px; }
#srcfr .fr-g { font-weight: 600; margin: 8px 0 3px; border-top: 1px solid var(--edge); padding-top: 6px; }
#srcfr .fr-t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#srcfr .fr-t th { text-align: left; color: var(--dim, #8b97a5); font-weight: 400; font-size: 11px; }
#srcfr .fr-t td { padding: 1px 4px 1px 0; }
#srcfr .fr-off td { color: var(--warn, #e0a030); }
#srcfr .fr-bad { color: var(--bad, #e05050); }
#srcfr .fr-good { color: var(--good, #4caf50); }
#srcfilter { position: absolute; top: 52px; right: 12px; z-index: 30;
  width: 250px; max-height: calc(100% - 70px); overflow: auto;
  background: var(--panel, #1c2128); border: 1px solid var(--edge);
  border-radius: 6px; font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
#srcfilter .srcf-top { padding: 6px 10px; font-weight: 600; cursor: pointer;
  color: var(--accent, #4da3ff); user-select: none; }
#srcfilter .srcf-body { padding: 0 10px 8px; }
#srcfilter .srcf-g { margin-top: 6px; }
#srcfilter .srcf-h { font-weight: 600; color: var(--dim, #8b97a5);
  display: flex; margin-bottom: 2px; }
#srcfilter .srcf-all { margin-left: auto; font-weight: 400; }
#srcfilter .srcf-all a { color: var(--accent, #4da3ff); }
#srcfilter .srcf-row { display: flex; align-items: center; gap: 5px;
  padding: 1px 0; cursor: pointer; }
#srcfilter .srcf-l { flex: 1; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
#srcfilter .srcf-n { color: var(--dim, #8b97a5); font-variant-numeric: tabular-nums; }
#srcfilter .srcf-sw { width: 10px; height: 10px; border-radius: 2px;
  border: 1px solid rgba(128,128,128,.6); }
#srcfilter .srcf-fl { border: 1px solid var(--line, #3a4350); background: none;
  color: var(--dim, #8b97a5); border-radius: 3px; padding: 0 4px; margin-left: 2px;
  font-size: 11px; line-height: 15px; cursor: pointer; }
#srcfilter .srcf-fl:hover { color: var(--ink, #ddd); }
#srcfilter .srcf-fl.on { background: var(--accent, #4da3ff); color: #fff;
  border-color: var(--accent, #4da3ff); }
#srcfilter .srcf-note { margin-top: 6px; color: var(--dim, #8b97a5);
  font-style: italic; }
/* tag-and-flip chunk 2: the banded pick's two buttons carry words */
#srcfilter .srcf-sel .srcf-fl { width: auto; padding: 1px 7px; }
/* Save list chip -- shown on any screen while list rows are unsaved. */
#plsavechip { border-color: var(--warn); color: var(--warn);
  align-self: center; margin-left: 8px; }

/* Quote shows the math: per-part breakdown table (pin quote-show-the-math) */
.qtabwrap { overflow-x: auto; max-width: 100%; }
table.qtab { width: 100%; border-collapse: collapse; font-size: 9.5px;
  margin: 4px 0; font-variant-numeric: tabular-nums; }
table.qtab th, table.qtab td { padding: 2px 1px; text-align: right;
  border-bottom: 1px solid var(--line, #444); white-space: nowrap; }
table.qtab th:first-child, table.qtab td:first-child { text-align: left; }
table.qtab th { font-weight: 600; opacity: .8; white-space: normal; }
table.qtab tfoot td { font-weight: 600; border-top: 2px solid var(--line, #444); }

/* quote bumps (pin quote-show-the-math chunk 2) */
.qbrow { flex-wrap: wrap; }
.qbrow .qbfield { width: 70px; }
.qbrow .qbnote { flex-basis: 100%; margin: 1px 0 4px; }
.qbrow .qdefbox { flex-basis: 100%; margin: 2px 0 6px; padding: 6px; border: 1px solid var(--line, #444); border-radius: 4px; }
table.qtab td.qprice { cursor: pointer; text-decoration: underline dotted; }
table.qtab td.qprice.bumped { color: var(--warn, #c80); }

/* Per-nest sheet list (pin sheet-size-input, chunk 3) */
.slover.grayed { opacity: 0.45; }
.slline { border-left: 2px solid var(--dim); padding: 2px 0 2px 6px; margin: 5px 0; font-size: 12px; }
.slr { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 1px 0; }
.slr input:not([type=checkbox]) { width: 3.6em; padding: 1px 3px; }
.slr input:disabled { opacity: 0.4; }
.slr label { display: inline-flex; align-items: center; gap: 2px; }
.slr .slbtns { margin-left: auto; white-space: nowrap; }
.slr .slbtns .btn { padding: 0 5px; min-width: 0; margin-left: 2px; }
.slr .slpg { white-space: nowrap; }

/* Menu bar + Ctrl+K command search (pin ui-streamline-panels step 2) —
   New layout only; menubar.js adds these elements only when it is on. */
#menubar { display: flex; align-items: center; gap: 0; height: 28px;
  padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--edge); }
/* the menu row takes 28px; the header and tabs below stay as they were */
body.layout-new #workbench { height: calc(100% - 46px - 28px); }
body.km-wait #panel_healqc, body.km-wait #panel_dims { display: none; }
body.layout-new #workbench.hintleft::after,
body.layout-new #workbench.hintright::after { top: 74px; }
#menubar .mbtop { background: none; border: 0; color: var(--dim);
  font: inherit; font-size: 13px; padding: 2px 8px; border-radius: 5px;
  cursor: pointer; }
#menubar .mbtop:hover, #menubar .mbtop.on { color: var(--ink);
  background: var(--bg); }
#mbdrop { position: fixed; z-index: 60; min-width: 300px; max-width: 460px;
  max-height: calc(100vh - 70px); overflow: auto; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px; padding: 5px;
  box-shadow: var(--float); }
.mbitem { display: flex; justify-content: space-between; gap: 18px;
  padding: 5px 10px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.mbitem:hover, .mbitem.sel { background: var(--accent); color: #0d1013; }
.mbitem .mbkey { color: var(--dim); font-size: 12px; white-space: nowrap; }
.mbitem .mbchk { display: inline-block; width: 18px; }
.mbitem:hover .mbkey, .mbitem.sel .mbkey { color: #0d1013; }
.mbitem.off { color: var(--dim); }
.mbitem.off:hover, .mbitem.off.sel { background: var(--bg); color: var(--ink); }
.mbitem.off:hover .mbkey, .mbitem.off.sel .mbkey { color: var(--dim); }
.mbsep { height: 1px; background: var(--edge); margin: 4px 6px; }
.mbnote { color: var(--dim); font-size: 12px; padding: 4px 10px; }
#kmpal { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.35);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh; }
#kmpalbox { width: min(560px, 92vw); background: var(--panel);
  border: 1px solid var(--edge); border-radius: 10px; padding: 8px;
  box-shadow: var(--float); }
#kmpalin { width: 100%; font: inherit; font-size: 15px; padding: 9px 11px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 7px; outline: none; margin-bottom: 6px; }
#kmpalin:focus { border-color: var(--accent); }
/* the search box on the menu row (Aristide 2026-10-19 'A+B') */
#mbsearch { margin-left: auto; flex: 0 1 180px; min-width: 90px; height: 22px;
  display: inline-flex; align-items: center; gap: 6px; padding: 0 6px 0 8px;
  background: var(--bg); border: 1px solid var(--edge); border-radius: 6px;
  color: var(--dim); font: inherit; font-size: 12px; cursor: text; overflow: hidden; }
#mbsearch:hover { border-color: var(--accent); color: var(--ink); }
#mbsearch svg { flex: none; }
#mbsearch .mbstxt { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#mbsearch kbd { flex: none; font: inherit; font-size: 11px; color: var(--dim);
  border: 1px solid var(--edge); border-radius: 4px; padding: 0 4px; line-height: 15px; }
#kmpallist .kpalwarn .mblab { min-width: 0; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
#kmpallist .kdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  margin-right: 7px; vertical-align: 1px; }
#kmpallist .kdot.bad { background: var(--bad); }
#kmpallist .kdot.warn { background: var(--warn); }
#kmpallist .kpalhead { font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 6px 10px 2px; }
.kmflash { outline: 2px solid var(--accent); outline-offset: 2px; }

/* New layout, step 5: the drawer as Properties above Checks (menubar.js) */
#drawerbody.kmsplit-on { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
#drawerbody.kmsplit-on .kmhalf { display: flex; flex-direction: column; min-height: 26px; }
#drawerbody.kmsplit-on .kmhalf-props { flex: 0 0 55%; }
#drawerbody.kmsplit-on .kmhalf-checks { flex: 1 1 0; }
#drawerbody.kmsplit-on .kmhalf.folded { flex: 0 0 auto !important; }
#drawerbody.kmsplit-on .kmhalf.folded .kmhalfbody { display: none; }
.kmhalfhead { flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim); padding: 5px 12px; cursor: pointer;
  background: var(--bg); border-bottom: 1px solid var(--edge); user-select: none; }
.kmhalfhead::before { content: "▾ "; }
.kmhalf.folded .kmhalfhead::before { content: "▸ "; }
.kmhalfn { font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 8px; }
.kmhalfbody { flex: 1 1 auto; overflow: auto; padding: 8px 12px; min-height: 0; }
.kmsplitgrip { flex: 0 0 6px; cursor: row-resize; background: var(--edge); opacity: .6; }
.kmsplitgrip:hover { opacity: 1; background: var(--accent); }
/* help paragraphs become (i) tips: one line until clicked */
p.drawernote.kmtip { cursor: pointer; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
p.drawernote.kmtip::before { content: "ⓘ "; font-style: normal; color: var(--accent); }
p.drawernote.kmtip.open { white-space: normal; }
#drawerbody.kmsplit-on .kmhalf.empty { flex: 0 0 auto !important; }
#drawerbody.kmsplit-on .kmhalf.empty .kmhalfbody { display: none; }
#drawerbody.kmsplit-on:has(.kmhalf-checks.folded) .kmhalf-props:not(.folded),
#drawerbody.kmsplit-on:has(.kmhalf-checks.empty) .kmhalf-props:not(.folded) { flex: 1 1 0 !important; }
#drawerbody.kmsplit-on:has(.kmhalf-props.empty) + .kmsplitgrip { display: none; }

/* ---- Clear layout (Aristide 2026-10-18 'go', the third UI) ----------------
   New + the clarity pass of docs/mockups/ui-clarity. Everything here is
   gated on body.layout-clear, so Classic and New render exactly as before
   (rollback tag rollback-point-ui-2026-10-18b). */
/* 6: the tabs read as numbered steps, the number IN the status circle
   (green / yellow / red / grey), plus one Next button (Aristide 2026-10-19:
   "put the one IN the circle", "the > makes no sense") */
body.layout-clear #tabs { counter-reset: kmstep; gap: 2px; min-width: 0; }
body.layout-clear .tab { counter-increment: kmstep; border-radius: 7px;
  border-color: transparent; white-space: nowrap; padding: 5px 10px; }
body.layout-clear .tab .dot { width: 21px; height: 21px; font-size: 0; }
body.layout-clear .tab .dot::before { content: counter(kmstep); font-size: 11.5px; }
body.layout-clear .tab .dot.pending { background: none; border: 1.5px solid var(--dim); color: var(--dim); }
body.layout-clear .tab:not(:has(.dot))::before { content: counter(kmstep); font-size: 11.5px;
  width: 21px; height: 21px; border-radius: 50%; border: 1.5px solid var(--dim);
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }
body.layout-clear .tab.active { background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: transparent; }
#kmnext, #mbbrand { display: none; }
body.layout-clear #kmnext:not([hidden]) { display: inline-block; background: transparent;
  color: var(--accent); border: 1px solid var(--accent); font-weight: 600; margin-right: 6px;
  white-space: nowrap; }
body.layout-clear #kmnext:not([hidden]):hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent); }
/* the name one row up, left of File; the corner keeps just a K */
body.layout-clear #mbbrand { display: inline-block; font-weight: 700; color: var(--accent);
  letter-spacing: .04em; margin-right: 10px; align-self: center; cursor: pointer; }
body.layout-clear #mbbrand:hover { text-decoration: underline; }
body.layout-clear #brand { font-size: 0; letter-spacing: 0; }
body.layout-clear #brand::before { content: "K"; font-size: 15px; width: 26px; height: 26px;
  border-radius: 7px; background: var(--accent); color: #06121d; display: inline-flex;
  align-items: center; justify-content: center; }
/* one row at any width: the corner chips ride the menu row's right end
   (Aristide 2026-10-19 "all these can be one menu higher"), small */
body.layout-clear #topbar { flex-wrap: nowrap; min-width: 0; }
body.layout-clear #menubar #topright { margin-left: 10px; gap: 4px; align-items: center; }
body.layout-clear #menubar #topright .chip { height: 22px; min-width: 26px; padding: 0 7px;
  font-size: 12px; line-height: 20px; border-radius: 5px; }
body.layout-clear #jobname { max-width: 150px; flex: 0 1 auto; }
body.layout-clear #groupchip { max-width: 170px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 0 1 auto; }
/* narrow window: the other tabs keep their numbered circle, the open tab
   keeps its name (hover a circle for its stage) */
@media (max-width: 1360px) {
  body.layout-clear .tab:not(.active) { font-size: 0; gap: 0; padding: 5px 7px; }
}
/* 5: every rail tool says what it is */
body.layout-clear .tool { width: 44px; height: auto; min-height: 44px;
  flex-direction: column; gap: 2px; padding: 5px 0 4px; }
body.layout-clear .tool::after { content: attr(data-label); font-size: 9.5px; letter-spacing: -.2px;
  line-height: 1.1; color: var(--dim); white-space: nowrap; }
body.layout-clear .tool.on::after { color: var(--accent); }
body.layout-clear .tool .key { top: 2px; right: 2px; bottom: auto; font-size: 9px; }
/* 2: explanations step aside to one line; hover (or focus) shows it all */
body.layout-clear .drawernote:not(.stale):not(.kwarn):not(.kopen) { white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; cursor: pointer; }
body.layout-clear .drawernote:not(.stale):not(.kwarn):not(.kopen):hover { white-space: normal; overflow: visible; }
/* cold review H4: a note that warns never clips (warnings are never
   folded), a tap opens any clipped note (a tablet can't hover), and
   Floor mode never clips. */
body.layout-clear .drawernote.kwarn { color: var(--warn); }
body.layout-clear.km-floor .drawernote { white-space: normal !important; overflow: visible !important; }
/* 3: "all clear" is one quiet green line, not a full-width block */
body.layout-clear .banner.pass { background: none; color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 45%, transparent);
  font-weight: 600; padding: 5px 10px; text-align: left; }
/* chunk 2: the Tooling panel in three plain sections (.kmclear) */
.kmclear .ksec { padding: 10px 0 12px; border-bottom: 1px solid var(--edge); }
.kmclear .ksec:last-child { border-bottom: 0; }
.kmclear .khead { display: flex; justify-content: space-between; font-size: 11.5px;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 6px; }
.kmclear .khead a { text-transform: none; letter-spacing: 0; font-weight: 400; }
.kmclear .kbig { font-size: 16px; color: var(--ink); margin: 0 0 6px; }
/* nest at a glance (Aristide 2026-10-19 '5') */
.kmclear .kglance { display: flex; gap: 22px; margin: 6px 0 2px; }
.kmclear .kgnum { font-size: 26px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.kmclear .kglab { font-size: 11px; color: var(--dim); }
.kmclear .kmethods { margin: 8px 0 6px; }
.kmclear .kmeth { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.kmclear .kmcard { display: flex; gap: 8px; align-items: center; border: 1px solid var(--edge);
  border-radius: 7px; padding: 5px 8px; font-size: 11.5px; color: var(--dim); line-height: 1.35; }
.kmclear .kmpicw { flex: none; min-width: 49px; }
.kmclear .kmwin { color: var(--accent); font-weight: 600; }
.kmclear .kmcard.win { border-color: var(--accent); }
.kmclear .kmcard b, .kmclear .kmcard .kmname { color: var(--ink); }
.kmclear .kmcard .kmname { font-weight: 600; }
.kmclear .kmpic { display: block; }
.kmclear .kmpic .ksh { fill: none; stroke: var(--dim); stroke-width: 1; }
.kmclear .kmpic .ksu { fill: var(--dim); opacity: .45; }
.kmclear .kmcard.win .kmpic .ksu { fill: var(--accent); opacity: .7; }
.kmclear .kmore { font-size: 11px; vertical-align: middle; }
.kmclear .kv .v { text-align: right; }
/* #1: the not-packed method picker -- outlined rows, not a blue wall */
.kmclear .kmethp .btn:not(.primary) { display: block; width: 100%; margin: 0 0 4px; text-align: left;
  background: transparent; color: var(--ink); border: 1px solid var(--edge); font-weight: 400; }
.kmclear .kmethp .btn:not(.primary):hover { border-color: var(--accent); color: var(--accent); }
/* Warnings chip (2026-10-19): open red/yellow on the menu row, Clear only */
#kmwarn[hidden] { display: none; }
body.layout-clear #menubar #topright .chip.kmwarn { display: inline-flex; align-items: center;
  gap: 6px; padding: 0 9px; font-weight: 600; white-space: nowrap; }
.chip.kmwarn.bad { color: var(--bad); border-color: var(--bad); }
.chip.kmwarn.warn { color: var(--warn); border-color: var(--warn); }
.chip.kmwarn .kwtab { color: var(--dim); font-weight: 400; }
#kmwdrop { position: fixed; z-index: 60; min-width: 280px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 8px; padding: 5px; box-shadow: var(--float); }
#kmwdrop .mblab { display: inline-flex; align-items: center; gap: 8px; }
#kmwdrop .kdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
#kmwdrop .kdot.bad, .chip.kmwarn .kdot.bad { background: var(--bad); }
#kmwdrop .kdot.warn, .chip.kmwarn .kdot.warn { background: var(--warn); }
.chip.kmwarn .kdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
/* Deliver files (2026-10-19): the delivered set as quiet outline chips */
.kmclear .kfiles a.btn.small { background: transparent; color: var(--accent);
  border: 1px solid var(--edge); font-weight: 500; }
.kmclear .kfiles a.btn.small:hover { border-color: var(--accent); }
/* Post programs (2026-10-19): long engine lines read as a stacked block */
.kmclear .kprogs .kv { display: block; margin: 4px 0 2px; }
.kmclear .kprogs .kv .k { display: block; color: var(--ink); font-weight: 600; }
.kmclear .kprogs .kv .v { display: block; text-align: left; color: var(--dim); }
.kmclear .ktag { font-size: 10.5px; border-radius: 8px; padding: 0 7px; margin-left: 6px;
  border: 1px solid var(--edge); color: var(--dim); white-space: nowrap; }
.kmclear .ktag.you { color: #b48cff; border-color: #b48cff; }
.kmclear .kacts { display: flex; gap: 6px; margin: 8px 0 4px; }
.kmclear .kacts .btn { flex: 1; }
.kmclear .klink { display: inline-block; margin-top: 6px; font-size: 13px; }
.kmclear .khint { color: var(--dim); margin: 0; }
.kmclear .krow { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; }
.kmclear .krow b { font-weight: 600; }
.kmclear .kdot { width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--dim); transform: translateY(-1px); }
.kmclear .kdot.note { background: var(--note); } .kmclear .kdot.ok { background: var(--good); } .kmclear .kdot.warn { background: var(--warn); }
.kmclear .kdot.bad { background: var(--bad); } .kmclear .kdot.you { background: #b48cff; }
.kmclear .kfold { margin-top: 8px; }
.kmclear .kfold > summary { cursor: pointer; color: var(--accent); font-size: 13px; }
/* Cut plan + Layers folds sit outside .kmclear (Layers rides every tab) */
body.layout-clear .kmcutplan, body.layout-clear .kmlayers { margin-top: 10px;
  border-top: 1px solid var(--line, #3a4350); padding-top: 8px; }
body.layout-clear .kmcutplan > summary, body.layout-clear .kmlayers > summary {
  cursor: pointer; color: var(--accent); font-size: 13px; }
/* empty inline-flex dot sits on the baseline (high) -- centre it on the text */
body.layout-clear .kmcutplan > summary .dot { width: 11px; height: 11px; font-size: 0;
  vertical-align: middle; position: relative; top: -1px; margin: 0 3px 0 2px; }

/* ---- Floor mode (Aristide 2026-10-19, #8 piece a) ----
   Clear in big type with tap-sized controls, for a shop-floor tablet.
   Gated on body.layout-clear.km-floor, so Classic, New and Clear render
   exactly as before. The panels' contents scale with CSS zoom (text
   reflows to the panel, nothing overflows); the canvas is never zoomed,
   so picking and dragging on it stay true. */
body.layout-clear.km-floor { font-size: 15px; }
body.layout-clear.km-floor #menubar { height: 38px; }
body.layout-clear.km-floor #menubar .mbtop { font-size: 16px; padding: 6px 12px; }
body.layout-clear.km-floor .mbitem { font-size: 16px; padding: 11px 14px; }
body.layout-clear.km-floor .mbitem .mbkey { font-size: 14px; }
body.layout-clear.km-floor #mbdrop { max-width: 560px; }
body.layout-clear.km-floor #topbar { height: 56px; }
body.layout-clear.km-floor #workbench { height: calc(100% - 56px - 38px); }
body.layout-clear.km-floor .tab { font-size: 17px; padding: 9px 16px; gap: 8px; }
/* big type needs room: below 1700px only the open tab keeps its name,
   the others their numbered circle (hover or tap shows the stage) */
@media (max-width: 1700px) {
  body.layout-clear.km-floor .tab:not(.active) { font-size: 0; gap: 0; padding: 9px 8px; }
}
body.layout-clear.km-floor .tab .dot { width: 26px; height: 26px; }
body.layout-clear.km-floor .tab .dot::before { font-size: 14px; }
body.layout-clear.km-floor #kmnext:not([hidden]) { font-size: 16px; padding: 9px 16px; }
body.layout-clear.km-floor #jobname { font-size: 17px; max-width: 200px; }
body.layout-clear.km-floor .panel[data-panel="checks"]:not(.floating) { width: 400px; }
body.layout-clear.km-floor .panel[data-panel="healqc"]:not(.floating) { width: 300px; }
body.layout-clear.km-floor .panel[data-panel="dims"]:not(.floating) { width: 320px; }
body.layout-clear.km-floor .panel[data-panel="tools"] { width: 72px; }
body.layout-clear.km-floor #drawerbody, body.layout-clear.km-floor #healqcbody,
body.layout-clear.km-floor #dimsbody, body.layout-clear.km-floor #toolbar { zoom: 1.3; }
body.layout-clear.km-floor .panel:not([data-panel="tools"]) .pgrip { font-size: 16px; padding: 9px 10px; }
body.layout-clear.km-floor .panel:not([data-panel="tools"]) .pbtn { min-width: 34px; min-height: 34px; }
/* tap targets: x1.3 zoom makes these about 44px on screen */
body.layout-clear.km-floor #drawerbody .btn,
body.layout-clear.km-floor #drawerbody a.btn { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
body.layout-clear.km-floor #drawerbody input:not([type="checkbox"]):not([type="radio"]),
body.layout-clear.km-floor #drawerbody select { min-height: 30px; }
body.layout-clear.km-floor #drawerbody input[type="checkbox"],
body.layout-clear.km-floor #drawerbody input[type="radio"] { width: 20px; height: 20px; }
body.layout-clear.km-floor #drawerbody details > summary { padding: 7px 0; }
body.layout-clear.km-floor #zoomui { zoom: 1.3; }
body.layout-clear.km-floor #homeinner { zoom: 1.25; }

/* Floor home (#8 piece b): the Ready to cut band, Floor mode only. */
#floorready { margin: 18px 0 0; }
#floorready[hidden] { display: none; }
#floorready .frhead { font-weight: 700; font-size: 20px; margin-bottom: 10px; }
#floorready .frhead .frn { display: inline-block; min-width: 28px; padding: 0 8px;
  border-radius: 14px; background: var(--accent); color: #fff; text-align: center; font-size: 16px; }
#floorready .frhead .drawernote { display: inline; font-weight: 400; font-size: 14px; margin-left: 8px; }
#floorready .frrow { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
#floorready .frcard { display: flex; flex-direction: column; border: 2px solid var(--edge);
  border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer; overflow: hidden; }
#floorready .frcard:hover { border-color: var(--accent); }
#floorready .frcard.stale { border-color: var(--warn); }
#floorready .frpic { height: 170px; display: flex; align-items: center; justify-content: center;
  background: #fafafa; border-bottom: 1px solid var(--edge); }
#floorready .frpic svg { width: 100% !important; height: 166px !important; border: 0 !important; }
#floorready .frbody { padding: 10px 12px 12px; }
#floorready .fron { font-size: 30px; font-weight: 700; letter-spacing: .5px; line-height: 1.15; }
#floorready .frname { font-size: 16px; margin-top: 2px; word-break: break-word; }
#floorready .frmeta { font-size: 14px; opacity: .8; margin-top: 2px; }
#floorready .frred { color: #c62828; font-weight: 700; margin-right: 6px; }
#floorready .fryel { color: #a07800; font-weight: 700; }
#floorready .frwarn { margin-top: 6px; padding: 6px 8px; border-radius: 6px;
  background: #fff4cc; color: #6b5000; font-size: 14px; }
#floorready .frbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#floorready .frbtns .btn, #floorready .frall { min-height: 40px; padding: 8px 14px; font-size: 15px;
  display: inline-flex; align-items: center; text-decoration: none; }
#floorready .frall { margin-top: 10px; }
#floorready .frbtns .btn.primary { background: var(--accent); color: #002033; border-color: var(--accent); font-weight: 700; }
#floorready .frbtns .btn:not(.primary) { background: transparent; color: var(--ink); border: 1px solid var(--edge); }

/* Floor lock (#8 piece c): the header chip, and the editing tools hide
   while a floor station is locked (the fetch guard refuses the rest). */
#floorlock[hidden] { display: none; }
body.layout-clear.km-floor #floorlock { font-size: 16px; min-height: 40px; padding: 6px 14px;
  margin-left: 8px; white-space: nowrap; flex: none; }
body.layout-clear.km-floor #floorlock.on { background: var(--warn); color: #2a2000; border-color: var(--warn); font-weight: 700; }
body.km-floorlock #toolbar .tool[data-label="Gap"],
body.km-floorlock #toolbar .tool[data-label="Add"],
body.km-floorlock [data-hq^="mode:"]:not([data-hq="mode:bandsel"]),
body.km-floorlock [data-hqadd],
body.km-floorlock #undobtn, body.km-floorlock #redobtn,
body.km-floorlock #jobshome #dropzone { display: none !important; }
/* Clear tour (#9): the tour card reads at floor size in Floor mode (same 340px width, so placement holds). */
body.layout-clear.km-floor #tourcard { font-size: 15px; }
body.layout-clear.km-floor #tourcard #tourtitle { font-size: 18px; }
body.layout-clear.km-floor #tourcard button { min-height: 40px; padding: 6px 14px; font-size: 15px; }
/* cold review H2: in Floor mode the 1.3x panel bodies scroll inside their panel, never the page */
body.layout-clear.km-floor #healqcbody, body.layout-clear.km-floor #dimsbody { overflow-y: auto; overflow-x: hidden; }
/* cold review M6: the jobs home in Clear has no drawing -- the empty
   Checks panel and the drawing tools step aside. */
body.layout-clear.km-home .panel[data-panel="checks"],
body.layout-clear.km-home .panel[data-panel="tools"],
body.layout-clear.km-home .panel[data-panel="healqc"],
body.layout-clear.km-home .panel[data-panel="dims"] { display: none !important; }
/* cold review L12: tap-sized header chips, search and panel buttons on a floor station */
body.layout-clear.km-floor #mbsearch { height: 34px; }
body.layout-clear.km-floor #menubar .chip { min-width: 40px; min-height: 34px; font-size: 16px; }
body.layout-clear.km-floor .pgrip .pbtn { min-width: 40px !important; min-height: 36px !important; font-size: 18px; }
/* cold review H1: an upright tablet (narrow) -- menus tighten, search
   becomes its icon, the warnings chip keeps its dot and count, the menu
   row brand steps aside (the K stays in the header), the panel narrows
   and the zoom bar stays inside the drawing. */
@media (max-width: 1000px) {
  body.layout-clear.km-floor #menubar .mbtop { font-size: 15px; padding: 6px 7px; }
  body.layout-clear.km-floor #mbbrand { display: none; }
  body.layout-clear.km-floor #mbsearch { flex: 0 0 44px; min-width: 44px; justify-content: center; }
  body.layout-clear.km-floor #mbsearch .mbstxt, body.layout-clear.km-floor #mbsearch kbd { display: none; }
  body.layout-clear.km-floor .kmwarn .kwtab { display: none; }
  body.layout-clear.km-floor .panel[data-panel="checks"]:not(.floating) { width: 360px; }
  body.layout-clear.km-floor #zoomui { zoom: 1; max-width: calc(100% - 24px); overflow-x: auto; }
  body.layout-clear.km-floor #floorready .frrow { grid-template-columns: 1fr; }
}
/* cold review H3: a locked floor station shows values, not controls --
   every panel button that writes hides (the in/mm display switch stays),
   fields go read-only (markWarnNotes), the Heal/QC edit panel and the
   context bar step aside, and the panel says why. */
body.km-floorlock #drawerbody button:not(.plubtn),
body.km-floorlock .panel[data-panel="healqc"],
body.km-floorlock #kmctxbar { display: none !important; }
body.km-floorlock #drawerbody::before { content: "🔒 View only — tap Locked to edit";
  display: block; margin: 0 0 10px; padding: 6px 10px; border-radius: 6px;
  background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font-weight: 600; }
@media (max-width: 1000px) {
  body.layout-clear.km-floor #floorlock .flkt { display: none; }
  body.layout-clear.km-floor #kmnext { display: none !important; }
  body.layout-clear.km-floor #jobname { max-width: 150px; }
}

/* Cold review chunk 2 (2026-10-19). M5: Heal/QC in Clear -- quiet outlined
   rows, not a blue wall; the active tool stays lit; the help folds. */
body.layout-clear #healqcbody .hqbtn:not(.on) { background: transparent; color: var(--ink);
  border: 1px solid var(--edge); font-weight: 400; text-align: left; }
body.layout-clear #healqcbody .hqbtn:not(.on):hover { border-color: var(--accent); color: var(--accent); }
body.layout-clear #healqcbody button.btn:not(.hqbtn):not(.primary) { background: transparent;
  color: var(--accent); border: 1px solid var(--edge); font-weight: 500; }
body.layout-clear #healqcbody .hqhelp { margin: 10px 0 4px; }
body.layout-clear #healqcbody select { background: var(--panel); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 4px; }
body.layout-clear #healqcbody .hqhelp > summary { cursor: pointer; color: var(--accent); font-size: 12.5px; }
body.layout-clear #healqcbody .hqhelp .hqnote { font-style: normal; }
/* M6: the drop zone's other doors as outline chips beside Browse */
body.layout-clear #dropzone button:not(#browsebtn) { background: transparent; color: var(--accent);
  border: 1px solid var(--edge); border-radius: 6px; padding: 3px 10px; font: inherit; cursor: pointer; }
body.layout-clear #dropzone button:not(#browsebtn):hover { border-color: var(--accent); }

/* Cut playback strip (pin cut-playback-animation) -- the website demo's
   readout: X/Y in big tabular figures, the G-code with the head's line lit. */
.playopen { background: var(--chop, #ff9f1a); color: #0d1013; border: 0;
  border-radius: 5px; padding: 3px 10px; font-weight: 600; cursor: pointer; }
.playopen:hover { filter: brightness(1.1); }
#playbar { position: absolute; left: 12px; bottom: 52px; z-index: 20;
  width: min(520px, calc(100% - 24px)); background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--edge); border-radius: 8px; padding: 8px 10px;
  font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
#playbar .playrow { display: flex; align-items: center; gap: 8px; }
#playbar:not(.floated) { left: 50%; transform: translateX(-50%); }   /* docked: bottom centre */
#playbar.floated { bottom: auto; }
#playbar.dragging { opacity: .92; box-shadow: 0 10px 30px rgba(0,0,0,.5); user-select: none; }
#playbar .playgrip { cursor: grab; color: var(--dim); font-size: 16px; padding: 0 2px;
  touch-action: none; user-select: none; }
#playbar.dragging .playgrip { cursor: grabbing; }
#playbar .playgrip:hover { color: var(--ink); }
#playbar .playbtn { background: var(--chop, #ff9f1a); color: #0d1013; border: 0;
  border-radius: 5px; padding: 4px 12px; font-weight: 700; min-width: 86px; cursor: pointer; }
#playbar .playbtn:disabled { opacity: .4; cursor: default; }
#playbar .playsm { background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 5px; padding: 2px 8px; cursor: pointer; }
#playbar select { background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 5px; padding: 2px 4px; }
#playscrub { flex: 1; accent-color: var(--chop, #ff9f1a); }
#playbar .playrow2 { display: flex; gap: 14px; margin-top: 8px; align-items: stretch; }
#playbar .playdro { min-width: 120px; font-family: ui-monospace, Menlo, monospace; }
#playbar .playdro span { color: var(--dim); margin-right: 8px; }
#playbar .playdro b { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
#playbar #playmode { color: var(--chop, #ff9f1a); letter-spacing: .08em; margin-top: 2px; }
#playbar .playcon { flex: 1; margin: 0; padding: 4px 8px; background: var(--bg);
  border-radius: 5px; font: 12px/1.45 ui-monospace, Menlo, monospace; color: var(--dim);
  white-space: pre; overflow: hidden; min-height: 7.3em; }
#playbar .playcur { color: var(--chop, #ff9f1a); }
#playbar .playnote { margin-top: 6px; color: var(--ink); }
#playbar .dimnote { color: var(--dim); font-size: 11px; }
#playbar .warnink { color: var(--warn); font-weight: 600; }
body.layout-clear.km-floor #playbar { zoom: 1.2; }

/* Share mode (/play/<code>): the client sees the sheet and the player only.
   body.km-share is set by index.html's first script, so the app's own
   screens never paint on the client's page. */
body.km-share > :not(#workbench):not(#sharetop):not(#sharetabs):not(#sharefoot):not(#sharemsg):not(#shareacct),
body.km-share #workbench > :not(#canvaswrap),
body.km-share #canvaswrap > :not(canvas):not(#playbar):not(#sharehead):not(#sharefit) { display: none !important; }
/* the client's pinch and drag move our view, never the page (app.js shareGestures) */
body.km-share canvas { touch-action: none; }
body.km-share #playbar, body.km-share #playbar * { touch-action: manipulation; }
body.km-share #sharefit { position: absolute; right: 12px; top: 60px; z-index: 21; padding: 4px 14px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--edge); border-radius: 6px;
  font: 600 13px/1.3 inherit; letter-spacing: .03em; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
body.km-share #sharefit[hidden] { display: none !important; }
#playbar .playic { width: 12px; height: 12px; fill: currentColor; vertical-align: -1px; margin-right: 6px; }
#playbar .playstart .playic { margin-right: 0; }
body.km-share #workbench { height: 100%; }
body.km-share #playbar .playgrip { display: none; }
#sharetop { position: fixed; left: 0; right: 0; top: 0; height: 52px; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  border-bottom: 1px solid var(--edge); background: color-mix(in srgb, var(--panel) 85%, transparent); }
#sharetop .kmlogo { display: flex; align-items: center; gap: 10px; color: #f2f0eb; }
#sharetop .kmlogo img { width: 27px; height: 27px; }
#sharetop .kmlogo b { font-weight: 700; font-size: 15px; letter-spacing: .05em; }
#sharetop .shoplogo { width: 160px; height: 38px; }   /* the shop's logo goes here */
#sharehead { position: absolute; left: 16px; top: 62px; z-index: 20; color: var(--dim); font-size: 13px; }
/* the client approval module's pages (Aristide 2026-10-31): centred in the
   top bar; on phones a strip of their own under it */
#sharetabs { position: fixed; top: 0; left: 50%; transform: translateX(-50%); height: 52px; z-index: 31;
  display: flex; align-items: stretch; gap: 4px; }
#sharetabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 14px;
  color: var(--ink); font: 500 13px/1 inherit; letter-spacing: .04em; cursor: pointer; white-space: nowrap; }
#sharetabs button.on { color: #f2f0eb; border-bottom-color: var(--chop, #ff9f1a); cursor: default; }
#sharetabs button:disabled { color: var(--dim); opacity: .5; cursor: default; }
#sharetabs button.acct { margin-left: 18px; color: var(--chop, #ff9f1a); font-weight: 600; }
/* the client's sign-in card (chunk B) */
#shareacct { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(8,10,12,.62); backdrop-filter: blur(3px); }
#shareacct.required { top: 52px; background: var(--canvas, #0d1013); backdrop-filter: none; }
#shareacct .card { position: relative; width: min(380px, 100%); display: grid; gap: 12px; padding: 26px 26px 20px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.5);
  animation: acctIn .32s cubic-bezier(.22,.9,.24,1); }
@keyframes acctIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
#shareacct h2 { margin: 0; font-size: 19px; font-weight: 600; color: #f2f0eb; letter-spacing: .01em; }
#shareacct .sub { margin: -6px 0 4px; color: var(--dim); font-size: 13px; }
#shareacct label { display: grid; gap: 5px; color: var(--dim); font-size: 12px; letter-spacing: .04em; }
#shareacct input { font: 15px/1.3 inherit; color: var(--ink); background: var(--bg); padding: 9px 11px;
  border: 1px solid var(--edge); border-radius: 7px; outline: none; }
#shareacct input:focus { border-color: var(--chop, #ff9f1a); }
#shareacct .hint { margin: -6px 0 0; color: var(--dim); font-size: 11.5px; }
#shareacct .err { margin: 0; min-height: 1em; color: var(--warn, #ff6b5a); font-size: 13px; }
#shareacct .err:empty { display: none; }
#shareacct .go { padding: 10px; border: 0; border-radius: 7px; background: var(--chop, #ff9f1a); color: #0d1013;
  font: 700 14px/1 inherit; letter-spacing: .04em; cursor: pointer; }
#shareacct .go:disabled { opacity: .6; }
#shareacct .swap { margin: 2px 0 0; text-align: center; color: var(--dim); font-size: 13px; }
#shareacct .swap a { color: var(--chop, #ff9f1a); text-decoration: none; }
#shareacct.decide .card { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
#shareacct .note { margin: 0; padding: 10px 12px; border-left: 2px solid var(--chop, #ff9f1a);
  background: var(--bg); color: var(--ink); font-size: 12.5px; line-height: 1.45; border-radius: 0 6px 6px 0; }
#shareacct .opt { color: var(--dim); font-size: 11px; letter-spacing: 0; }
#shareacct textarea { font: 14px/1.4 inherit; color: var(--ink); background: var(--bg); padding: 9px 11px;
  border: 1px solid var(--edge); border-radius: 7px; outline: none; resize: vertical; }
#shareacct textarea:focus { border-color: var(--chop, #ff9f1a); }
#shareacct input[type=file] { padding: 7px; font-size: 13px; }
#shareacct .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#shareacct .alt { padding: 10px; border: 1px solid var(--edge); border-radius: 7px; background: none;
  color: var(--ink); font: 600 14px/1 inherit; cursor: pointer; }
#shareacct .alt:disabled { opacity: .6; }
#shareacct .hist { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 12.5px; color: var(--dim); }
#shareacct .hist li { padding: 8px 10px; background: var(--bg); border-radius: 6px; }
#shareacct .hist li b { color: var(--ink); }
#shareacct .hist li.approve b { color: #6fd08c; }
#shareacct .hist .c { margin-top: 4px; color: var(--ink); white-space: pre-wrap; }
#shareacct .file { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--edge);
  border-radius: 8px; color: var(--ink); text-decoration: none; background: var(--bg); }
#shareacct .file:hover { border-color: var(--chop, #ff9f1a); }
#shareacct .file .ic { flex: none; padding: 7px 6px; border-radius: 4px; background: var(--chop, #ff9f1a); color: #0d1013;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; }
#shareacct .file b { display: block; font-weight: 600; }
#shareacct .file small { display: block; margin-top: 2px; color: var(--dim); font-size: 12px; }
#shareacct .ok { margin: 0; color: #6fd08c; font-size: 13px; }
#shareacct h2 .kmcheck, #sharetabs .kmcheck { width: 18px; height: 18px; vertical-align: -3px; }
#sharetabs .kmcheck { width: 14px; height: 14px; }
#shareacct .x { position: absolute; top: 10px; right: 10px; background: none; border: 0; color: var(--dim);
  font-size: 15px; cursor: pointer; padding: 4px 8px; }
#sharefoot { position: fixed; left: 0; right: 0; bottom: 6px; z-index: 30; text-align: center;
  color: var(--dim); font-size: 11px; pointer-events: none; }
#sharemsg { position: fixed; inset: 52px 0 0; display: grid; place-items: center;
  color: var(--ink); font-size: 18px; background: var(--canvas, #0d1013); }
body.km-share #playbar, body.km-share #playbar.floated { left: 50%; right: auto; top: auto; bottom: 26px;
  transform: translateX(-50%); width: min(560px, calc(100% - 16px)); }
body.km-share #playbar .playrow { flex-wrap: wrap; }
body.km-share #playscrub { flex-basis: 100%; }
#playbar .playspeeds { display: inline-flex; gap: 3px; }
#playbar .playspeeds .playsm { padding: 2px 7px; }
#playbar .playspeeds .playsm.on { background: var(--chop, #ff9f1a); border-color: var(--chop, #ff9f1a);
  color: #0d1013; font-weight: 700; }
@media (max-width: 600px) {
  #sharetop { height: 46px; padding: 0 10px; }
  #sharetop .kmlogo img { width: 22px; height: 22px; }
  #sharetop .shoplogo { width: 110px; height: 32px; }
  #sharemsg { inset: 46px 0 0; }
  #shareacct.required { top: 46px; }
  body.km-share #sharehead { font-size: 12px; left: 10px; right: 10px; top: 90px; }
  body.km-share #sharefit { top: 86px; right: 8px; }
  body.km-share #playbar { padding: 6px 8px; }
  body.km-share #playbar .playrow { gap: 5px; }
  body.km-share #playbar .playbtn { min-width: 0; padding: 4px 10px; }
  body.km-share #playbar .playrow2 { gap: 8px; margin-top: 6px; }
  body.km-share #playbar .playdro { min-width: 92px; }
  body.km-share #playbar .playdro b { font-size: 15px; }
  body.km-share #playbar .playcon { font-size: 10.5px; min-height: 6.5em; }
  body.km-share #playbar .dimnote { display: none; }
}
@media (max-width: 600px) and (orientation: portrait) {
  /* the pages get a strip of their own under the bar (upright phones only:
     a short sideways phone keeps them in the bar, below) */
  #sharetabs { top: 46px; left: 0; right: 0; transform: none; height: 36px; justify-content: space-around;
    gap: 0; border-bottom: 1px solid var(--edge); background: color-mix(in srgb, var(--panel) 85%, transparent); }
  #sharetabs button { padding: 0 6px; font-size: 12.5px; }
  #sharetabs button.acct { margin-left: 0; }
  /* an upright phone: four lines of program (the running line is the
     third) so the turned sheet gets the height */
  body.km-share #playbar .playcon { min-height: 0; max-height: calc(4 * 1.45em + 8px);
    border-bottom: 4px solid var(--bg); padding-bottom: 0; }   /* no fifth line peeking */
}
@media (max-height: 500px) and (orientation: landscape) {
  #sharetop { height: 40px; }
  #sharetabs { height: 40px; }
  #sharetabs button { padding: 0 8px; font-size: 12px; }
  #sharetabs button.acct { margin-left: 6px; }
  #sharetop .shoplogo { width: 110px; }
  #shareacct.required { top: 40px; }
  #sharetop .kmlogo img { width: 20px; height: 20px; }
  #sharetop .shoplogo { height: 28px; }
  body.km-share #sharehead { font-size: 12px; top: 46px; }
  body.km-share #sharefit { top: 44px; right: auto; left: 10px; }
  body.km-share #playbar, body.km-share #playbar.floated { left: auto; right: 6px; top: 46px; bottom: auto;
    max-height: calc(100% - 70px); transform: none; width: min(300px, 44%); overflow: auto; padding: 6px 8px; }
  body.km-share #playbar .playrow2 { flex-direction: column; gap: 6px; }
  body.km-share #playbar .playdro { display: flex; gap: 10px; align-items: baseline; }
  body.km-share #playbar .playdro b { font-size: 14px; }
  body.km-share #playbar .playcon { font-size: 10.5px; min-height: 0; }
  body.km-share #playbar .playbtn { min-width: 0; padding: 4px 8px; }
  body.km-share #playbar .dimnote { display: none; }
}
/* the link drawer (Aristide 2026-10-30: "animate it ... CLASSY"): it
   unfolds by height (grid 0fr -> 1fr) with a soft fade and lift, and the
   chevron on Share turns in step; Share or Esc folds it the same way */
#playbar .playsharewrap { display: grid; grid-template-rows: 1fr; margin: 8px -10px -8px;
  transition: grid-template-rows .34s cubic-bezier(.22,.9,.24,1), margin-top .34s cubic-bezier(.22,.9,.24,1); }
#playbar .playsharewrap.folded { grid-template-rows: 0fr; margin-top: 0; }
#playbar .playshare { min-height: 0; overflow: hidden; border-top: 1px solid var(--edge);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 82%, transparent), color-mix(in srgb, var(--bg) 62%, transparent));
  border-radius: 0 0 8px 8px; transition: border-color .34s ease; }
#playbar .playsharewrap.folded .playshare { border-top-color: transparent; }
#playbar .playshareinner { padding: 10px 10px 12px; display: grid; gap: 7px;
  transition: opacity .26s ease .06s, transform .34s cubic-bezier(.22,.9,.24,1); }
#playbar .playsharewrap.folded .playshareinner { opacity: 0; transform: translateY(-8px); transition-delay: 0s; }
#playbar .sharechev { width: 11px; height: 11px; margin-left: 5px; vertical-align: -1px;
  transition: transform .34s cubic-bezier(.22,.9,.24,1); }
#playbar .sharechev path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#playbar button[aria-pressed="true"] .sharechev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  #playbar .playsharewrap, #playbar .playshareinner, #playbar .sharechev { transition: none; }
}
#playbar .playsm, #playbar .playbtn { white-space: nowrap; flex-shrink: 0; }
#playscrub { min-width: 0; }
/* the slider rides its own full-width line under the buttons, so the
   speed buttons (2026-10-30) never squeeze it or push Share / close out */
#playbar > .playrow:first-child { flex-wrap: wrap; row-gap: 8px; }
#playbar #playscrub { order: 99; flex-basis: 100%; }
#playbar .playend { margin-left: auto; display: inline-flex; gap: 8px; }
#playbar .playshare .playrow { flex-wrap: wrap; }
#playbar .playshare input { min-width: 180px; }
#playbar .sharecopied { color: var(--chop, #ff9f1a); font-weight: 600; display: flex; align-items: center; gap: 6px; }
/* "copied" (Aristide 2026-10-30): the ring draws, fills green, the tick
   strokes in; the Copy button and the link glow green for ~2.4 s */
.kmcheck { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
.kmcheck circle { fill: transparent; stroke: var(--good); stroke-width: 2; stroke-dasharray: 63; stroke-dashoffset: 63;
  transform-origin: center; animation: kmring .35s ease-out forwards, kmfill .2s .3s ease-out forwards, kmpop .3s .3s ease-out; }
.kmcheck path { fill: none; stroke: #0d1013; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 16; stroke-dashoffset: 16; animation: kmring .25s .42s ease-out forwards; }
@keyframes kmring { to { stroke-dashoffset: 0; } }
@keyframes kmfill { to { fill: var(--good); } }
@keyframes kmpop { 50% { transform: scale(1.18); } }
#playbar .copybtn { display: inline-flex; align-items: center; gap: 5px; transition: all .2s ease; }
#playbar .copybtn.copiedfx { border-color: var(--good); color: var(--good); font-weight: 600;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
#playbar .playshare input.copiedfx { border-color: var(--good); animation: kmglow 1.2s ease-out; }
@keyframes kmglow { from { box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 35%, transparent); } }
.shoplogo { display: flex; align-items: center; justify-content: flex-end; }
.shoplogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.wizlogo { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.wizlogo .btn { white-space: nowrap; }
.wizlogo .shoplogo { width: 180px; height: 48px; justify-content: center; border: 1px dashed var(--edge);
  border-radius: 6px; padding: 4px; background: var(--canvas); font-size: 12px; }
#playbar .playsm[aria-pressed="true"] { border-color: var(--chop, #ff9f1a); color: var(--chop, #ff9f1a); }
#playbar .playshare input { flex: 1; background: var(--bg); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 5px; padding: 3px 6px; font: inherit; }
#playbar .sharerow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
@media (max-height: 500px) and (orientation: landscape) and (max-width: 680px) {
  #sharetop .kmlogo b { display: none; }   /* a small sideways phone: the mark alone, the pages fit */
}
/* the client's decision (pin client-approval-center, chunk D): operator link drawer + jobs card */
#playbar .sharedec { font-size: 12px; color: var(--dim); padding: 6px 8px; border-radius: 6px; background: var(--bg); }
#playbar .sharedec b { color: var(--warn); }
#playbar .sharedec.approve b { color: var(--good, #6fd08c); }
#playbar .sharedec a { color: var(--chop, #ff9f1a); }
#playbar .sharedec .c { margin-top: 3px; color: var(--ink); white-space: pre-wrap; }
.jclient { font-size: 11px; padding: 1px 7px; border-radius: 9px; border: 1px solid var(--warn); color: var(--warn); white-space: nowrap; }
.jclient.approve { border-color: var(--good, #6fd08c); color: var(--good, #6fd08c); }
#playbar .playshareinner { max-height: 42vh; overflow: auto; }   /* many links + client decisions: the drawer scrolls, the player stays on screen */
/* Camp-4 B1: the drawing beside the Part list — switch, picker, note */
.pldstrip { margin: 0 0 8px; }
.pldstrip .pldsw { display: inline-flex; gap: 4px; margin-right: 8px; }
.pldstrip .chip.on { border-color: var(--sel); color: var(--sel); }
.pldstrip .pldpick { max-width: 100%; margin: 4px 0; }

/* O79 chunk b: light-green notes in the Checks list */
.kmclear .knote { color: var(--note); font-size: 12px; margin: 2px 0 2px 18px; }
