/* CentralPlant Cloud tweaks on top of ui.css (the shared design system). */

/* before login the shell has no sidebar */
body.logged-out .main-col { margin-left: 0; }
body.logged-out #tabs { display: none !important; }
body.logged-out main#view { padding-bottom: 40px; }

#org-box { padding: 0 4px 12px; }
#org-box select { width: 100%; }

/* phone: installable app feel */
@media (max-width: 760px) {
  .topbar { padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
}

.plan-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 14px; background: var(--surface-2); }
.plan-card .row + .row { margin-top: 10px; }
.key-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.key-box .mono { flex: 1; background: none; padding: 0; }
.week { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 6px; }
.ro { min-height: 36px; display: flex; align-items: center; font-weight: 550; }
td.t-ref input { min-width: 170px; }
/* child grids with set column widths (CHILD_LAYOUT): inputs take their column, shared cells stack */
table.grid-fixed { table-layout: fixed; width: 100%; min-width: 900px; }
table.grid-fixed th, table.grid-fixed td { padding-left: 5px; padding-right: 5px; }
table.grid-fixed td input:not([type=checkbox]), table.grid-fixed td select { padding-left: 7px; padding-right: 7px; }
table.grid-fixed th.th-actions { width: 40px; }
table.grid-fixed td input:not([type=checkbox]), table.grid-fixed td select { min-width: 0; }
table.grid-fixed td.t-group { white-space: normal; }
table.grid-fixed .cg { display: inline-flex; flex-direction: column; gap: 2px; width: calc(50% - 3px); margin-top: 5px; vertical-align: top; }
table.grid-fixed .cg + .cg { margin-left: 6px; }
table.grid-fixed .cg:only-of-type { width: 100%; }        /* one field under another (address 2): full width */
table.grid-fixed .cg-l { font-size: 11px; color: var(--text-3); line-height: 1.1; }
table.grid-fixed th { white-space: normal; }
/* tabs that wrap onto a second row, in groups (quality system) */
.tabsbar.wrap { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
.tabsbar.wrap a { padding: 8px 11px; }
.tabsbar.wrap.admin-tabs a { padding: 8px 7px; }      /* nightly 11-09 admin#5: the 10 Admin tabs on one row at 1416 px */
.tabsbar .tab-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: 100%; }
.tabsbar .tab-group + .tab-group::before { content: ""; width: 1px; height: 18px; align-self: center; margin: 0 5px; background: var(--border); }
/* a group's name before its tabs (quality system: Documents and people, Problems ...) */
.tabsbar .tab-group-name { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 0 2px 0 4px; white-space: nowrap; }
/* quality tables on a phone: the columns that don't fit fold under the first cell (.hide-phone hides them) */
.q-phone-only { display: none; }
@media (max-width: 760px) { .q-phone-only { display: block; } }
td.t-enum select { min-width: 110px; }
td.t-date input { min-width: 150px; }
td.t-int input { min-width: 72px; }
td.t-dec input { min-width: 96px; }
.callout.mb { margin-bottom: 16px; }
.conn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.conn-row:first-child { border-top: 0; padding-top: 4px; }
.conn-row .cr-main { flex: 1 1 280px; min-width: 0; display: grid; gap: 4px; }
td.mrp-detail { background: var(--surface-2); padding: 8px 16px 14px 48px; }
td.mrp-detail table { font-size: 13px; }
td.mrp-detail td, td.mrp-detail .hint { white-space: normal; }     /* the day-by-day wraps inside the table (buy#3) */
tr.mrp-plan td { font-weight: 600; }                     /* a plan, not a link: marked at the left */
tr.mrp-plan td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.q-in { width: 92px; }
.q-in.q-bad { border-color: var(--bad); color: var(--bad); font-weight: 600; box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 25%, transparent); }
.q-in.q-ok { border-color: var(--ok); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.spc-wrap { overflow-x: auto; }
svg.spc { width: 100%; min-width: 560px; height: auto; display: block; }
.spc-line { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.spc-pt { fill: var(--accent); }
.spc-pt.bad { fill: var(--bad); stroke: var(--surface); stroke-width: 1.5; cursor: pointer; }
.spc-pt.bad.noted { fill: var(--surface); stroke: var(--bad); stroke-width: 2.5; }
.spc-job { stroke: var(--text-3); stroke-dasharray: 3 4; stroke-width: 1; opacity: .7; }
.spc-jobname { font-weight: 600; }
.spc-filter { flex-wrap: wrap; gap: 8px; align-items: center; }
.spc-lim { stroke: var(--bad); stroke-dasharray: 6 4; stroke-width: 1.2; }
.spc-cl { stroke: var(--text-3); stroke-width: 1.2; }
.spc-spec { stroke: var(--warn, #f59e0b); stroke-dasharray: 2 4; stroke-width: 1.5; }
.spc-lab, .spc-axis { font-size: 11px; fill: var(--text-3); stroke: none; }
.spc-lab.spc-lim { fill: var(--bad); }
.spc-lab.spc-spec { fill: var(--warn, #f59e0b); }
.pm-used { display: flex; align-items: center; gap: 8px; }
.pm-used .ubar { flex: 1; }
.pm-used > span { flex: none; min-width: 3.2em; text-align: right; }
/* round 15: a work order / maintenance plan asks what it is for first - big choices, nothing picked (quality.js maintForm) */
.seg.maint-for { align-self: flex-start; flex-wrap: wrap; }
.form.maint-form { align-items: start; }
.missing .seg.maint-for { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.seg.maint-for > a { height: 40px; padding: 0 16px; font-size: 14px; cursor: pointer; }
.seg.maint-for > a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.f .maint-hint { font-weight: 400; }
label.f > span > select { width: 100%; }
.num-unit { display: flex; gap: 8px; min-width: 0; }
.num-unit input { flex: 1 1 0; min-width: 0; width: auto; }
.num-unit select { flex: none; width: auto; }
.maint-out { margin-top: 14px; }
.maint-due { margin: 14px 0 0; display: flex; gap: 6px; align-items: baseline; }
@media (max-width: 760px) { .seg.maint-for { align-self: stretch; } .seg.maint-for > a { flex: 1 1 0; justify-content: center; height: 44px; } }
.checklist { display: grid; gap: 10px; }
.checklist label.cb { font-size: 15px; }
textarea:not(.mono) { font-family: inherit; font-size: 14px; line-height: 1.5; }

/* scheduling board */
.sb-scroll { overflow-x: auto; }
.sb { position: relative; }
.sb-row { display: flex; border-top: 1px solid var(--border); min-height: 58px; }
.sb-headrow { min-height: 34px; border-top: 0; position: sticky; top: 0; z-index: 3; background: var(--surface); }
.sb-label { position: sticky; left: 0; z-index: 2; width: 220px; flex: 0 0 220px; padding: 8px 12px; background: var(--surface);
  border-right: 1px solid var(--border); display: grid; align-content: center; gap: 2px; }
.sb-mname { display: flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-mname .dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
/* round 15: the names stay above the bars when the board scrolls sideways (they went under them), and a name is a button: plan downtime for that workcenter */
.sb-row > .sb-label { z-index: 4; }
.sb-row.sb-headrow { z-index: 5; }
.sb-wc { cursor: pointer; }
.sb-wc:hover .sb-mname, .sb-wc:focus-visible .sb-mname { text-decoration: underline; }
.sb-lane { position: relative; flex: 0 0 auto; }
.sb-lane.drop, .sb-tray.drop { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.sb-off { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--text-3) 12%, transparent) 6px 8px); pointer-events: none; }
.sb-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bad); opacity: .8; pointer-events: none; z-index: 1; }
.sb-day, .sb-hour { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border-2); padding: 8px 6px 0; font-size: 11px; white-space: nowrap; color: var(--text-3); }
.sb-day { font-weight: 700; color: var(--text-2); border-left-color: var(--text-3); }
.sb-bar { position: absolute; top: 9px; bottom: 9px; border-radius: 7px; background: color-mix(in srgb, var(--c) 26%, var(--surface-2));
  border: 1px solid var(--c); border-left-width: 4px; padding: 0 8px; display: flex; align-items: center; gap: 2px; font-size: 12px;
  white-space: nowrap; overflow: hidden; cursor: grab; z-index: 2; }
.sb-bar.running { cursor: pointer; background: color-mix(in srgb, var(--c) 34%, var(--surface-2)); }
.sb-bar.late { box-shadow: 0 0 0 2px var(--bad); }
/* on a press its part isn't approved for (Parts > Approved workcenters): a dashed amber edge */
.sb-bar.offlist { outline: 2px dashed var(--warn, #f59e0b); outline-offset: -2px; }
.sb-bar:hover { filter: brightness(1.15); }
.sb-sub { color: var(--text-2); }
.sb-warn { color: var(--warn); font-weight: 700; margin-right: 3px; }
.sb-tray { display: flex; flex-wrap: wrap; gap: 10px; min-height: 52px; padding: 4px; border-radius: 10px; }
.sb-card { border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 9px; padding: 8px 12px; background: var(--surface-2);
  cursor: grab; min-width: 200px; display: grid; gap: 2px; }
.toolbar .legend { margin: 0; }
@media (max-width: 700px) {
  .sb-label { width: 132px; flex-basis: 132px; padding: 6px 8px; }
  .sb-label .muted.small:last-child { display: none; }
}
.sb-down { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; z-index: 3; cursor: pointer; font-size: 11px; font-weight: 600;
  color: var(--bad); padding: 3px 6px; overflow: hidden; white-space: nowrap; border: 1px dashed var(--bad);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 45%, var(--surface)) 0 6px, color-mix(in srgb, var(--bad) 12%, var(--surface)) 6px 12px); }
.sb-down.ot { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); z-index: 1; }
.sb-holiday { position: absolute; bottom: 2px; height: 14px; font-size: 10px; font-weight: 700; color: #a855f7; overflow: hidden;
  white-space: nowrap; text-align: center; background: color-mix(in srgb, #a855f7 16%, transparent); border-radius: 4px; }

/* press profit (costing.js) */
.profit-flag { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; white-space: nowrap; }
.profit-flag i { width: 10px; height: 10px; border-radius: 99px; background: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 25%, transparent); }
.t-badge.profit { background: var(--pc); color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); }
.warn-text { color: var(--warn); margin-top: 2px; }

/* suggestion box (ideas.js) */
.idea { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.idea:first-child { border-top: 0; padding-top: 0; }
.idea-vote { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; }
.idea-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.idea-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.idea-answer { margin-top: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--c); font-size: 13.5px; }

/* ------------------------------------------------------- labels and the label designer */
.lbl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lbl-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.lbl-thumb { display: flex; align-items: center; justify-content: center; height: 210px; padding: 14px; background: var(--surface-2); }
.lbl-thumb svg { max-width: 100%; max-height: 182px; width: auto; height: auto; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); border-radius: 3px; }
.lbl-card-body { padding: 12px 14px 14px; }
.lbl-card-title a { color: var(--text); text-decoration: none; font-size: 15px; }
.lbl-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; min-height: 24px; }
.lbl-builtins { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lbl-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; max-height: 64vh; overflow: auto; }
.lbl-builtin { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; height: auto; padding: 12px 14px; text-align: left;
  white-space: normal; line-height: 1.35; font-weight: 500; }
