/* 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;
}
[data-theme="light"] {
  --bg: #f2f4f6; --panel: #ffffff; --edge: #d6dce2; --ink: #1d2530;
  --dim: #5d6a78; --canvas: #fbfcfd; --base-layer: #9aa5b1; --pend: #b7c0c9;
}
* { 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); }
#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); }
#topright { display: flex; gap: 8px; }
.chip { background: var(--bg); color: var(--ink); border: 1px solid var(--edge);
  border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

#workbench { display: flex; height: calc(100% - 46px); }
#toolbar { width: 52px; background: var(--panel); border-right: 1px solid var(--edge);
  display: flex; flex-direction: column; gap: 4px; padding: 8px 6px; }
.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); }
.tool .key { position: absolute; right: 3px; bottom: 1px; font-size: 8px; color: var(--dim); }

#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; }

#drawer { width: 300px; background: var(--panel); border-left: 1px solid var(--edge);
  display: flex; flex-direction: column; }
#drawertitle { padding: 10px 14px; border-bottom: 1px solid var(--edge);
  font-weight: 600; color: var(--dim); letter-spacing: .04em; }
#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; }
.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; }

/* 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); }
.ovrow { display: flex; align-items: center; gap: 7px; padding: 3px 0;
  color: var(--dim); flex-wrap: wrap; }
.ovrow a { 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; }

#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; }
#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); }

/* nest layout-array one-clicks: active spread shows as pressed */
.btn.on { outline: 2px solid var(--accent); outline-offset: 1px;
  filter: brightness(1.15); }

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