/* SpoolTrack — shop-floor UI: big targets, high contrast, letters as coloured
   marker tags, donor numbers in mono like stencils. Single column, phone first. */
:root {
  /* dark is the default theme; data-theme="light" brings back the light one */
  --bg: #0b1016;
  --surface: #151c26;
  --surface-2: #1b2430;
  --ink: #e9eef5;
  --muted: #97a3b6;
  --line: #2a3545;
  --accent: #87a2ff;
  --accent-ink: #0b1226;
  --accent-soft: #1f2a4a;
  --good: #5fd08f;
  --good-soft: #15301f;
  --warn: #f2b84e;
  --warn-soft: #33270f;
  --bad: #ff8577;
  --bad-soft: #3a1714;
  --danger: #c8372a;
  --thread: #f2c45a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --tag-s: 38%;
  --tag-l: 22%;
  --tag-ink-s: 85%;
  --tag-ink-l: 80%;
  --tag-edge-l: 42%;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Consolas, monospace;
  --r: 12px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f5; --surface: #ffffff; --surface-2: #f5f7fa; --ink: #111722; --muted: #5a6577; --line: #d6dce5;
  --accent: #1f3fa8; --accent-ink: #ffffff; --accent-soft: #e3e9fb; --good: #17703a; --good-soft: #def3e5;
  --warn: #8f5700; --warn-soft: #fbefd6; --bad: #b42318; --bad-soft: #fde4e1; --danger: #b42318; --thread: #e0a526;
  --shadow: 0 1px 2px rgba(17, 23, 34, .06), 0 2px 8px rgba(17, 23, 34, .05);
  --tag-s: 78%; --tag-l: 91%; --tag-ink-s: 70%; --tag-ink-l: 27%; --tag-edge-l: 72%;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: 1.5rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
.boot { padding: 2rem 1rem; text-align: center; color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.nw { flex-wrap: nowrap; }
.between { justify-content: space-between; }
.svg-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- shell ---- */
.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar .wrap { display: flex; align-items: center; gap: 10px; min-height: 54px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.brand-mark i { display: block; width: 12px; height: 14px; border-top: 3px solid var(--accent-ink); border-bottom: 3px solid var(--accent-ink); background: repeating-linear-gradient(to bottom, var(--thread) 0 2px, transparent 2px 4px); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 5px 12px 5px 6px; cursor: pointer; max-width: 60%; }
.who .av { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
main { padding-top: 18px; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.nav .in { max-width: 760px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600; position: relative; }
.nav a.on { color: var(--accent); }
.nav a.on::before { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--danger); color: #fff; border-radius: 999px; font-size: .65rem; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }

.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h1 { flex: 1; min-width: 0; }
.back { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
.back .svg-ic { transform: rotate(180deg); }

/* ---- surfaces ---- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.section-title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; }
.item:first-child { border-top: 0; }
.item:hover { background: var(--surface-2); }
.item .svg-ic.chev { color: var(--muted); width: 18px; height: 18px; }
.item.static { cursor: default; }
.item.static:hover { background: none; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: var(--r); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.sm { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.xl { min-height: 58px; font-size: 1.08rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 140px; }

.action { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 14px 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; box-shadow: var(--shadow); }
.action .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.action .ic .svg-ic { width: 26px; height: 26px; }
.action b { display: block; font-size: 1.1rem; }
.action small { color: var(--muted); font-size: .88rem; }
.action.main { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.action.main .ic { background: rgba(255, 255, 255, .16); color: var(--accent-ink); }
.action.main small { color: var(--accent-ink); opacity: .82; }
.action.problem .ic { background: var(--bad-soft); color: var(--bad); }
.action.q .ic { background: var(--warn-soft); color: var(--warn); }

/* ---- form controls ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 650; font-size: .92rem; }
.help { font-size: .84rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.05rem;
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.big { font-size: 1.4rem; font-weight: 650; }
.with-unit { position: relative; }
.with-unit .input { padding-right: 52px; }
.with-unit .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.with-prefix { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.with-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.with-prefix .pre { display: grid; place-items: center; padding: 0 4px 0 14px; font-family: var(--mono); font-weight: 700; font-size: 1.4rem; color: var(--muted); }
.with-prefix input { border: 0; outline: 0; background: transparent; min-height: 54px; padding: 8px 12px 8px 2px; font-family: var(--mono); font-size: 1.4rem; font-weight: 700; width: 100%; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid2.stack-sm { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chip small { font-weight: 500; color: var(--muted); }
.chip.on small { color: inherit; opacity: .85; }
.chip.sq { border-radius: 10px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 650; cursor: pointer; padding: 6px 8px; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }

.stepper { display: flex; align-items: stretch; gap: 0; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); width: max-content; max-width: 100%; }
.stepper button { width: 60px; min-height: 56px; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.stepper button:active { background: var(--accent-soft); }
.stepper input { width: 84px; border: 0; text-align: center; font-size: 1.6rem; font-weight: 750; background: transparent; outline: none; }
.stepper.sm button { width: 44px; min-height: 42px; }
.stepper.sm input { width: 56px; font-size: 1.15rem; }

.check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-child { border-top: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }

/* ---- domain pieces ---- */
.tag {
  --h: 220;
  display: inline-flex; align-items: baseline; justify-content: center; gap: 2px;
  min-width: 2em; padding: 1px 7px;
  border-radius: 7px;
  border: 2px solid hsl(var(--h) 50% var(--tag-edge-l));
  background: hsl(var(--h) var(--tag-s) var(--tag-l));
  color: hsl(var(--h) var(--tag-ink-s) var(--tag-ink-l));
  font-weight: 800; font-size: .95rem; line-height: 1.35;
  white-space: nowrap;
}
.tag small { font-weight: 700; font-size: .78em; opacity: .9; }
.tag.lg { font-size: 1.6rem; min-width: 2.1em; padding: 2px 10px; border-radius: 10px; border-width: 2.5px; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
.did { font-family: var(--mono); font-weight: 750; white-space: nowrap; letter-spacing: -.02em; }
.did .p { color: var(--muted); font-weight: 600; }
.did.lg { font-size: 2rem; }

.bar { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; display: flex; }
.bar i { display: block; height: 100%; }
.bar .made { background: var(--good); }
.bar .plan { background: repeating-linear-gradient(45deg, var(--accent) 0 4px, color-mix(in srgb, var(--accent) 45%, transparent) 4px 8px); }
.bar .rem { background: var(--thread); }
.bar .fail { background: var(--bad); }
.bar.thin { height: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.acc { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.donor-card { display: flex; flex-direction: column; gap: 10px; }
.donor-card .top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; min-width: 0; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat span { font-size: .8rem; color: var(--muted); }
@media (max-width: 380px) { .stats { grid-template-columns: 1fr 1fr; } }

.balance { border-radius: var(--r); padding: 12px 14px; font-size: .95rem; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); }
.balance.ok { background: var(--good-soft); border-color: transparent; }
.balance.off { background: var(--warn-soft); border-color: transparent; }
.balance .eq { font-family: var(--mono); font-size: .9rem; overflow-wrap: anywhere; }

.alert { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--ink); text-decoration: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.alert .svg-ic { color: var(--warn); }
.alert.info { background: var(--accent-soft); }
.alert.info .svg-ic { color: var(--accent); }
.alert.bad { background: var(--bad-soft); }
.alert.bad .svg-ic { color: var(--bad); }
.alert.ok { background: var(--good-soft); }
.alert.ok .svg-ic { color: var(--good); }

.log-day { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 2px 6px; }
.log-item { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: start; padding: 12px 14px; border-top: 1px solid var(--line); }
.log-item:first-child { border-top: 0; }
.log-item .t { font-family: var(--mono); font-size: .85rem; color: var(--muted); padding-top: 2px; }
.log-item .who-n { font-weight: 700; font-size: .85rem; }
.log-item .txt { overflow-wrap: anywhere; }
.log-item.voided .txt { text-decoration: line-through; color: var(--muted); }
.log-item .vnote { font-size: .82rem; color: var(--bad); margin-top: 2px; }

.plan-row { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-top: 1px solid var(--line); }
.plan-row:first-child { border-top: 0; }
.plan-row .head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-row .range { font-family: var(--mono); font-size: .88rem; color: var(--muted); overflow-wrap: anywhere; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.tbl { border-collapse: collapse; width: 100%; font-size: .92rem; }
.tbl th, .tbl td { padding: 9px 12px; text-align: left; border-top: 1px solid var(--line); white-space: nowrap; }
.tbl th { border-top: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl.wrap1 td:first-child { white-space: normal; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; padding: 8px 0; font-size: .92rem; }
.hbar .track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.hbar .fill { height: 100%; background: var(--bad); border-radius: 3px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto; width: 100%; }
.pinpad button { min-height: 64px; font-size: 1.6rem; font-weight: 650; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; }
.pinpad button:active { background: var(--accent-soft); }
.pindots { display: flex; justify-content: center; gap: 14px; margin: 8px 0 18px; }
.pindots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pindots i.on { background: var(--ink); border-color: var(--ink); }
.login { max-width: 440px; margin: 0 auto; padding-top: 28px; padding-bottom: 40px; }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.people-pick button { min-height: 64px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: 1.05rem; cursor: pointer; padding: 8px; overflow-wrap: anywhere; }
.people-pick button small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }

.qr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.qr .code { background: #fff; padding: 10px; border-radius: 12px; line-height: 0; }
.qr .code svg { width: 220px; height: 220px; max-width: 100%; }
.qr .url { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; text-align: center; }

/* ---- modal + toast ---- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 20, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); box-shadow: 0 -8px 30px rgba(0, 0, 0, .25); }
.sheet .sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet .sheet-head h2 { flex: 1; min-width: 0; }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 18px; } }
#toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--danger); color: #fff; }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.note-box { padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); font-size: .92rem; }
.note-box.warn { background: var(--warn-soft); }
.note-box.bad { background: var(--bad-soft); }
.result { padding: 14px 16px; border-radius: var(--r); background: var(--good-soft); display: flex; flex-direction: column; gap: 8px; }
details > summary { cursor: pointer; font-weight: 650; padding: 8px 0; }

@media print {
  .topbar, .nav, .no-print, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .card, .list { box-shadow: none; }
}

/* ---- added: multi-donor rows, notes, failed inspection ---- */
button.action { font: inherit; }
.action.qcfail .ic { background: var(--surface-2); color: var(--muted); }
.donor-row { gap: 10px; }
.donor-row .did { min-width: 4.6em; }
.note-item { align-items: flex-start; }
.note-item .txt { overflow-wrap: anywhere; }
.note-box.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper.xs button { width: 38px; min-height: 36px; }
.stepper.xs input { width: 42px; font-size: 1.1rem; }
.left-list { display: flex; flex-wrap: wrap; gap: 2px 16px; }

/* quality control */
.stock-n { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.stock-n.low { color: var(--warn); }
.stock-n.red { color: var(--bad); }
.ends { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: .9rem; align-items: baseline; }
.ends dt { font-weight: 700; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.ends dd { margin: 0; overflow-wrap: anywhere; }
.count-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.count-row .stepper { flex: none; }
.count-row .lbl { min-width: 0; }
.count-row .lbl small { display: block; color: var(--muted); font-size: .82rem; }
.action.test .ic { background: var(--good-soft); color: var(--good); }
.cmd { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; overflow-x: auto; font-size: .9rem; }
