/* Binho Production Station - plain CSS, no build step. Light + dark, 320 px .. desktop. */
:root {
  --bg: #f4f5f7; --panel: #ffffff; --panel-2: #eef0f3; --text: #16181d; --muted: #5d6573; --line: #d6dae1;
  --accent: #1d4ed8; --accent-ink: #ffffff; --focus: #2563eb;
  --pass: #15803d; --pass-ink: #ffffff; --fail: #b91c1c; --fail-ink: #ffffff;
  --fault: #f59e0b; --fault-ink: #1f1300; --neutral: #6b7280; --neutral-ink: #ffffff;
  --info-bg: #e0e7ff; --info-ink: #1e3a8a; --warn-bg: #fff4d6; --warn-ink: #6b4500;
  --test: #7c3aed; --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --tap: 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.4; color: var(--text); background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --panel: #181b21; --panel-2: #20242c; --text: #e8eaee; --muted: #9aa3b2; --line: #2e333d;
    --accent: #3b82f6; --focus: #60a5fa; --pass: #16a34a; --fail: #dc2626; --fault: #f59e0b; --neutral: #4b5563;
    --info-bg: #1e293b; --info-ink: #c7d2fe; --warn-bg: #3a2c05; --warn-ink: #fde68a; --test: #a78bfa;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: clip; /* clip, not hidden: hidden made body a scroll container and the sticky header scrolled away */ }
body { min-height: 100vh; }
img, svg, video, canvas { max-width: 100%; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; word-break: break-word; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- top bar + tabs ---- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem .75rem;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent);
  color: #fff; font-weight: 800; flex: none; }
.top-right { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.who { color: var(--muted); font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.agent { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--neutral); display: inline-block; flex: none; }
.dot.on { background: var(--pass); box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
.dot.off { background: var(--fail); }
.dot.busy { background: var(--fault); }
.tabs { display: flex; gap: .25rem; padding: .4rem .5rem; background: var(--panel); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: thin; position: sticky; top: 53px; z-index: 19; -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 2.5rem; }
.tabs a { flex: none; text-decoration: none; color: var(--text); padding: .6rem .9rem; border-radius: 8px; font-weight: 600;
  min-height: 44px; display: inline-flex; align-items: center; white-space: nowrap; }
.tabs a:hover { background: var(--panel-2); }
.tabs a.active { background: var(--accent); color: var(--accent-ink); }
.tabs .sep { flex: none; width: 1px; background: var(--line); margin: .3rem .25rem; }
@media (max-width: 520px) {
  .brand-name { display: none; }
  .agent-text { display: none; }
  .who { max-width: 12ch; }
  .tabs { top: 53px; }
}

/* ---- layout ---- */
main { padding: 1rem; max-width: 1200px; margin: 0 auto; outline: none; }
@media (max-width: 520px) { main { padding: .6rem; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
  margin-bottom: 1rem; min-width: 0; }
@media (max-width: 520px) { .panel { padding: .75rem; } }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
@media (max-width: 860px) { .grid2, .grid-main { grid-template-columns: minmax(0, 1fr); } }
.page-title { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.page-title h1 { margin: 0; }
.subtabs { display: flex; gap: .25rem; overflow-x: auto; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.subtabs button { border: 0; background: none; color: var(--muted); padding: .7rem .9rem; font: inherit; font-weight: 600; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.subtabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* ---- controls ---- */
label { font-weight: 600; font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .55rem .7rem; min-height: var(--tap); width: 100%; min-width: 0; }
textarea { min-height: 5rem; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; min-height: 44px; cursor: pointer; }
input[type=file] { font: inherit; max-width: 100%; min-height: var(--tap); }
.scan { font-size: 1.6rem; font-family: ui-monospace, Consolas, monospace; letter-spacing: .03em; min-height: 64px; padding: .6rem .9rem;
  border-width: 2px; }
.scan:focus { border-color: var(--focus); }
.btn { font: inherit; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: .6rem 1rem; min-height: var(--tap);
  background: var(--panel-2); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; text-decoration: none; text-align: center; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.pass { background: var(--pass); color: var(--pass-ink); }
.btn.danger { background: var(--fail); color: var(--fail-ink); }
/* QA UX 3: a disabled red button read as a destructive action; disabled = neutral (the reason line says why) */
.btn.danger:disabled, .btn.primary:disabled { background: var(--panel-2); color: var(--muted); border-color: var(--line); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.small { min-height: 36px; padding: .3rem .7rem; font-size: .875rem; }
.btn.big { font-size: 1.5rem; min-height: 80px; width: 100%; padding: 1rem; border-radius: 12px; letter-spacing: .02em; }
.btn.huge { font-size: 1.8rem; min-height: 96px; width: 100%; border-radius: 14px; }
.btn.armed { outline: 3px solid var(--fail); }
.seg { display: flex; flex-wrap: wrap; gap: .5rem; }
.seg button { font: inherit; font-weight: 700; border: 2px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px;
  padding: .6rem 1rem; min-height: 56px; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; flex: 1 1 140px; justify-content: center; }
.seg button[aria-pressed=true] { border-color: var(--accent); background: var(--info-bg); color: var(--info-ink); }
.seg.compact button { min-height: 44px; flex: 0 1 auto; padding: .4rem .8rem; }

/* ---- banners (the live tool's words and colours) ---- */
.banner { border-radius: 14px; padding: 1.2rem 1rem; text-align: center; margin: 0 0 1rem; }
.banner .big { font-size: clamp(2rem, 9vw, 4.5rem); font-weight: 900; letter-spacing: .02em; line-height: 1.05; overflow-wrap: anywhere; }
.banner .msg { font-size: clamp(1rem, 3.5vw, 1.4rem); font-weight: 600; margin-top: .4rem; overflow-wrap: anywhere; }
.banner.pass { background: var(--pass); color: var(--pass-ink); }
.banner.fail, .banner.refused { background: var(--fail); color: var(--fail-ink); }
.banner.fault { background: var(--fault); color: var(--fault-ink); }
.banner.neutral { background: var(--neutral); color: var(--neutral-ink); }
.banner.info { background: var(--info-bg); color: var(--info-ink); }
.banner.refused .big { font-size: clamp(1.6rem, 7vw, 3rem); }
.servicenum { font-family: ui-monospace, Consolas, monospace; font-size: clamp(2.2rem, 11vw, 5.5rem); font-weight: 900; letter-spacing: .04em;
  text-align: center; overflow-wrap: anywhere; }
.alert { border-radius: 10px; padding: .75rem 1rem; margin: .5rem 0; font-weight: 600; overflow-wrap: anywhere; }
.alert.error { background: var(--fail); color: var(--fail-ink); }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.info { background: var(--info-bg); color: var(--info-ink); }
.instructions { font-size: clamp(1.2rem, 4.5vw, 2rem); font-weight: 800; text-align: center; padding: .75rem; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-ink); }
.prompt { font-size: clamp(1.3rem, 5vw, 2.2rem); font-weight: 800; text-align: center; padding: 1rem; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn-ink); border: 3px solid var(--fault); }
.test-badge { display: inline-block; background: var(--test); color: #fff; font-weight: 800; border-radius: 6px; padding: .1rem .5rem;
  font-size: .8rem; letter-spacing: .05em; }
.testbox { border: 2px dashed var(--test); border-radius: 10px; padding: .6rem .8rem; }

/* ---- chips ---- */
.chip { display: inline-block; border-radius: 999px; padding: .15rem .6rem; font-size: .78rem; font-weight: 700; white-space: nowrap;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.chip.pass, .chip.SHIPPED, .chip.QC_APPROVED { background: var(--pass); color: #fff; border-color: transparent; }
.chip.fail, .chip.REFUSED { background: var(--fail); color: #fff; border-color: transparent; }
.chip.fault { background: var(--fault); color: #1f1300; border-color: transparent; }
.chip.BOARD_PASSED, .chip.FINAL_PASSED, .chip.QC_CAPTURED { background: var(--info-bg); color: var(--info-ink); border-color: transparent; }
.chip.test { background: var(--test); color: #fff; border-color: transparent; }

/* ---- bench run ---- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem .2rem; border-bottom: 1px solid var(--line); min-width: 0; }
.steps li:last-child { border-bottom: 0; }
.steps .st { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: .85rem;
  font-weight: 800; background: var(--panel-2); color: var(--muted); }
.steps li.pass .st { background: var(--pass); color: #fff; }
.steps li.fail .st { background: var(--fail); color: #fff; }
.steps li.fault .st { background: var(--fault); color: #1f1300; }
.steps li.running .st { background: var(--accent); color: #fff; animation: pulse 1s infinite alternate; }
.steps li.skip { opacity: .6; }
.steps .name { font-weight: 600; overflow-wrap: anywhere; }
.steps .detail { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
.log { background: #0b0d10; color: #d6e2f0; font-family: ui-monospace, Consolas, monospace; font-size: .8rem; padding: .6rem; border-radius: 8px;
  max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.progress { height: 12px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.unitcard { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .75rem; border-radius: 10px; background: var(--panel-2); }
.unitcard .lbl { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; font-weight: 800; overflow-wrap: anywhere; }

/* ---- QC capture ---- */
.camera { position: relative; background: #000; border-radius: 10px; overflow: hidden; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.camera video { width: 100%; height: 100%; object-fit: contain; display: block; }
.camera .cam-msg { position: absolute; color: #fff; padding: 1rem; text-align: center; }
.camera .rec { position: absolute; top: .5rem; left: .5rem; background: var(--fail); color: #fff; font-weight: 800; border-radius: 6px; padding: .1rem .5rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: .7rem; padding: .6rem .4rem; border-bottom: 1px solid var(--line); font-size: 1.15rem; min-width: 0; }
.checklist .tick { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 8px; border: 3px solid var(--line); display: grid; place-items: center;
  font-weight: 900; font-size: 1.3rem; color: transparent; }
.checklist li.seen .tick { background: var(--pass); border-color: var(--pass); color: #fff; }
.checklist .nm { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.checklist .nm small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.checklist .conf { flex: none; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; color: var(--muted); text-align: right; min-width: 3.5rem; }
.meter { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; margin-top: .2rem; }
.meter > div { height: 100%; background: var(--pass); }

/* ---- QC review ---- */
.viewer { position: relative; background: #000; border-radius: 10px; overflow: hidden; user-select: none; touch-action: none; }
.viewer img { display: block; width: 100%; height: auto; pointer-events: none; }
.viewer .box { position: absolute; border: 3px solid #22d3ee; background: rgba(34,211,238,.12); pointer-events: none; }
.viewer .box span { position: absolute; left: -3px; top: -1.5rem; background: #22d3ee; color: #002; font-size: .75rem; font-weight: 800; padding: 0 .3rem;
  white-space: nowrap; border-radius: 3px; }
.viewer .box.drawing { border-style: dashed; }
.viewer .count { position: absolute; right: .5rem; top: .5rem; background: rgba(0,0,0,.6); color: #fff; padding: .1rem .5rem; border-radius: 6px; font-weight: 700; }
.filmstrip { display: flex; gap: .4rem; overflow-x: auto; padding: .4rem 0; scroll-snap-type: x proximity; }
.filmstrip button { flex: none; border: 3px solid transparent; padding: 0; border-radius: 6px; background: #000; cursor: pointer; position: relative;
  width: 96px; height: 72px; scroll-snap-align: center; }
.filmstrip button img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.filmstrip button.cur { border-color: var(--accent); }
.filmstrip button .mk { position: absolute; bottom: 2px; right: 2px; background: var(--pass); color: #fff; font-size: .7rem; font-weight: 800; border-radius: 4px; padding: 0 .25rem; }
.accbtns { display: flex; flex-wrap: wrap; gap: .4rem; }
.accbtns button { font: inherit; font-weight: 700; border: 2px solid var(--line); background: var(--panel); color: var(--text); border-radius: 10px;
  padding: .45rem .7rem; min-height: 48px; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; text-align: left; flex: 1 1 160px; }
.accbtns button[aria-pressed=true] { background: var(--pass); border-color: var(--pass); color: #fff; }
.accbtns button.drawfor { outline: 3px dashed #22d3ee; outline-offset: 1px; }
.accbtns button.missing[aria-pressed=true] { background: var(--fail, #dc2626); border-color: var(--fail, #dc2626); color: #fff; }
.accbtns .key { font-family: ui-monospace, Consolas, monospace; background: var(--panel-2); color: var(--text); border-radius: 4px; padding: 0 .35rem; font-size: .8rem; }
.accbtns .mc { margin-left: auto; font-size: .78rem; opacity: .85; font-weight: 600; }

/* ---- lists / tables ---- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--line); padding: .65rem .2rem; min-width: 0; }
.list > li:last-child { border-bottom: 0; }
.list a.rowlink, .list button.rowlink { display: flex; gap: .5rem 1rem; flex-wrap: wrap; align-items: center; text-decoration: none; color: inherit;
  width: 100%; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; padding: .2rem 0; min-height: 44px; }
.list .lbl { font-family: ui-monospace, Consolas, monospace; font-weight: 800; font-size: 1.15rem; }
.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem 1rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--line); margin-left: .5rem; }
.timeline li { position: relative; padding: .4rem 0 .8rem 1.1rem; min-width: 0; }
.timeline li::before { content: ""; position: absolute; left: -9px; top: .7rem; width: 15px; height: 15px; border-radius: 50%; background: var(--neutral);
  border: 3px solid var(--panel); }
.timeline li.pass::before { background: var(--pass); }
.timeline li.fail::before { background: var(--fail); }
.timeline li.fault::before { background: var(--fault); }
.timeline .when { color: var(--muted); font-size: .85rem; }
.timeline details { margin-top: .3rem; }
.stagebar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .3rem; }
.stagebar div { text-align: center; padding: .4rem .2rem; border-radius: 8px; background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: .8rem;
  overflow-wrap: anywhere; }
.stagebar div.done { background: var(--pass); color: #fff; }
.stagebar div.next { outline: 2px dashed var(--accent); color: var(--text); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .5rem; }
.gallery figure { margin: 0; position: relative; background: var(--panel-2); border-radius: 8px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery figcaption { font-size: .75rem; padding: .2rem .35rem; display: flex; justify-content: space-between; align-items: center; gap: .2rem; }
.gallery .neg { border: 2px solid var(--fail); }
.accrow { border: 1px solid var(--line); border-radius: 10px; padding: .75rem; margin-bottom: .75rem; }
.accrow h3 { margin: 0; }
.stats { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .9rem; }
.stats b { font-size: 1.05rem; }
.tokenbox { font-family: ui-monospace, Consolas, monospace; background: var(--panel-2); padding: .6rem; border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem .5rem; }
.spinner { display: inline-block; width: 1em; height: 1em; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: spin .8s linear infinite; vertical-align: -.15em; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); background: #111827; color: #fff; padding: .7rem 1rem; border-radius: 10px;
  z-index: 50; max-width: calc(100vw - 2rem); box-shadow: 0 6px 24px rgba(0,0,0,.25); font-weight: 600; }
.toast.error { background: var(--fail); }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; display: grid; place-items: center; padding: .5rem; }
.modal { background: var(--panel); color: var(--text); border-radius: 12px; width: min(760px, 100%); max-height: calc(100vh - 1rem); overflow: auto; padding: 1rem; }

/* ---- login ---- */
.login { max-width: 420px; margin: 8vh auto 0; }
.login .logo { width: 48px; height: 48px; font-size: 1.5rem; border-radius: 12px; }

/* ---- box label (screen preview + print) ---- */
.label-sheet { display: flex; justify-content: center; padding: 1rem 0; }
.label-print { box-sizing: border-box; width: 2in; height: 1in; background: #fff; color: #000; border: 1px solid #999; padding: .05in .08in; display: flex; flex-direction: column;
  align-items: center; justify-content: space-between; overflow: hidden; transform-origin: top center; }
.label-preview-scale { transform: scale(2.2); transform-origin: top center; height: 1in; margin-bottom: calc(1in * 1.2 + 4px); }
@media (max-width: 520px) { .label-preview-scale { transform: scale(1.4); margin-bottom: calc(1in * .4 + 4px); } }
.label-print .lp-prod { font: 700 7pt/1 Arial, sans-serif; letter-spacing: .02em; white-space: nowrap; overflow: hidden; max-width: 100%; }
.label-print svg { width: 100%; height: .5in; display: block; }
.label-print .lp-num { font: 800 11pt/1 Consolas, "Courier New", monospace; letter-spacing: .08em; }
.label-print .lp-test { font: 800 6pt/1 Arial, sans-serif; }
@media print {
  @page { size: 2in 1in; margin: 0; }
  html, body { background: #fff !important; width: 2in; height: 1in; overflow: hidden; }
  body * { visibility: hidden !important; }
  .label-print, .label-print * { visibility: visible !important; }
  .label-print { position: fixed; left: 0; top: 0; border: 0; margin: 0; transform: none !important; }
  .label-preview-scale { transform: none !important; margin: 0 !important; }
}

/* Certificate of Quality links / status (docs.js) */
.list li .doclinks { gap: .4rem; margin-top: .3rem; }
.list li .doclinks:empty { display: none; }
.banner .docs { margin-top: .6rem; font-size: 1rem; font-weight: 600; }
.banner .docs .btn { background: #fff; color: #15171a; }
.banner .docs .chip.pass { background: rgba(255, 255, 255, .22); }
/* Units: one plain link per document; greyed out while it does not exist (Track F) */
.doclink { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.doclink.off { color: var(--muted); opacity: .55; cursor: not-allowed; text-decoration: none; }
.doclink.off:focus { outline: 2px dotted var(--muted); }
.list li .doclinks { flex-wrap: wrap; column-gap: .9rem; }
.chip.legacy { background: var(--panel-2); color: var(--text); border-color: var(--line); }
/* Track I: Stage 4 queue + tab badge */
.tab-badge { display: inline-block; min-width: 1.3em; margin-left: .35rem; padding: 0 .35rem; border-radius: 999px; background: var(--fail, #c62828); color: #fff; font-size: .75rem; font-weight: 800; text-align: center; line-height: 1.3em; }
.count-badge { font-weight: 700; }
#review-queue tr.rowlink { cursor: pointer; }
#review-queue tr.own { opacity: .75; }
#review-queue .own-note { color: var(--fault, #b26a00); font-weight: 600; }
#review-queue ul.reasons { margin: .2rem 0 0 1rem; padding: 0; }
/* Track I: continuous Stage 3 */
.phase-now { font-size: 1.3rem; font-weight: 800; }
.checklist li.phase .phase-items { list-style: none; margin: .2rem 0 0 0; padding: 0; font-size: .9rem; }
.checklist li.phase .phase-items li.seen { color: var(--pass, #2e7d32); }
.checklist li.phase .bad { color: var(--fail, #c62828); }
ul.reasons { text-align: left; margin: .5rem auto; max-width: 40rem; }
.filmstrip .phase-sep { align-self: center; writing-mode: vertical-rl; font-size: .75rem; font-weight: 700; color: var(--muted, #666); padding: 0 .2rem; }
.phase-nav { flex-wrap: wrap; gap: .3rem; }
/* Track I: Model > Training (capture tool) */
.camera { position: relative; }
.hud { position: absolute; left: .6rem; top: .6rem; font: 700 1rem Consolas, monospace; background: rgba(0,0,0,.6); color: #fff; padding: .3rem .5rem; border-radius: 6px; line-height: 1.4; z-index: 2; }
.tr-banner { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); font: 900 2.5rem Consolas, monospace; padding: .3rem 1rem; border-radius: 10px; display: none; z-index: 2; }
.tr-banner.ready { display: block; background: #f1c40f; color: #000; }
.tr-banner.photo { display: block; background: #c0392b; color: #fff; }
.tr-thumbs { display: flex; gap: 6px; overflow-x: auto; }
.tr-thumbs img { height: 70px; border-radius: 4px; }
.phase-card { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: .5rem .7rem; }

/* ---- disabled controls say why (owner rule): ui.js disabledWithReason ---- */
.why { display: inline-block; margin: .2rem .4rem; font-size: .82rem; line-height: 1.3; color: var(--warn-ink);
  background: var(--warn-bg); border-radius: 6px; padding: .15rem .45rem; max-width: 100%; overflow-wrap: anywhere; }
.why[hidden], .why:empty { display: none; }
.why-host { display: flex; flex-wrap: wrap; gap: .25rem; }
.why-host .why { margin: 0; }
.doclink.off .why { margin: 0 0 0 .3rem; font-weight: 400; }

/* ---- bench chips in the header (every page): one per bench agent ---- */
.benchbar { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .35rem; min-width: 0; }
.benchbar[hidden] { display: none; }
/* QA UX 10: on a wide screen the bench chips sit in the top row between the brand and the login (no second header line) */
@media (min-width: 900px) {
  .benchbar { flex: 1 1 0; order: 1; justify-content: center; }
  .top-right { order: 2; }
}
/* QA UX 10 (390 px): an idle/offline chip is short and stays in the top row too; only a busy chip (who/what/since
   text) takes its own full-width line under it */
@media (max-width: 899px) {
  .benchbar:not(:has(.bench-chip[data-state=busy])) { flex: 1 1 0; order: 1; justify-content: flex-end; }
  .benchbar:not(:has(.bench-chip[data-state=busy])) .bench-chip { white-space: nowrap; }
  .top-right { order: 2; }
}
.bench-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; padding: .25rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); text-decoration: none; max-width: 100%; min-height: 32px; }
.bench-chip .bench-chip-text { overflow-wrap: anywhere; }
.bench-chip[data-state=busy] { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--fault); font-weight: 600; }
.bench-chip[data-state=offline] { background: var(--fail); color: var(--fail-ink); border-color: var(--fail); font-weight: 700; }
.bench-chip[data-state=offline] .dot.off { background: var(--fail-ink); }
a.bench-chip:hover { text-decoration: underline; }
.bench-chip .test-badge { font-size: .7rem; }
.readonly-note { font-size: .9rem; color: var(--muted); }

/* QA UX 19/20: one card per row on a phone (ui.js stackTable) */
@media (max-width: 600px) {
  table.stack-sm, table.stack-sm tbody { display: block; width: 100%; }
  table.stack-sm thead { display: none; }
  table.stack-sm tr { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .35rem .6rem; margin: 0 0 .6rem; }
  table.stack-sm td { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .5rem; border: 0; padding: .25rem 0;
    overflow-wrap: anywhere; min-width: 0; }
  table.stack-sm td[data-label]::before { content: attr(data-label); color: var(--muted); font-weight: 700; font-size: .75rem;
    text-transform: uppercase; letter-spacing: .03em; }
  table.stack-sm td > * { min-width: 0; }
  .wk-scroll:has(> table.stack-sm) { overflow-x: visible; }
}
/* a busy chip on a phone takes a second header line: the tab strip then scrolls with the page instead of sliding under it */
@media (max-width: 899px) { body:has(.bench-chip[data-state=busy]) .tabs { position: static; } }