.lbl-builtin b { font-size: 14px; }
.lbl-lib { max-height: min(62vh, 640px); overflow-y: auto; margin: 4px -4px 0; padding: 0 4px 4px; }
.lbl-lib .sub-label { margin: 14px 0 8px; }
.lbl-lib .sub-label:first-child { margin-top: 2px; }
.lbl-lib-thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 132px; padding: 8px; background: var(--surface-2);
  border-radius: 8px; margin-bottom: 4px; }
.lbl-lib-thumb svg { max-width: 100%; max-height: 116px; width: auto; height: auto; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); border-radius: 2px; }
.lbl-lib-src { font-size: 12px; color: var(--text-2); }
.lbl-dis { display: flex; flex-direction: column; gap: 4px; }
.lbl-dis-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 18px 26px 26px; gap: 4px; align-items: center; }
.lbl-dis-head { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.lbl-dis-head span:last-child { grid-column: 3 / span 3; }
.lbl-props .lbl-dis-row input:not([type="checkbox"]) { font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 0 6px; }
.lbl-dis-row input.lbl-dis-di { text-transform: uppercase; }
.lbl-props .lbl-dis-row button { padding: 0; width: 26px; min-width: 0; }
.lbl-lib-cats { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 4px; }
.lbl-lib-cats button { height: 30px; padding: 0 11px; font-size: 12.5px; }
.lbl-encodes code { word-break: break-all; }
.lbl-filters summary { cursor: pointer; font-size: 12px; color: var(--text-2); }
.lbl-filters dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 11.5px; margin: 6px 0 0; }
.lbl-filters dt { font-family: ui-monospace, Consolas, monospace; font-weight: 600; }
.lbl-filters dd { margin: 0; color: var(--text-2); }
.lbl-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lbl-name { font-size: 16px; font-weight: 700; min-width: 200px; max-width: 360px; flex: 1 1 220px; }
.lbl-size-chip { color: var(--text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.lbl-zoom-text { min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.lbl-ph { font-size: 13px; }
.lbl-designer { display: grid; grid-template-columns: 236px minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.lbl-palette, .lbl-props { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; position: sticky; top: 76px;
  max-height: calc(100vh - 96px); overflow-y: auto; }
.lbl-pal-title { display: flex; align-items: baseline; gap: 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); margin: 4px 0 8px; }
.lbl-pal-title small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.lbl-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.lbl-tool { height: auto; min-height: 54px; flex-direction: column; gap: 4px; font-size: 12px; padding: 8px 6px; white-space: normal; line-height: 1.15; cursor: grab; }
.lbl-search { width: 100%; margin-bottom: 8px; }
.lbl-group { font-size: 11px; font-weight: 700; color: var(--text-3); margin: 10px 0 4px; text-transform: uppercase; letter-spacing: .06em; }
.lbl-field { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 8px; cursor: grab; border: 1px solid transparent; }
.lbl-field:hover { background: var(--hover); border-color: var(--border); }
.lbl-field span { font-size: 13px; font-weight: 600; }
.lbl-field small { color: var(--text-3); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-stage { min-width: 0; overflow: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 18px; min-height: 420px; }
.lbl-canvas { display: grid; grid-template-columns: 22px auto; grid-template-rows: 22px auto; width: max-content; margin: 0 auto; }
.lbl-corner { background: transparent; }
.lbl-ruler { position: relative; color: var(--text-3); font-size: 10px; overflow: hidden; }
.lbl-ruler.x { height: 22px; border-bottom: 1px solid var(--border-2); }
.lbl-ruler.y { width: 22px; border-right: 1px solid var(--border-2); }
.lbl-ruler i { position: absolute; background: var(--border-2); }
.lbl-ruler.x i { bottom: 0; width: 1px; height: 5px; }
.lbl-ruler.x i.H { height: 9px; }
.lbl-ruler.x i.M { height: 14px; background: var(--text-3); }
.lbl-ruler.y i { right: 0; height: 1px; width: 5px; }
.lbl-ruler.y i.H { width: 9px; }
.lbl-ruler.y i.M { width: 14px; background: var(--text-3); }
.lbl-ruler b { position: absolute; font-weight: 600; }
.lbl-ruler.x b { top: 1px; margin-left: 3px; }
.lbl-ruler.y b { left: 2px; margin-top: 2px; }
.lbl-paper { position: relative; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.lbl-host svg { display: block; }
.lbl-overlay { position: absolute; inset: 0; outline: none; touch-action: none;
  background-image: linear-gradient(to right, rgba(59, 130, 246, .07) 1px, transparent 1px), linear-gradient(to bottom, rgba(59, 130, 246, .07) 1px, transparent 1px),
    linear-gradient(to right, rgba(59, 130, 246, .18) 1px, transparent 1px), linear-gradient(to bottom, rgba(59, 130, 246, .18) 1px, transparent 1px);
  background-size: var(--grid) var(--grid), var(--grid) var(--grid), var(--grid-big) var(--grid-big), var(--grid-big) var(--grid-big); }
.lbl-box { position: absolute; cursor: move; border: 1px dashed transparent; border-radius: 2px; }
.lbl-box:hover { border-color: rgba(59, 130, 246, .7); background: rgba(59, 130, 246, .06); }
.lbl-box.sel { border: 1.5px solid #2563eb; background: rgba(37, 99, 235, .08); }
.lbl-box.bad { border: 1.5px dashed #dc2626; background: rgba(220, 38, 38, .06); }
.lbl-box.line { margin: -3px; padding: 3px; box-sizing: content-box; }
.lbl-handle { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid #2563eb; border-radius: 3px; }
.lbl-handle.e { right: -7px; top: calc(50% - 6px); cursor: ew-resize; }
.lbl-handle.s { bottom: -7px; left: calc(50% - 6px); cursor: ns-resize; }
.lbl-handle.se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.lbl-phead { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 15px; }
.lbl-ptools { display: flex; gap: 2px; }
.lbl-prow { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 8px; }
.lbl-prow > .f { flex: 1 1 70px; min-width: 70px; margin: 0; }
.lbl-props .f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.lbl-props input:not([type="checkbox"]), .lbl-props select, .lbl-props textarea { width: 100%; }
.lbl-props .cb { font-size: 13px; }
.lbl-props .seg button { padding: 0 9px; }
.lbl-psec { display: flex; flex-direction: column; gap: 6px; }
.lbl-insert { margin-bottom: 4px; }
.lbl-checks { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.lbl-check { justify-content: flex-start; height: auto; min-height: 32px; padding: 6px 10px; white-space: normal; text-align: left; font-size: 12.5px;
  font-weight: 500; line-height: 1.3; border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: var(--warn-soft); }
.lbl-check svg { color: var(--warn); flex: none; }
.lbl-layers { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.lbl-layer { justify-content: flex-start; height: 30px; padding: 0 8px; font-size: 12.5px; font-weight: 500; background: transparent; border-color: transparent;
  box-shadow: none; min-width: 0; }
.lbl-layer:hover { background: var(--hover); }
.lbl-layer svg { color: var(--text-3); flex: none; }
.lbl-dirty { display: inline-flex; }
@media (max-width: 1280px) { .lbl-designer { grid-template-columns: 210px minmax(0, 1fr); } .lbl-props { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 820px) { .lbl-designer { grid-template-columns: minmax(0, 1fr); } .lbl-palette { position: static; max-height: none; } }

/* quality system (qms.js) */
.qms-totals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.qms-totals a { display: flex; align-items: baseline; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-size: 13px; }
.qms-totals a:hover { background: var(--hover); color: var(--text); }
.qms-totals b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; }
.qms-matrix th, .qms-matrix td { padding: 6px 8px; }
.qms-matrix th.qms-skill { text-align: center; white-space: nowrap; font-size: 11.5px; }
.qms-matrix th.qms-skill a { color: var(--text-2); text-decoration: none; }
.qms-cell { text-align: center; cursor: pointer; }
.qms-cell i { display: inline-block; width: 16px; height: 16px; border-radius: 5px; background: var(--c, transparent); vertical-align: middle; }
.qms-cell i.need { background: transparent; border: 2px dashed var(--c); }
.qms-cell.outdated i, .qms-cell.expiring i { box-shadow: inset 0 0 0 3px color-mix(in srgb, #fff 45%, var(--c)); }
.qms-cell:hover { background: var(--hover); }
.qms-steps { display: flex; gap: 4px; margin-bottom: 16px; overflow-x: auto; }
.qms-step { flex: 1 1 0; min-width: 110px; display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px;
  border: 1px solid var(--border); color: var(--text-3); font-size: 12.5px; font-weight: 600; }
.qms-step i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor;
  font-style: normal; font-size: 11px; flex: none; }
.qms-step.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.qms-step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.qms-step.on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.qms-step.on i { border-color: var(--accent); color: var(--accent); }
.qms-hist { display: flex; flex-direction: column; }
.qms-hist-row { display: grid; grid-template-columns: 140px 160px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; align-items: baseline; }
.qms-hist-row:first-child { border-top: 0; }
.qms-ch { font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.qms-sec { padding: 14px 18px 4px; }
.qms-sec h2 { margin: 0; font-size: 16px; }
.qms-map td { vertical-align: top; }
.qms-map td:nth-child(2) { min-width: 320px; }
.qms-ev { display: flex; flex-wrap: wrap; gap: 6px; }
.qms-ev a.tag { text-decoration: none; }
.qms-ev .tag.none { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.qms-pre { font-size: 11.5px; max-height: 240px; overflow: auto; white-space: pre-wrap; background: var(--surface-2); padding: 8px; border-radius: 8px; }
.qms-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qms-chips a.fchip { text-decoration: none; }
@media (max-width: 720px) { .qms-hist-row { grid-template-columns: 1fr; gap: 2px; } }
@media print { .tabsbar, .toolbar { display: none !important; } .qms-map td:nth-child(2) { min-width: 0; } }
/* audit standards (round 14): Quality system > Standards, the clause map's audit questions, an audit walk's links */
.qms-sec.row { align-items: flex-start; gap: 10px; padding-bottom: 8px; }
.qms-ask { margin-top: 4px; color: var(--text-2); font-style: italic; }
.qms-where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-weight: 400; }
.qms-where a.tag { text-decoration: none; }
.qms-where .tag.none { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.std-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.std-row:first-of-type { border-top: 0; }
.std-row:not(.on) .std-main { opacity: .75; }
.std-switch input { width: 20px; height: 20px; margin: 2px 0 0; }
.std-switch input:disabled { opacity: .45; cursor: not-allowed; }
.std-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.std-name { font-size: 15px; }
.std-what { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.std-what a.tag { text-decoration: none; }
.std-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 720px) { .std-row { flex-wrap: wrap; } .std-links { width: 100%; justify-content: flex-start; padding-left: 32px; } }

/* audit checklist and PFMEA editors */
.qms-items { display: flex; flex-direction: column; gap: 8px; }
.qms-item { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px 16px; padding: 10px 12px; border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: 12px; align-items: start; }
.qms-item.ok { border-left-color: #22c55e; } .qms-item.nok { border-left-color: #ef4444; } .qms-item.ofi { border-left-color: #0ea5e9; } .qms-item.na { border-left-color: #64748b; }
.qms-item-q { display: flex; gap: 10px; align-items: flex-start; }
.qms-q { flex: 1; min-width: 0; font-size: 13.5px; }
.qms-q-new { display: flex; gap: 6px; }
.qms-q-new input { flex: 1; min-width: 0; }
.qms-q-new .qms-clause-in { flex: 0 0 90px; }
.qms-seq { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2); color: var(--text-2);
  font-size: 12px; font-weight: 700; flex: none; }
.qms-clause { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--accent); margin-right: 6px; }
.qms-item-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qms-res { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.qms-res button { height: 30px; min-width: 46px; padding: 0 10px; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.qms-res button + button { border-left: 1px solid var(--border); }
.qms-res button.on { background: var(--c); color: #fff; }
.qms-res button:disabled { opacity: 1; cursor: default; }
.qms-item-f { display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; }
.qms-fmea { display: flex; flex-direction: column; gap: 12px; }
.qms-fm { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.qms-fm-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.qms-fm-title { display: flex; gap: 8px; flex: 1 1 360px; min-width: 0; }
.qms-fm-title > * { flex: 1; min-width: 0; }
.qms-fm-title > :first-child { flex: 0 0 34%; }
.qms-fm-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.qms-fm-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qms-fm-pair { display: flex; gap: 6px; }
.qms-fm-pair > * { flex: 1; min-width: 0; }
.qms-sod { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); }
.qms-sod input { width: 64px; }
.qms-sods { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qms-ro { font-size: 13px; padding: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .qms-fm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .qms-item { grid-template-columns: 1fr; } .qms-fm-grid { grid-template-columns: 1fr; } }

/* labels: reprint reasons, label controls (Honda L-MPR), label scans at shipping */
.reason-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.reason-grid button { justify-content: flex-start; white-space: normal; text-align: left; height: auto; min-height: 42px; }
.lmpr-table td { vertical-align: top; }
.lmpr-table td:first-child { min-width: 180px; }
.lmpr-table td:nth-child(2) { color: var(--text-2); }
.scan-progress { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.scan-progress .ubar { flex: 1; max-width: none; height: 8px; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); font-weight: 600; }

/* ERP > API: keys, webhooks, the reference */
.api-code { position: relative; margin: 6px 0 10px; }
.api-code pre { margin: 0; padding: 12px 14px; padding-right: 84px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; line-height: 1.55; white-space: pre; overflow: auto; max-height: 440px; color: var(--text); }
.api-code > button { position: absolute; top: 6px; right: 6px; background: var(--surface); }
.api-langs { margin: 2px 0 6px; flex-wrap: wrap; }
.api-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.api-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 16px; }
.api-area { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.api-area select { width: 132px; flex: none; }
.api-events { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 16px; margin: 6px 0 4px; }
label.cb.api-event { align-items: flex-start; margin: 0; padding: 4px 0; }
.api-event input { margin-top: 1px; flex: none; }
.api-ev-name { font-family: var(--mono); font-size: 12.5px; font-weight: 650; }
.api-group { border: 1px solid var(--border); border-radius: 10px; padding: 4px 12px; margin-bottom: 8px; }
.api-group[open] { padding-bottom: 10px; }
.api-group > summary { padding: 8px 0; }
.api-ep { border-top: 1px solid var(--border); }
.api-ep > summary { display: flex; gap: 10px; align-items: center; padding: 8px 0; font-weight: 500; flex-wrap: wrap; }
.api-ep > summary code { background: none; padding: 0; font-size: 12.5px; color: var(--text); }
.api-method { display: inline-block; min-width: 58px; text-align: center; font: 700 11px/20px var(--mono); border-radius: 6px; color: var(--mc);
  background: color-mix(in srgb, var(--mc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--mc) 35%, transparent); }
.api-ep-body { padding: 4px 0 12px 68px; }
.api-params { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; margin-bottom: 8px; }
.api-fields { margin: 4px 0 8px; }
.api-fields table td { padding-top: 3px; padding-bottom: 3px; }
.api-rules { margin: 0; padding-left: 18px; line-height: 1.7; }
.api-rules li { margin-bottom: 4px; }
@media (max-width: 760px) {
  .api-ep-body { padding-left: 0; }
  .api-ep > summary .muted { flex-basis: 100%; }
  .api-code { display: flex; flex-direction: column; }
  .api-code > button { position: static; align-self: flex-end; order: -1; margin-bottom: 4px; }
  .api-code pre { padding-right: 14px; }
}

/* ERP > Import & export (dataio.js) */
.io-about { margin-bottom: 4px; }
.io-cols { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.io-cols code, .sw-cols code { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.io-badges { margin: 0 0 12px; gap: 8px; }
.io-map tr.io-off td { opacity: .55; }
.io-map tr.io-off td:last-child { opacity: 1; }
.io-sample { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-rows { margin-top: 12px; max-height: 460px; overflow: auto; }
.io-values { margin: 14px 0; padding: 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.io-values .hint { margin-bottom: 8px; }
.io-vgroup + .io-vgroup { margin-top: 12px; }
.io-vlabel { font-weight: 600; margin-bottom: 4px; }
.io-values table td { padding: 4px 10px 4px 0; border: 0; }
.io-sheet { border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; margin-top: 10px; }
.io-sheet.off { opacity: .6; }
.io-sheet.warn { border-color: var(--warn); }
.io-sheet > * + * { margin-top: 10px; }
.io-sheet-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.io-sheet-name { display: flex; flex-direction: column; }
.io-sheet .io-badges { margin: 0; }
.io-errors summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.io-errors table { margin-top: 6px; }
.io-export { columns: 330px 3; column-gap: 14px; }
.io-egroup { margin: 0 0 14px; break-inside: avoid; }
.io-egroup table td { padding-top: 6px; padding-bottom: 6px; }
.io-slot:empty { display: none; }

/* lists: sortable headings, long text cut short, filter chips, number boxes */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover, th.sortable.sorted { color: var(--text); }
th.sortable svg { vertical-align: -2px; margin-left: 2px; }
.trunc { display: inline-block; max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 14px; }
.fchips .fchip { --c: var(--accent); }
.fcount:not(:empty) { margin-left: 4px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.date-range { flex-wrap: nowrap; gap: 6px; }
.date-range input { min-width: 0; flex: 1; }
input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
input.invalid { border-color: var(--bad, #ef4444) !important; box-shadow: 0 0 0 1px var(--bad, #ef4444); }
.confirm-text { margin: 0; line-height: 1.5; max-width: 60ch; white-space: pre-line; }

/* the shared look of every ERP page (UX review Oct 31, 2026 - docs/UX_GUIDE.md, uxkit.js) */
/* a required field left blank: outlined, "Required" under it */
.missing input:not([type=checkbox]), .missing select, .missing textarea { border-color: var(--bad) !important; box-shadow: 0 0 0 1px var(--bad); }
.req-msg { color: var(--bad); font-size: 12px; font-weight: 600; margin-top: 2px; }
td.missing { vertical-align: top; }
/* a record's list next to its title is a link (a breadcrumb) */
a.page-sub-link { color: inherit; text-decoration: none; }
a.page-sub-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* anything that opens a record looks like a link: a list row's key cell too (the row stays clickable) */
a.rowlink, a.rowlink:hover { color: var(--accent); }
/* row and card actions are outline buttons - one filled button per page, its main action */
td button.primary, td .btn.primary { background: var(--surface-2); border-color: var(--border-2); color: var(--text); box-shadow: var(--shadow-sm); }
td button.primary:hover, td .btn.primary:hover { background: var(--surface-3); color: var(--text); }
/* a toolbar's right-hand buttons stay together on the right when the toolbar wraps */
.toolbar-end { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin-left: auto; }
/* one picker look: a search picker (a box with a list) has the same chevron as a dropdown; the browser's own arrow
   stays clickable on top of it, unseen */
input[list] { padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a95a8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 15px; }
input[list]::-webkit-calendar-picker-indicator { opacity: 0; cursor: pointer; }
/* a line grid's total: a bold row with the figure under its column; what it leaves out under the table */
tr.child-total-row td { border-top: 2px solid var(--border-2); border-bottom: none; }
tr.child-total-row td.total-label { text-align: right; }
.child-total:not(:empty) { margin-top: 6px; }
/* a line grid with nothing yet: an icon and a headline, the Add button under it */
.child-empty { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px dashed var(--border-2); border-radius: 10px; color: var(--text-3); }
.child-empty b { color: var(--text-2); font-weight: 600; }
/* a long record's fields in titled groups */
.form-groups { display: flex; flex-direction: column; gap: 6px; }
.form-group + .form-group { padding-top: 14px; border-top: 1px solid var(--border); }
.form-group > .sub-label { margin: 0 0 10px; }
/* round 15: a group only some records need or to fill in later, folded under a heading that says who it is for (a
   customer's EDI and labels, a supplier's payment and quality) - its title and what it holds; click to open */
details.form-fold > summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; cursor: pointer; list-style: none; min-height: 32px; }
details.form-fold > summary::-webkit-details-marker { display: none; }
details.form-fold > summary::before { content: "\25B8"; color: var(--text-3); width: 12px; transition: transform .15s; }
details.form-fold[open] > summary::before { transform: rotate(90deg); }
details.form-fold > summary .sub-label { margin: 0; }
details.form-fold[open] > summary { margin-bottom: 10px; }
/* round 15: a new customer's "Before their first order" steps; Receiving's tiles pick what the list shows */
.fo-step { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); }
.card-head + .fo-step { border-top: 0; }
.fo-tick { color: var(--text-3); flex: none; margin-top: 1px; }
.fo-tick.done { color: var(--ok); }
.kpi.kpi-link.on { box-shadow: inset 0 0 0 2px var(--accent); }
/* a dialog for what can't be undone: its icon red like its button */
.modal-head .ch-ic.danger-ic { background: var(--bad-soft); color: var(--bad); }
/* one Export for a report that comes as more than one file */
.export-choices { display: grid; gap: 8px; }
.export-choice { justify-content: flex-start; height: auto; padding: 10px 14px; text-align: left; white-space: normal; }
.export-choice span { display: flex; flex-direction: column; gap: 2px; }
.export-choice small { color: var(--text-3); font-weight: 400; }

/* an order's lines: releases, jobs, shipments */
.oline { padding: 12px 0; border-top: 1px solid var(--border); }
.oline:first-of-type { border-top: 0; }
.oline-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.oline .table-wrap { margin: 4px 0 2px; }
.oline-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.olink { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 13px; }
.olink:hover { background: var(--surface-2); }

/* shipments: the pick list on the lines, the planner */
.ship-lines tr.pick-row td { border-top: 0; padding-top: 0; }
.plan-table td, .plan-table th { vertical-align: top; }
.plan-table input.num-in { width: 100px; }
.io-list { margin: 0 0 6px; padding-left: 20px; line-height: 1.65; }
.io-list li { margin-bottom: 4px; }
.io-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.io-progress .ubar { max-width: 260px; height: 8px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.sys-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; height: auto; min-height: 74px; padding: 11px 13px; text-align: left;
  white-space: normal; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); font-weight: 400; }
.sys-card b { font-size: 14px; }
.sys-card span { color: var(--text-3); font-size: 12px; line-height: 1.4; }
.sys-card:hover:not([disabled]) { border-color: var(--border-2); background: var(--surface-2); }
.sys-card.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.sw-step { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); align-items: start; }
.sw-step.skipped { opacity: .55; }
.sw-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.sw-n.done { background: var(--ok); color: #fff; }
.sw-what { color: var(--text-2); margin-top: 2px; line-height: 1.55; }
.sw-cols { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.sw-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sw-checks { display: flex; flex-direction: column; gap: 2px; }
.sw-check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--border); cursor: pointer; }
.sw-check input { margin-top: 3px; flex: none; }
.io-start .row { margin-top: 2px; }
@media (max-width: 760px) {
  .sw-step { grid-template-columns: 30px 1fr; }
  .sw-actions { grid-column: 2; justify-content: flex-start; }
}

/* round 10 (setup and settings, docs/UX_GUIDE.md): a settings card's Save row - bottom right, a "Saved" tick after
   saving; a required field left empty; Getting started on the Dashboard; the plant key's steps; Admin > Plants' row
   actions with words */
.card-save { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.save-tick { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 600; font-size: 13px; }
.save-tick[hidden] { display: none; }
/* round 15b: a record form with unsaved changes - a bar that stays at the bottom of the screen (uxkit.js unsavedGuard);
   the toasts go above it, so they never cover its Save */
.unsaved-bar { bottom: calc(14px + var(--tabs-h, 0px)); margin-top: 16px; flex-wrap: wrap; justify-content: flex-end; border-color: var(--warn, #f59e0b); }
.unsaved-bar .unsaved-ic { display: inline-flex; color: var(--warn, #f59e0b); }
.unsaved-bar .unsaved-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 220px; }
body:has(.unsaved-bar:not([hidden])) #toasts { bottom: calc(96px + var(--tabs-h, 0px)); }
/* sending a document (uxkit.js sendByEmail): the PDF and the email text in one box; sent or not in the invoice list */
.send-pdf { padding: 10px 12px; border: 1px dashed var(--border-2); border-radius: 10px; }
.send-tools { flex-wrap: wrap; }
.ar-sent { display: flex; align-items: center; gap: 3px; margin-top: 4px; }
span.ar-sent { display: inline-flex; margin-top: 0; }
@media (max-width: 760px) {
  .unsaved-bar { padding: 10px 12px; gap: 8px; bottom: calc(8px + var(--tabs-h, 0px)); }
  .unsaved-bar .unsaved-text .small { display: none; }
  .unsaved-bar button { min-height: 44px; }
  body:has(.unsaved-bar:not([hidden])) #toasts { bottom: calc(80px + var(--tabs-h, 0px)); }
}
.req-note { display: block; color: var(--bad); font-size: 12px; font-weight: 600; margin-top: 3px; }
select.invalid, textarea.invalid { border-color: var(--bad, #ef4444) !important; box-shadow: 0 0 0 1px var(--bad, #ef4444); }
.setup-card .card-head { margin-bottom: 8px; }
.setup-card-row { align-items: center; gap: 14px; }
.setup-card-row .io-progress { margin: 0; flex: 1; min-width: 200px; }
.key-steps { margin: 4px 0 14px; padding-left: 20px; line-height: 1.7; }
.plant-actions button { margin: 2px 0; }
.level-key > span { display: block; }
table.kv.lbl-company { margin-bottom: 4px; }

/* security roles: the people editor's role picks, what roles add up to, the role editor's page grid */
.role-picks, .role-fns { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin: 4px 0 2px; }
.role-pick { display: flex; gap: 10px; align-items: flex-start; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); cursor: pointer; line-height: 1.4; }
.role-pick:hover { border-color: var(--border-2); background: var(--surface-2); }
.role-pick:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.role-pick input { margin-top: 2px; flex: none; }
.role-pick span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-pick small { color: var(--text-3); font-size: 12px; }
.access-sum { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 1.5; }
.as-row { display: grid; grid-template-columns: 118px 1fr; gap: 10px; align-items: baseline; }
.lvl { font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: var(--text-2); }
.lvl-view { color: #0ea5e9; }
.lvl-edit { color: var(--ok); }
.lvl-full { color: #a855f7; }
.role-matrix { display: flex; flex-direction: column; }
.rm-group { margin: 16px 0 4px; font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.rm-row { display: flex; align-items: center; gap: 16px; padding: 9px 0; border-top: 1px solid var(--border); }
.rm-row.rm-default { border-top: none; padding: 4px 0 12px; border-bottom: 1px solid var(--border); }
.rm-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rm-label small { color: var(--text-3); font-size: 12px; line-height: 1.45; }
.rm-row.rm-off .rm-label b { color: var(--text-3); font-weight: 550; }
.seg.sm > button { height: 26px; padding: 0 10px; font-size: 12.5px; }
@media (max-width: 760px) {
  .rm-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .rm-row .seg { align-self: flex-start; max-width: 100%; overflow-x: auto; }
  .as-row { grid-template-columns: 1fr; gap: 0; }
}

/* batch 5 of the beta test */
.ref-miss { color: var(--warn); margin-top: 4px; font-weight: 600; }      /* why a picker finds nothing (another customer's part) */
.ocover { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 2px 0 6px; font-size: 13px; color: var(--ok); }
.ocover > b { color: var(--ok); }
.ocover.short, .ocover.short > b { color: var(--bad); }
.ocover .olink { color: var(--text); }
tr.mrp-group td { background: var(--surface-2); padding-top: 10px; }
.mrp-group-btn { margin-left: 12px; }
.scanlog { max-height: 240px; overflow: auto; display: grid; gap: 3px; }
button.linklike { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
button.linklike:hover { background: none; color: var(--accent-2, var(--accent)); }
/* u15 (plan#8): Send to supplier - the ways it can go, each a big button with a line under its name */
.po-send-opts { display: grid; gap: 8px; margin-top: 12px; }
button.po-send-opt { display: flex; align-items: center; gap: 12px; width: 100%; height: auto; min-height: 52px; padding: 10px 14px; text-align: left; justify-content: flex-start; white-space: normal; }
button.po-send-opt:hover { border-color: var(--accent); }
.po-send-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.po-send-t { display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
.po-send-t b { font-size: 14px; }

/* Materials: cards that list what they count (plan#10) */
.kpi.kpi-link { cursor: pointer; }
.kpi.kpi-link:hover, .kpi.kpi-link.on { border-color: var(--accent); }
/* r10 nav: a reference picker with an "open" link beside it (every reference on a form opens its record) */
.ref-pick { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.ref-pick input, .ref-pick select { flex: 1 1 0; min-width: 0; width: auto; }   /* the box gives way, the link stays beside it */
.ref-pick .ref-miss { flex: 0 0 100%; order: 3; }
.ref-open { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-3); }
.ref-open:hover { color: var(--accent); background: var(--hover); }
.ref-open[hidden] { display: none; }
@media (max-width: 760px) { .ref-open { width: 44px; height: 44px; } }
/* the press page: the part, the job and the tool - each a link of its own */
.hero-part.hp-links:hover { border-color: transparent; }
.hero-part.hp-links a { color: inherit; text-decoration: none; }
.hero-part.hp-links a.hp-more { color: var(--text-2); }
.hero-part.hp-links a:hover, .hero-part.hp-links a:hover b { color: var(--accent); text-decoration: underline; }
@media (max-width: 760px) { .hero-part.hp-links a { padding: 13px 4px; margin: -13px -4px; } }     /* a 44 px tap target, same layout */
/* a list loading the rows of a changed search, filter or sort: the old rows dimmed and not clickable under "Loading..." */
.list-stale { opacity: .35; pointer-events: none; transition: opacity .12s; }
.list-busy { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--text-2); font-size: 13px; }
.list-busy[hidden] { display: none; }
/* support tickets (support.js): the ? button's badge, the new-ticket dialog, the thread, the vendor's queue */
#help-btn { position: relative; }
#help-btn .help-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; pointer-events: none; }
.sup-prios { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; }
.sup-prio { display: flex; gap: 9px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; font-size: 13px; }
.sup-prio input { margin-top: 2px; flex: none; }
.sup-prio b { display: block; color: var(--c); }
.sup-prio.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.sup-attach-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sup-files { display: flex; flex-wrap: wrap; gap: 8px; }
.sup-files:not(:empty) { margin-top: 8px; }
.sup-file { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 3px 3px 3px 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; }
.sup-file img { width: 32px; height: 32px; object-fit: cover; border-radius: 5px; flex: none; }
.sup-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sup-along { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.sup-along > svg { flex: none; margin-top: 2px; color: var(--text-3); }
.sup-along label.cb { margin-top: 4px; }
.sup-thread { display: flex; flex-direction: column; gap: 12px; }
.sup-msg { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.sup-msg.vendor { background: var(--accent-soft); border-color: transparent; }
.sup-msg.internal { background: rgba(234, 179, 8, .14); border: 1px dashed #ca8a04; }
.sup-msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); margin-bottom: 5px; }
.sup-msg-head b { color: var(--text); }
.sup-msg-head .spacer { flex: 1; }
.sup-shots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sup-shots img { max-width: 240px; max-height: 160px; border-radius: 8px; border: 1px solid var(--border); display: block; background: #fff; }
.sup-docs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.sup-doc { display: inline-flex; align-items: center; gap: 5px; }
.sup-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; margin-right: 6px; vertical-align: middle; }
tr.sup-unread td { font-weight: 650; }
.sup-overdue { color: var(--bad); font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.sup-waiting { color: var(--warn); }
.sup-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.sup-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.sup-ctx table.kv td { white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; }
.sup-ctx table.kv td:first-child { width: 96px; }
.sup-log { font-size: 12px; line-height: 1.5; max-height: 220px; overflow: auto; overflow-wrap: anywhere; }
.panel.sup-note { border-color: #ca8a04; }
.fin-neg { color: var(--bad); }
.fin-subtabs { margin-top: -6px; }
.fin-entry + .fin-entry { margin-top: 12px; }
.fin-entry-head { font-size: 13px; margin-bottom: 4px; }
table.fin-lines td, table.fin-lines th { font-size: 13px; }
/* money boxes with a $ in front, the one Export of a money list (finance.js, UX review Oct 31) */
.fin-money-in { position: relative; display: inline-flex; align-items: center; width: 100%; min-width: 0; }
.fin-money-in .fin-money-sign { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; font-size: 14px; }
.fin-money-in input { padding-left: 22px; text-align: right; width: 100%; min-width: 0; }
details.fin-export { position: relative; display: inline-block; }
details.fin-export > summary { list-style: none; cursor: pointer; }
details.fin-export > summary::-webkit-details-marker { display: none; }
.fin-export-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; min-width: 150px;
  padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.fin-export-menu button { justify-content: flex-start; width: 100%; }
/* a money record's actions: one group at the top right that wraps as a whole (Void never alone under the back button) */
.fin-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-left: auto; }
/* supplier invoices & payments (payables.js) */
tr.ap-sup-row td { background: var(--surface-2); padding-top: 9px; }
tr.ap-item td { font-size: 12.5px; padding-top: 3px; padding-bottom: 3px; }
tr.total-row td { border-top: 1px solid var(--border); }
.ap-phone-only { display: none; }
@media (max-width: 760px) { .ap-phone-only { display: block; } }
.ar-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 18px; margin: 4px 0 14px; }
.ar-addr { margin: 4px 0 10px; gap: 12px; }
.ar-pre { white-space: pre-line; }
table.ar-doc tr.ar-sum td { border-bottom: none; padding-top: 3px; padding-bottom: 3px; }
table.ar-lines input, table.ar-apply input { min-width: 0; }
table.ar-lines .ar-desc { min-width: 180px; }
.ar-qty { width: 80px; } .ar-price { width: 96px; text-align: right; }
table.ar-lines input.ar-qty { width: 80px; } table.ar-lines input.ar-price, table.ar-apply input.ar-price { width: 104px; }
table.ar-lines .ar-part input { width: 150px; }
.ar-form-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin-top: 12px; }
.ar-form-totals td { padding: 2px 8px; }
label.f.ar-inline { flex-direction: row; align-items: center; gap: 8px; white-space: nowrap; }
tr.ar-doc-row td { padding-top: 4px; padding-bottom: 4px; }
tr.ar-bad td { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.ar-pay-sum { margin-top: 14px; }
@media (max-width: 760px) {
  .ar-seg { flex-wrap: wrap; max-width: 100%; } label.f.ar-inline { flex-direction: column; align-items: stretch; }
  table.ar-apply input.ar-price { width: 68px; } table.ar-apply td, table.ar-apply th { padding-left: 4px; padding-right: 4px; }
}
.sup-mailstate { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; margin-bottom: 12px; font-size: 13.5px; }
.sup-mailstate.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.sup-mailstate.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); }
.sup-mailstate svg { flex: none; margin-top: 2px; }
.sup-alerts td { overflow-wrap: anywhere; vertical-align: top; }
@media (max-width: 980px) { .sup-layout { grid-template-columns: 1fr; } }

/* the books' own screens (books.js): setup steps, the chart, entries being written, ledgers */
.bk-steps { margin: 0 0 16px; padding-left: 20px; line-height: 1.7; font-size: 13.5px; color: var(--text-2); }
.card-head .ch-ic.bk-step { background: var(--surface-3); color: var(--text-2); font-weight: 700; font-size: 14px; }
.card-head .ch-ic.bk-step.done { background: var(--ok-soft); color: var(--ok); }
details.bk-fold > summary { display: flex; align-items: center; gap: 14px; cursor: pointer; list-style: none; }
details.bk-fold > summary::-webkit-details-marker { display: none; }
details.bk-fold > summary .ch-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
details.bk-fold > summary h2 { font-size: 15px; margin: 0; flex: 1; }
details.bk-fold > summary .bk-fold-ic { color: var(--text-3); transition: transform .15s; }
details.bk-fold[open] > summary { margin-bottom: 14px; }
details.bk-fold[open] > summary .bk-fold-ic { transform: rotate(180deg); }
.bk-kpi-text { font-size: 19px; white-space: normal; }
.bk-req { color: var(--bad); font-weight: 700; }
table.bk-roles td:first-child { width: 42%; }
table.bk-roles select { max-width: 420px; }
select.bk-bad, input.bk-bad { border-color: var(--bad) !important; box-shadow: 0 0 0 1px var(--bad); }
tr.bk-group > td { font-weight: 700; background: var(--surface-2); }
tr.bk-sub > td { font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding-top: 14px; padding-bottom: 6px; }
tr.bk-total > td { font-weight: 700; border-top: 2px solid var(--border-2); }
tr.bk-inactive > td { opacity: .62; }
tr.bk-rev > td { color: var(--text-3); }
.bk-lock { display: inline-flex; margin-left: 6px; color: var(--text-3); vertical-align: -1px; }
.bk-checks { display: grid; gap: 0; }
.bk-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.bk-check:last-child { border-bottom: none; }
.bk-check-text { flex: 1; min-width: 0; }
.bk-tick { color: var(--text-3); margin-top: 1px; }
.bk-tick.ok { color: var(--ok); }
.bk-lines { display: grid; gap: 8px; margin: 6px 0 4px; }
.bk-line { display: grid; grid-template-columns: minmax(200px, 2.4fr) minmax(96px, 1fr) minmax(96px, 1fr) minmax(130px, 1.8fr) 34px; gap: 8px; align-items: start; }
.bk-lines.party .bk-line { grid-template-columns: minmax(200px, 2.2fr) minmax(92px, 1fr) minmax(92px, 1fr) minmax(120px, 1.5fr) minmax(170px, 1.8fr) 34px; }
.bk-line > input, .bk-acct > input, .bk-party select, .bk-party input { width: 100%; min-width: 0; }
.bk-line-head { font-size: 11px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.bk-line-head > span { padding: 0 12px; }
.bk-acct, .bk-party { min-width: 0; }
.bk-line-note:empty { display: none; }
.bk-line-note { margin-top: 3px; }
.bk-party { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px; }
.bk-party-ref:empty { display: none; }
.bk-totals { margin: 10px 0 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; font-size: 13px; }
.bk-tot-row { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.bk-tot-row > span:first-child { font-weight: 650; min-width: 90px; }
.bk-diff { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.bk-diff.ok { color: var(--ok); }
.bk-diff.bad { color: var(--bad); }
.bk-preview { max-height: 52vh; overflow: auto; }
.bk-filters label.f { min-width: 0; white-space: nowrap; }
.bk-filters label.f.bk-wide-field { flex: 2 1 260px; }
.bk-filters label.f.bk-wide-field > select { width: 100%; }
@media (max-width: 640px) {
  .bk-line, .bk-lines.party .bk-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
  .bk-line-head { display: none; }
  .bk-line .bk-acct { grid-column: 1 / 3; grid-row: 1; }
  .bk-line > button { grid-column: 3; grid-row: 1; }
  .bk-line > input[data-k=debit] { grid-column: 1; }
  .bk-line > input[data-k=credit] { grid-column: 2; }
  .bk-line > input:not([data-k]), .bk-line .bk-party { grid-column: 1 / 4; }
  table.bk-roles td:first-child { width: auto; }
  .bk-filters { align-items: stretch; }
  .bk-filters label.f { flex: 1 1 140px; flex-direction: column; align-items: stretch; gap: 4px; }
  .bk-filters label.f.bk-wide-field { flex-basis: 100%; }
  .bk-filters label.f > input, .bk-filters label.f > select { width: 100%; }
}
/* banking (banking.js) */
.bank-in { color: var(--ok); }
.bank-out { color: var(--text); }
.bank-pad { padding: 18px 22px 0; }
.bank-pad.muted { padding-bottom: 16px; }
.bank-acct-name { font-weight: 600; }
.bank-break { overflow-wrap: anywhere; }
.bank-seg { flex-wrap: wrap; flex: 0 1 auto; max-width: 100%; }
.bank-count { margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.bank-search { width: 240px; max-width: 100%; min-width: 0; }
.bank-lines { display: flex; flex-direction: column; gap: 10px; }
.bank-line { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.bank-line.new { border-left: 3px solid var(--warn); }
.bank-line.matched, .bank-line.created { border-left: 3px solid var(--ok); }
.bank-line.excluded { opacity: .8; }
.bank-line-head { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.bank-line-desc { font-weight: 600; overflow-wrap: anywhere; }
.bank-line-amt { text-align: right; font-weight: 600; }
.bank-line-amt .pill { margin-top: 4px; }
.bank-line-body { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 6px; }
.bank-sugg { display: flex; gap: 8px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.bank-sugg > svg { flex: none; color: var(--text-3); }
.bank-sugg-text { flex: 1; min-width: 180px; overflow-wrap: anywhere; }
.bank-matched { display: flex; flex-direction: column; gap: 4px; font-size: 13px; align-items: flex-start; }
.bank-match { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bank-match > svg { color: var(--ok); flex: none; }
.bank-line-sum { font-size: 13px; margin-bottom: 10px; overflow-wrap: anywhere; }
table.bank-split select { min-width: 180px; max-width: 100%; }
.bank-amt-in { width: 110px; text-align: right; }
td.bank-amt-in { width: auto; }
td.bank-amt-in .fin-money-in { width: 140px; }
.bank-pick { max-height: 360px; overflow-y: auto; }
table.bank-sample td, table.bank-sample th { font-size: 12px; }
.bank-rec-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px 8px; }
.bank-rec-head h2 { font-size: 15px; margin: 0; }
table.bank-rec tr { cursor: pointer; }
table.bank-rec tr.ticked td { background: color-mix(in srgb, var(--ok) 9%, transparent); }
table.bank-rec td.bank-tick { width: 34px; }
.bank-rec-sums { margin: 6px 0 0; }
table.bank-kv { max-width: 520px; }
table.bank-kv td:first-child { width: auto; }
table.bank-kv tr.bank-total td { font-weight: 650; border-top: 1px solid var(--border); }
.bank-total-row { margin-top: 10px; }
@media (max-width: 760px) {
  .bank-line-head { grid-template-columns: minmax(0, 1fr) auto; }
  .bank-line-date { grid-column: 1 / -1; font-size: 12px; color: var(--text-3); }
  .bank-search { width: 100%; }
  .bank-pad { padding: 14px 14px 0; }
  .bank-rec-head { padding: 12px 14px 6px; }
  table.bank-split select { min-width: 120px; }
}
/* statements, the month-end close, fixed assets, recurring entries (statements.js) */
table.st-table td, table.st-table th { padding: 7px 12px; }
table.st-table tr.st-section td { font-weight: 700; padding-top: 16px; color: var(--text); border-bottom: 1px solid var(--border); }
table.st-table tr.st-heading td { font-weight: 650; padding-top: 12px; color: var(--text-2); }
table.st-table tr.st-account td.st-label { padding-left: 24px; }
table.st-table tr.st-l2 td.st-label { padding-left: 40px; }
table.st-table tr.st-account td { border-bottom-color: color-mix(in srgb, var(--border) 45%, transparent); }
table.st-table tr.st-subtotal td { font-weight: 650; border-top: 1px solid var(--border); }
table.st-table tr.st-total td { font-weight: 700; border-top: 1px solid var(--text-3); }
table.st-table tr.st-grand td { font-weight: 750; border-top: 1px solid var(--text-2); border-bottom: 3px double var(--text-2); }
table.st-table tr.st-posted td { background: color-mix(in srgb, var(--ok) 7%, transparent); }
.st-code { color: var(--text-3); margin-right: 8px; font-variant-numeric: tabular-nums; }
.st-pct { color: var(--text-2); }
.st-controls .row + .row { margin-top: 12px; }
.st-pick { align-items: flex-end; gap: 8px; }
.st-pick label.f { min-width: 150px; }
.st-f { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.st-cb { min-height: 36px; }
.st-kinds .seg { max-width: 100%; overflow-x: auto; }
.st-kpis .kpi-value { font-size: 24px; overflow: hidden; text-overflow: ellipsis; }
.st-links { display: flex; flex-wrap: wrap; gap: 8px; }
.st-list { margin: 12px 0 16px; padding-left: 20px; line-height: 1.7; color: var(--text-2); }
.st-group + .st-group { margin-top: 14px; }
.st-group-label { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.st-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border); }
.st-group .st-check:last-child { border-bottom: 0; }
.st-check-ic { flex: none; margin-top: 1px; }
.st-check-ic.ok { color: var(--ok); }
.st-check-ic.bad { color: var(--bad); }
.st-check-body { flex: 1 1 auto; min-width: 0; }
.st-check-detail { color: var(--text-2); font-size: 13px; overflow-wrap: anywhere; }
.st-check-act { flex: none; display: flex; gap: 6px; flex-wrap: wrap; }
.st-scroll { max-height: 460px; overflow-y: auto; }
table.st-table td.st-name { min-width: 240px; }
/* the overview's this month and last: the row names never wrap ("Cost of goods sold", "Gross margin %") */
table.st-months td:first-child { white-space: nowrap; min-width: 150px; }
table.st-months th.num { white-space: normal; min-width: 96px; }
table.st-lines td { padding: 6px; }
table.st-lines select { min-width: 180px; }
table.st-lines input.num-in { min-width: 90px; }
.st-diff { margin-top: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .st-check { flex-wrap: wrap; }
  .st-check-act { width: 100%; padding-left: 28px; }
  .st-kpis .kpi-value { font-size: 18px; }
  table.st-table tr.st-account td.st-label { padding-left: 14px; }
  table.st-table tr.st-l2 td.st-label { padding-left: 22px; }
  .st-pick label.f { min-width: 0; flex: 1 1 140px; }
}
/* buildings (round 9, buildings.js): the plant board's building switcher and groups, dashboard cards, Admin > Plants,
   inventory detail, the scheduling board's building headings */
.ebld-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: middle; margin-right: 6px; }
.ebld-bar { margin-bottom: 14px; }
.ebld-switch .fchip { white-space: nowrap; }
.ebld-down { color: var(--bad); font-weight: 650; font-size: 12px; }
.ebld-chip .ebld-down { margin-left: 2px; }
.ebld-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin: 26px 0 4px; padding: 0 0 8px;
  border-bottom: 2px solid var(--c, var(--border)); font-size: 15px; }
.ebld-head:first-child { margin-top: 0; }
.ebld-head b { font-size: 16px; }
.ebld-head .muted { font-size: 12.5px; }
.area.ebld-area { margin: 12px 0 8px; font-size: 10.5px; }
.ebld-card { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.ebld-card span { display: inline-flex; align-items: center; white-space: nowrap; }
.ebld-card .ebld-dot { width: 8px; height: 8px; margin-right: 5px; }
.ebld-card .ebld-down { margin-left: 5px; }
.ebld-plant { margin-top: 6px; line-height: 1.6; }
.ebld-plant .ebld-dot { width: 8px; height: 8px; margin: 0 4px 0 2px; }
tr.ebld-subhead td { background: var(--surface-2); font-size: 12.5px; padding-top: 7px; padding-bottom: 7px; }
.sb-row.sb-bhead { min-height: 42px; background: var(--surface-2); }
.sb-row.sb-bhead .sb-label { background: var(--surface-2); }
@media (max-width: 760px) {
  .ebld-head { margin-top: 18px; font-size: 14px; }
  .ebld-switch { flex-wrap: wrap; }
}

/* ==================================================================================================================
   PHONES AND SCAN BOXES (round 10, phone.js; docs/UX_GUIDE.md "Phone, tablet and the floor"). Every size first: the
   scan boxes' rows and lines, tick cells, "n new - tap to show" - the desktop looks as it did. Then one block for
   screens up to 760 px: 16 px fields, 44 px tap targets, the menu drawer, lists as cards, nothing sideways.
   ================================================================================================================== */
.scan-row { flex-wrap: nowrap; }
.scan-row > input { flex: 1; min-width: 260px; }
.scanline .spinner, .spinner.sm-spin { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; }
.scanline.wait { color: var(--text-3); }
label.mc-tickhit { display: inline-flex; align-items: center; vertical-align: middle; cursor: pointer; margin: 0; }
.mc-unit { display: none; }
button.new-items { width: 100%; margin: 0 0 10px; border-style: dashed; color: var(--accent); }

@media (max-width: 760px) {
  /* 16 px text in every field: an iPhone zooms the page in on a smaller one, and doesn't zoom back */
  input:not([type=checkbox]):not([type=radio]):not(.xfer-scan), select, textarea { font-size: 16px !important; }
  /* tap targets at least 44 px (no specificity: a control that sets its own min-height keeps it - help tips) */
  :where(button:not(.link):not(.ph-chip), .btn:not(.link)) { min-height: 44px; }
  :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]), select) { min-height: 44px; }
  .icon-btn, .icon-btn.sm { width: 44px; }
  .toast-x { width: 44px; height: 44px; margin: -12px -12px -12px -6px; }
  .seg.icons > button { width: 44px; }
  .tabs a, .tabsbar a, label.cb { min-height: 44px; }

  /* the menu: More (the bottom bar) opens the sidebar as a drawer, above the bottom bar (phone.js) */
  .has-tabs .sidebar { bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); width: min(320px, 86vw); padding-top: calc(16px + env(safe-area-inset-top)); }
  .has-tabs .nav { overscroll-behavior: contain; }
  .has-tabs .nav a { min-height: 44px; }
  body.nav-open #tabs a[data-p="account"] { color: var(--accent); }

  /* nothing sideways: a sticky action column no longer covers the data; a long number wraps instead of being cut */
  td.actions-cell, th.th-actions { position: static; }
  .kpi-value { white-space: normal; overflow-wrap: break-word; }

  /* a scan box on its own line, its buttons under it (a shipment's Ship stays on the screen) */
  .scan-row { flex-wrap: wrap; }
  .scan-row > input { flex: 1 1 100%; min-width: 0; }
  .scan-row > button, .scan-row > .btn { flex: 1 1 0; }
  .po-recv-foot > label.f, .po-recv-foot > button.primary { flex: 1 1 100%; }
  .po-recv-foot > .spacer { display: none; }

  /* lists as cards (phoneCards): the title and the key number on top, the status pill, the rest small with its
     heading; fields under each other with their headings; the row's buttons at the card's foot */
  .mc-wrap { overflow-x: visible; }
  table.mcards, table.mcards > tbody, table.mcards > thead { display: block; width: 100%; }
  table.mcards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table.mcards tr:last-child { border-bottom: 0; }
  table.mcards tr::after { content: ""; order: 5; flex: 0 0 100%; height: 0; }
  table.mcards tr.click:hover { background: var(--hover); }
  table.mcards td, table.mcards th, table.mcards tr.click:hover > td { display: block; padding: 0; border: 0; min-width: 0; text-align: left; white-space: normal; background: none; }
  table.mcards [data-mc=tick] { order: 0; flex: none; margin: -10px -4px -10px -8px; }
  table.mcards label.mc-tickhit { width: 44px; height: 44px; justify-content: center; }
  table.mcards td[data-mc=title] { order: 1; flex: 1 1 0; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
  table.mcards td[data-mc=pill] { order: 2; flex: none; }
  table.mcards td[data-mc=key] { order: 3; flex: none; margin-left: auto; text-align: right; font-size: 16px; font-weight: 700; white-space: nowrap; }
  table.mcards td[data-mc=key] ~ td[data-mc=key] { margin-left: 0; }
  table.mcards td[data-mc=key][data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--text-3); }
  table.mcards .mc-unit { display: inline; }
  table.mcards td[data-mc=rest] { order: 6; max-width: 100%; font-size: 12.5px; color: var(--text-2); }
  table.mcards td[data-mc=rest][data-label]::before { content: attr(data-label) " "; color: var(--text-3); }
  table.mcards td[data-mc=rest]:empty, table.mcards [data-mc=none], table.mcards [data-mc=hide] { display: none; }
  table.mcards tr[data-mcf]::before { content: ""; order: 7; flex: 0 0 100%; height: 0; }
  table.mcards td[data-mc=field] { order: 8; flex: 1 1 140px; }
  table.mcards td[data-mc=field][data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
  table.mcards td[data-mc=field] input, table.mcards td[data-mc=field] select { width: 100% !important; }
  table.mcards td[data-mc=act] { order: 9; flex: 1 1 100%; display: flex; justify-content: flex-end; gap: 8px; }
  table.mcards tr[data-mc=wide] > td { flex: 1 1 100%; }
  table.mcards tr[data-mc-next] { border-bottom: 0; padding-bottom: 2px; }
  table.mcards tr[data-mc-next] + tr[data-mc=wide] { padding-top: 2px; }
  /* the headings: the ones that sort (tap one) and "Tick all" stay, as one row of small words */
  table.mcards tr[data-mc=head] { padding: 6px 14px; gap: 0 16px; }
  table.mcards tr[data-mc=head]::after { display: none; }
  table.mcards tr[data-mc=head] > th { display: none; }
  table.mcards tr[data-mc=head] > th.sortable, table.mcards tr[data-mc=head] > th[data-mc=tick] { display: inline-flex; align-items: center; min-height: 36px; margin: 0; }
  table.mcards tr[data-mc=head] > th[data-mc=hide], table.mcards tr[data-mc=head][data-mc-off] { display: none; }
  table.mcards th label.mc-tickhit[data-say] { width: auto; gap: 10px; padding-left: 13px; }
  table.mcards th label.mc-tickhit[data-say]::after { content: attr(data-say); text-transform: none; letter-spacing: 0; font-size: 13px; }
}

/* transfers between buildings (transfers.js): the route, its facts, the big scan box */
.xfer-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--text-3)); margin-right: 7px; vertical-align: 1px; }
.xfer-route { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 21px; font-weight: 650; }
.xfer-route .xfer-dot { width: 13px; height: 13px; }
.xfer-arrow { color: var(--text-3); display: inline-flex; }
.xfer-addr { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; max-width: 760px; }
.xfer-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 18px; margin-top: 14px; font-size: 13.5px; overflow-wrap: anywhere; }
.xfer-facts .k { color: var(--text-3); font-size: 12px; margin-bottom: 2px; }
input.xfer-scan { width: 100%; font-size: 20px; padding: 14px 16px; min-height: 56px; letter-spacing: .02em; }
.xfer-where { gap: 8px; margin: 0 0 12px; }
.xfer-where-pick { flex: 1 1 220px; max-width: 320px; }
.xfer-where-pick input { width: 100%; }
.xfer-chips { margin: -6px 0 14px; }
@media (max-width: 760px) {
  .xfer-route { font-size: 18px; gap: 8px; }
  .xfer-addr { grid-template-columns: 1fr; }
  input.xfer-scan { font-size: 18px; min-height: 52px; }
  .xfer-where-pick { max-width: none; }
}

/* r10 nav: find - the top bar search (find.js): a box beside the history button, a list of what it found under it;
   on a phone a search button that opens the box across the top bar */
.find { position: relative; display: flex; align-items: center; }
.find .find-open, .find .find-close { display: none; }
.find-field { position: relative; display: flex; align-items: center; }
.find-field .search input { width: 240px; height: 34px; padding-right: 54px; background: var(--surface); }
.find-field:focus-within .search input { padding-right: 11px; }
.find-kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); pointer-events: none; font: inherit; font-size: 11px;
  font-weight: 600; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; line-height: 1.4; }
.find-field:focus-within .find-kbd { display: none; }
.find-drop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: 440px; max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px); overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--bg-elev);
  border: 1px solid var(--border-2); box-shadow: var(--shadow-lg); }
.find-head { padding: 9px 10px 4px; font-size: 10.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
.find-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 10px; border-radius: 8px; color: var(--text); }
.find-row:hover { color: var(--text); }
.find-row.on { background: var(--hover); box-shadow: inset 0 0 0 1px var(--accent); }
.find-row > svg { flex: none; color: var(--text-3); }
.find-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.find-main b { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-main small { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-row .pill { flex: none; }
.find-empty { display: flex; gap: 10px; align-items: flex-start; padding: 12px; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.find-empty > svg { flex: none; margin-top: 2px; color: var(--text-3); }
@media (max-width: 1200px) { .find-field .search input { width: 180px; } }
@media (max-width: 760px) {
  .find .find-open { display: inline-flex; }
  .find .find-field { display: none; }
  .find.open .find-field { display: flex; gap: 6px; position: fixed; z-index: 61; left: 0; right: 0; top: 0;
    height: calc(var(--topbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 12px;
    background: var(--bg-elev); border-bottom: 1px solid var(--border); }
  .find.open .find-field .search { flex: 1; min-width: 0; }
  .find.open .find-field .search input { width: 100%; height: 42px; font-size: 16px; }
  .find.open .find-close { display: inline-flex; width: 44px; height: 44px; }
  .find-kbd { display: none; }
  .find .search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
  .find-drop { position: fixed; left: 8px; right: 8px; width: auto; max-width: none;
    top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px); max-height: calc(100vh - var(--topbar-h) - var(--tabs-h, 0px) - 28px); }
  .find-row { min-height: 48px; padding: 9px 10px; }
}
/* round 16 - Search or ask (find.js): a question's answers - lines from the records, the guide's paragraph (its links
   work), the AI's answer, Did this answer it?; Admin > Ask CycleWright (ask.js) */
.find-drop.asking { width: 560px; }
.find-answer .find-text { white-space: normal; font-weight: 550; line-height: 1.4; }
.find-answer small svg { vertical-align: -2px; }
.find-answer.tone-bad > svg { color: var(--bad); }
.find-answer.tone-warn > svg { color: var(--warn, #f59e0b); }
.find-answer.tone-ok > svg { color: var(--ok); }
.find-howto { align-items: flex-start; cursor: pointer; }
.find-howto > svg { margin-top: 2px; }
.find-howto .find-from { white-space: normal; }
.find-md { font-size: 13px; line-height: 1.5; color: var(--text-2); white-space: normal; }
.find-md p, .find-md ul, .find-md ol { margin: 2px 0 0; }
.find-md ul, .find-md ol { padding-left: 18px; }
.find-md a { color: var(--accent); }
.find-md .callout { margin: 4px 0 0; padding: 6px 8px; font-size: 12.5px; }
.find-ai { margin: 4px 2px 6px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.find-ai.err { background: transparent; border-color: var(--border-2); }
.find-ai-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12px; color: var(--accent); }
.find-ai .find-md { color: var(--text); font-size: 13.5px; }
.find-ai .muted.small { margin-top: 6px; }
.find-ask-ai > svg { color: var(--accent); }
.find-helpful { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px 4px; margin-top: 4px;
  border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-3); }
.find-locked b { color: var(--text-2); }
.ask-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.ask-list li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
.ask-list li svg { flex: none; margin-top: 2px; color: var(--text-3); }
.ask-sent { margin: 12px 0; }
@media (max-width: 760px) {
  .find-drop.asking { width: auto; }
  .find-helpful button { min-height: 44px; min-width: 64px; }
}
/* the switch-day check (round 11, switchcheck.js): where you are, the scan lines in three colours (found, somewhere
   else or not in stock, didn't scan), the tiles, the lists' tabs with their counts */
.swc-where { margin: 0 0 12px; }
.swc-here { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swc-where-pick { flex: 1 1 220px; max-width: 320px; }
.swc-where-pick input { width: 100%; }
.swc-lines { display: grid; gap: 4px; margin-top: 10px; max-height: 420px; overflow: auto; }
.swc-line { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px;
  background: var(--surface-2); border-left: 3px solid var(--c, var(--border-2)); }
.swc-line > svg { flex: none; margin-top: 2px; color: var(--c, var(--text-3)); }
.swc-line.found { --c: var(--ok); }
.swc-line.elsewhere { --c: var(--warn); background: var(--warn-soft); }
.swc-line.unknown { --c: var(--bad); background: var(--bad-soft); }
.swc-line.again, .swc-line.wait { color: var(--text-2); }
.swc-line.place { --c: var(--accent); }
.swc-line .spinner { flex: none; width: 13px; height: 13px; margin-top: 2px; }
.swc-main { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.45; }
.swc-time { flex: none; color: var(--text-3); font-size: 12px; white-space: nowrap; margin-top: 1px; }
.swc-act { flex: none; }
.swc-progress { margin: 0 0 12px; }
.swc-progress .ubar { max-width: 420px; height: 10px; }
.swc-tabs { margin-bottom: 14px; }
.swc-count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: 11.5px;
  font-weight: 650; line-height: 18px; text-align: center; background: var(--surface-3); color: var(--text-2); }
.swc-listbar { gap: 10px 14px; margin-bottom: 10px; align-items: flex-end; }
.swc-listbar > label.f { margin: 0; min-width: 220px; }
.swc-code { overflow-wrap: anywhere; }
.swc-facts { margin: -8px 0 12px; line-height: 1.6; }
.swc-notes { margin-bottom: 16px; }
.swc-link-field { margin-top: 14px; }
@media (max-width: 760px) {
  .swc-where-pick { max-width: none; }
  .swc-line { flex-wrap: wrap; }
  .swc-act { flex: 1 1 100%; order: 3; }
  .swc-act .btn, .swc-act button { width: 100%; justify-content: center; }
  .swc-listbar > label.f { flex: 1 1 100%; min-width: 0; }
  .swc-progress .ubar { max-width: none; }
}
/* ------------------------------------------------------------------ make inactive instead of delete (round 12, inactive.js) */
/* a toast with Undo: the message and its button on one line, wrapping on a phone */
.toast-msg:has(.toast-undo) { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toast-undo { flex: none; height: 32px; padding: 0 12px; font-weight: 650; pointer-events: auto; }
/* a list's "Show inactive" switch sits with the filters */
.toolbar label.cb.inactive-switch { margin: 0 4px; white-space: nowrap; }
/* an inactive row: quieter, its name still readable (the Inactive pill says why) */
tr.row-inactive td { color: var(--text-2); }
tr.row-inactive td b { font-weight: 600; }
/* Delete greyed while something uses the record: a click says why (and offers Make inactive) */
button.is-blocked { opacity: .55; }
button.is-blocked:hover { opacity: .8; }
/* a ship-to line: Make inactive / Make active next to Remove; an inactive one quieter, its pill under its code */
[data-child="addresses"] table.grid-fixed th.th-actions { width: 84px; }
tr.row-inactive td input, tr.row-inactive td select { color: var(--text-2); }
.ship-off { margin-top: 5px; }
/* an inactive label design on the Labels page */
.lbl-card.lbl-inactive .lbl-thumb { opacity: .5; }
@media (max-width: 760px) {
  .toast-undo { height: 44px; }
  .toolbar label.cb.inactive-switch { min-height: 44px; }
}

/* reports (round 13, reports.js): the hub's cards of reports, a report's filter bar, its sections, Save as */
.rpt-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.rpt-hub > .panel { margin: 0; }
.rpt-items { display: flex; flex-direction: column; gap: 2px; }
.rpt-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 9px; color: var(--text); text-decoration: none; }
.rpt-item:hover { background: var(--hover); }
.rpt-item-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--accent); }
.rpt-item.rpt-link .rpt-item-ic { color: var(--text-3); }
.rpt-item.rpt-saved .rpt-item-ic { color: var(--ok); }
.rpt-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rpt-item-text small { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.rpt-search { min-width: 260px; }
.rpt-meta { margin: -6px 0 12px; }
.rpt-period { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--text-2); }
.rpt-desc { margin: 4px 0 0; max-width: 900px; }
.rpt-bar { margin-bottom: 6px; }
.rpt-bar .toolbar { margin-bottom: 10px; }
.rpt-periods select.on { border-color: var(--accent); }
.rpt-dates { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rpt-ref { display: inline-flex; align-items: center; gap: 4px; }
.rpt-ref input { min-width: 180px; }
.rpt-num { width: 90px; }
.rpt-body { transition: opacity .15s; }
.rpt-busy { opacity: .55; pointer-events: none; }
.rpt-chart { margin: 4px 0 18px; }
.rpt-table td.neg, .rpt-table td.neg b { color: var(--bad); }
.rpt-cut { margin: 8px 0 0; }
.rpt-notes { margin: 4px 0 16px; }
.rpt-item-locked { opacity: .62; cursor: default; }
.rpt-table td.rpt-flagged { color: var(--warn, #d97706); font-weight: 600; }
.rpt-flag { display: inline-flex; vertical-align: -1px; }
.rpt-notes .hint { margin: 4px 0; display: flex; align-items: center; gap: 4px; }
.rpt-donut { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; }
.rpt-donut-legend { flex-direction: column; flex-wrap: nowrap; margin: 0; }
.rpt-donut-legend b { color: var(--text); font-weight: 600; margin-left: 4px; }
.rpt-linkbar { display: flex; justify-content: flex-end; margin: -10px 0 10px; }
.rpt-save { display: flex; flex-direction: column; gap: 10px; }
.rpt-share { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.rpt-share:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rpt-share input { margin-top: 3px; }
.rpt-share span { display: flex; flex-direction: column; gap: 2px; }
.rpt-share small { color: var(--text-3); }
.rpt-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .rpt-hub { grid-template-columns: minmax(0, 1fr); }
  .rpt-search { min-width: 0; flex: 1 1 100%; }
  .rpt-seg { max-width: 100%; overflow-x: auto; }
  .rpt-dates, .rpt-dates > .date-l { flex: 1 1 100%; }
  .rpt-dates > .date-l > input { flex: 1; min-width: 0; }
  .rpt-ref { flex: 1 1 100%; }
  .rpt-ref input { min-width: 0; width: 100%; }
  .rpt-picks > select, .rpt-picks > .date-l { flex: 1 1 100%; }
  .rpt-picks > .date-l > select, .rpt-picks > .date-l > input { flex: 1; min-width: 0; }
  .rpt-top > .spacer { display: none; }
  .rpt-actions { justify-content: flex-start; margin-left: 0; }
  .rpt-item { padding: 11px 10px; }
  .rpt-share { padding: 12px; }
}
@media print { .rpt-bar, .rpt-actions, .rpt-top, .rpt-linkbar { display: none !important; } }

/* reports from lists (round 13, listreports.js): Columns, Group by and Totals on a list, its report with groups */
.lr-groupby select { max-width: 240px; }
.toolbar label.cb.lr-totals { white-space: nowrap; }
.lr-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 10px; font-size: 13px; }
.lr-sum b.neg { color: var(--bad); }
.lr-sum .fchip { margin-left: 2px; }
.lr-banner .callout { margin: 0 0 12px; }
table.lr-table td.neg, table.lr-table td.neg b { color: var(--bad); }
table.lr-table tr.lr-head > td { background: var(--surface-2); padding-top: 9px; padding-bottom: 9px; }
table.lr-table tr.lr-head a { color: var(--text); }
table.lr-table tr.lr-sub > td { border-bottom: 2px solid var(--border-2); }
table.lr-table tr.lr-total > td { border-top: 2px solid var(--border-2); }
.lr-cols-about { margin: 0 0 10px; }
.lr-col-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin-bottom: 12px; }
.lr-col { display: flex; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.lr-col-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lr-col select { width: 130px; }
.lr-col-total { width: 130px; }
.lr-cols-foot { align-items: center; gap: 8px; margin-top: 4px; }
.lr-pick { display: flex; flex-direction: column; gap: 10px; }
.lr-pick-area .sub-label { margin: 0 0 6px; }
.lr-pick-items { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .lr-groupby { flex: 1 1 100%; }
  .lr-groupby select { flex: 1; min-width: 0; max-width: none; }
  .toolbar label.cb.lr-totals { min-height: 44px; }
  .lr-col { flex-wrap: wrap; gap: 2px 4px; }
  .lr-col-name { flex: 1 1 100%; padding-top: 4px; }
  .lr-col select { flex: 1; width: auto; min-height: 44px; }
  .lr-col-total { display: none; }
  .lr-col button { min-width: 44px; min-height: 44px; }
  .lr-pick-items .btn { min-height: 44px; }
}
/* report emails (round 13, reportmail.js): the "Email this report" window and Reports > Report emails */
.rme-form { display: flex; flex-direction: column; gap: 16px; }
.rme-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rme-head .sub-label { margin-bottom: 6px; }
.rme-filter { display: flex; margin-bottom: 6px; }
.rme-filter input { flex: 1; min-width: 0; }
.rme-people { border: 1px solid var(--border); border-radius: 10px; max-height: 236px; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.rme-person { display: flex; align-items: flex-start; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.rme-person:hover { background: var(--hover); }
.rme-person input { margin-top: 2px; flex: none; }
.rme-person > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rme-person b { font-weight: 600; }
.rme-person small { color: var(--text-3); overflow-wrap: anywhere; }
.rme-person.off { cursor: default; }
.rme-person.off:hover { background: none; }
.rme-person.off b { color: var(--text-3); }
.rme-person .rme-why { color: var(--warn); display: flex; align-items: flex-start; gap: 4px; }
.rme-person .rme-why svg { flex: none; margin-top: 2px; }
.rme-who .req-msg, .rme-days + .req-msg { margin-top: 6px; }
.rme-days { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 12px; }
.rme-dayseg > button { min-width: 44px; }
/* a picked day is plainly on: filled with the accent and a check (nightly 2026-11-05 plan#6) */
.rme-dayseg > button.rme-day { display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.rme-dayseg > button.rme-day.on { background: var(--accent, #2f6bff); color: #fff; font-weight: 700; }
.rme-dayseg > button.rme-day:not(.on) { color: var(--text-2, #555); }
.rme-row { display: flex; flex-wrap: wrap; gap: 12px; }
.rme-row > label.f { flex: 1 1 200px; }
.rme-row > label.rme-time { flex: 0 1 150px; }
.rme-attach { display: flex; flex-wrap: wrap; gap: 4px 0; }
.rme-next { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 13.5px; }
.rme-next svg { color: var(--accent); flex: none; }
.rme-lead { margin: -4px 0 14px; max-width: 900px; }
.rme-err { max-width: 360px; overflow-wrap: anywhere; margin-top: 3px; }
.rme-btns { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.rme-btn-row { display: inline-flex; flex-wrap: nowrap; gap: 4px; align-items: center; }
@media (max-width: 760px) {
  .rme-person { padding: 11px 8px; }
  .rme-person input { width: 20px; height: 20px; }
  .rme-row > label.f, .rme-row > label.rme-time { flex: 1 1 100%; }
  .rme-dayseg { display: flex; width: 100%; }
  .rme-dayseg > button { min-height: 40px; min-width: 0; flex: 1 1 0; padding: 0 2px; }
  .rme-btns { align-items: flex-start; }
  .rme-btn-row { flex-wrap: wrap; }
  .rme-btns button { min-height: 40px; }
  .rme-err { max-width: none; }
}

/* round 15 (first-time users) - start: what a menu item is for under the items that look alike (Dashboard / Overview,
   Quality / Quality system), a Getting started step waiting for the plant server, money in Add user's summary, the
   top search's pages and reports */
.nav a.has-sub { align-items: flex-start; }
.nav a.has-sub > svg { margin-top: 1px; flex: none; }
.nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nav-sub { font-size: 11px; font-weight: 500; color: var(--text-3); white-space: normal; }
.nav a.active .nav-sub, .nav a:hover .nav-sub { color: var(--text-2); }
.sw-n.wait { background: var(--warn); color: #fff; }
.lvl-money { color: var(--bad); }
.role-picks > .req-msg { grid-column: 1 / -1; }      /* Add user: no role ticked - said under the roles */
.find-row .find-where { flex: none; font-size: 11px; color: var(--text-3); max-width: 38%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-empty a { color: var(--accent); }

/* round 15b - Approvals: tick boxes and Approve selected (a bar that stays in view), the groups (waiting on the
   customer, the folded never-approved backlog), a row's warnings */
.appr-bar { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.appr-bar[hidden] { display: none; }
.appr-tick-cell { width: 34px; }
.appr-tick-cell input, .appr-tick-all { width: 18px; height: 18px; }
.appr-warn { display: flex; align-items: flex-start; gap: 4px; margin-top: 3px; }
.appr-warn svg { flex: none; margin-top: 2px; }
h3.appr-group, .appr-group { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; font-weight: 700; margin: 22px 0 4px; }
.appr-group-sub { margin: 0 0 12px; max-width: 900px; }
details.appr-backlog { margin-top: 18px; }
details.appr-backlog > summary { cursor: pointer; list-style: revert; padding: 6px 0; }
details.appr-backlog > summary .appr-group { margin: 0; }
#appr-asked, #appr-customer, #appr-backlog, .cp-status { scroll-margin-top: calc(var(--topbar-h) + 12px); }
@media (max-width: 760px) {
  .appr-bar button { min-height: 44px; }
}
/* round 15b: the schedule's Move dialog - where the job goes is one choice: a place in the queue (each named by the job it
   runs after) or the first free time on or after a day */
.sb-place { display: flex; flex-direction: column; gap: 6px; }
.sb-slot { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; min-height: 44px; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.sb-slot:has(input[type=radio]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.sb-slot input[type=radio] { margin-top: 3px; flex: 0 0 auto; }
.sb-slot > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sb-slot small { color: var(--text-3); }
.sb-slot input[type=date] { max-width: 220px; margin-top: 4px; }

/* round 16 - cycle counts (counts.js): the phone's location list, the scans at a location, Done with this location;
   the review's container lines. Inventory vs books (invrec.js): the bridge from the stock to the books */
.cc-phone .scan-row { margin: 0 0 8px; }
.cc-where { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; }
.cc-where b { font-size: 24px; }
.cc-locs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; margin: 0 0 16px; }
/* buttons keep their text on one line (ui.css): these cards wrap theirs - a long part list never widens the page */
button.cc-loc, button.cc-scan { white-space: normal; min-width: 0; max-width: 100%; line-height: 1.3; overflow-wrap: anywhere; }
button.cc-loc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 64px; padding: 10px 14px; text-align: left; height: auto; }
button.cc-loc.done { opacity: .6; }
.cc-loc-code { font-size: 18px; font-weight: 700; }
.cc-loc-what { font-size: 13px; color: var(--text-2); }
.cc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.cc-actions .cc-done { margin-left: auto; min-height: 48px; font-size: 16px; padding: 0 22px; }
button.cc-scan { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; width: 100%; min-height: 44px;
  padding: 8px 12px; margin: 0 0 6px; text-align: left; height: auto; }
button.cc-scan.noted { border-style: dashed; color: var(--text-2); }
.cc-scan-qty { font-weight: 600; white-space: nowrap; }
.cc-scan-note { flex: 1 1 100%; font-size: 12px; color: var(--warn); }
.cc-exp { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cc-exp.found { color: var(--text-3); text-decoration: line-through; }
.cc-exp.found svg { color: var(--ok); }
tr.cc-items td { border-top: 0; padding-top: 0; }
.cc-item { padding: 2px 0; }
.ir-bridge td:first-child { min-width: 260px; }
.ir-bridge tr.ir-bad td { color: var(--bad); font-weight: 600; }
@media (max-width: 760px) {
  .cc-locs { grid-template-columns: minmax(0, 1fr); }
  .cc-actions > * { flex: 1 1 100%; }
  .cc-actions .cc-done { margin-left: 0; min-height: 52px; order: -1; }
  .ir-bridge td:first-child { min-width: 0; }
}
/* QA review 2026-11-09 - a search box's own list (erp.js pickList, in place of the browser's datalist): under the box
   and above dialogs, the same in every browser; "Searching..." and "No ... matches" said in it, a hint under each */
.pick-menu { position: fixed; z-index: 130; width: max-content; max-width: min(560px, calc(100vw - 16px)); overflow-y: auto;
  padding: 4px; border-radius: 10px; background: var(--bg-elev); border: 1px solid var(--border-2); box-shadow: var(--shadow-lg);
  overscroll-behavior: contain; }
.pick-menu.busy .pick-opt { opacity: .55; }
.pick-opt { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; border-radius: 7px; cursor: pointer; line-height: 1.3; color: var(--text); }
.pick-opt .pick-text { font-weight: 600; }
.pick-opt small { color: var(--text-3); font-size: 12px; }
.pick-opt small.pick-warn { color: var(--bad); }
.pick-opt.on { background: var(--hover); box-shadow: inset 0 0 0 1px var(--accent); }
.pick-opt.pick-new .pick-text { color: var(--accent); }
.pick-state { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--text-2); font-size: 13px; line-height: 1.4; max-width: 420px; }
@media (max-width: 760px) { .pick-opt { min-height: 44px; justify-content: center; } }
/* QA review 2026-11-09 - a quote's numbers while they are worked out again after a change (costing.js quoteCalcPanel) */
.calc-stale > .kpis, .calc-stale > .grid2, .calc-stale > .table-wrap { opacity: .45; transition: opacity .12s; }
.calc-stale > .card-head .ch-text p::after { content: " Updating..."; font-weight: 600; color: var(--accent); }
/* QA review 2026-11-09 - a record's panel while what was done to it (a container moved, held ...) is saved and drawn again */
.panel.updating { pointer-events: none; }
.panel.updating > *:not(.card-head) { opacity: .5; transition: opacity .12s; }
.panel.updating > .card-head .ch-text p::after { content: " Updating..."; font-weight: 600; color: var(--accent); }
