:root {
  color-scheme: dark;
  --bg: #000;
  --card: #161616;
  --raised: #2a2a2a;
  --line: #4a4a4a;
  --text: #fff;
  --muted: #c8c8c8;
  --radius: 14px;
  --font: clamp(1rem, 0.92rem + 0.35vw, 1.2rem);
  --touch: clamp(3.5rem, 9dvh, 4.75rem);
  --gap: clamp(0.45rem, 1.2dvh, 0.9rem);
}

@media (pointer: fine) {
  :root { --touch: clamp(2.6rem, 4.5dvh, 3rem); }
}

@media (max-height: 32rem) {
  :root { --touch: 2.85rem; }
}

@media (pointer: coarse) {
  :root { --touch: clamp(3.5rem, 9dvh, 4.75rem); }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: var(--font);
  line-height: 1.35;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.wrap {
  container: app / size;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding:
    calc(0.75rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    calc(0.75rem + env(safe-area-inset-bottom, 0px))
    calc(1rem + env(safe-area-inset-left, 0px));
}

.top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  margin-bottom: var(--gap);
  flex-shrink: 0;
}
.top-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  margin: 0;
  letter-spacing: 0.16em;
  font-size: clamp(0.75rem, 0.7rem + 0.4vw, 0.95rem);
  color: var(--muted);
}

body[data-screen="mode"] .top-main { display: none; }
body[data-screen="mode"] .top { margin-bottom: 0.3rem; }

.status-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  width: 100%;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: #fff;
}
.status-bar.is-offline {
  background: #c98900;
  border-color: #c98900;
  color: #000;
}
.status-bar.is-failed {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
.net, .queue {
  margin: 0;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.status-check {
  margin-left: auto;
  background: transparent;
  border: 2px solid currentColor;
  color: inherit;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  min-height: 2.1rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  cursor: pointer;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 1rem + 2.2vw, 2.5rem);
  line-height: 1.1;
}

.banner, .message, .hint, .quiet { margin: 0 0 var(--gap); }
.banner, .message {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}
.message { border-color: #fff; white-space: pre-line; }
.hint, .quiet, label, .meta { color: var(--muted); }
.quiet { font-size: 0.95rem; }
.quiet a { color: #fff; }
#review-summary { white-space: pre-line; margin: 0; }

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

section:not([hidden]) {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--gap);
  min-height: 0;
  overflow: auto;
}
#screen-scan:not([hidden]),
#screen-inquiry:not([hidden]) {
  overflow: hidden;
}

.choice {
  position: relative;
  overflow: hidden;
  flex: unset;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.4rem;
  text-align: left;
  color: #fff;
  background: #000;
  padding: 0.7rem 0.75rem 0.7rem;
  font-size: clamp(1.15rem, 4.6vw, 1.7rem);
}
.btn.choice {
  background: #000;
  color: #fff;
  border-color: #fff;
}
.choice-icon {
  flex: 1 1 auto;
  width: 100%;
  min-height: 4.2rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.choice-icon svg {
  display: block;
  width: min(100%, 8.6rem);
  height: auto;
  max-height: 100%;
}
.choice-copy { display: block; color: #fff; flex: 0 0 auto; }
.choice-title {
  display: block;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: #fff;
}
.choice-sub {
  display: block;
  margin-top: 0.2rem;
  font-weight: 600;
  font-size: clamp(0.68rem, 2.3vw, 0.92rem);
  letter-spacing: 0;
  color: #f2f2f2;
  line-height: 1.25;
  min-height: 1.25em;
  white-space: nowrap;
}
.choice:active { transform: scale(0.97); }

#screen-mode:not([hidden]) {
  overflow: hidden;
  gap: 0.55rem;
}
.home-hero {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 5.1rem;
  background: #000;
}
.home-hero-stripes {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    #fff 0 2px,
    transparent 2px 5px,
    #fff 5px 8px,
    transparent 8px 10px,
    #fff 10px 11px,
    transparent 11px 16px,
    #fff 16px 20px,
    transparent 20px 23px,
    #fff 23px 24px,
    transparent 24px 30px
  );
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 16%, #000 36%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 16%, #000 36%, #000 82%, transparent 100%);
  pointer-events: none;
}
.home-hero-scan {
  position: absolute;
  top: 12%;
  bottom: 12%;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.35);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}
.home-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  min-height: 5.1rem;
  padding: 0.4rem 0.7rem;
}
.home-hero-mark {
  height: 4.35rem;
  width: 4.35rem;
  flex: 0 0 auto;
  display: block;
}
.home-hero-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  min-width: 0;
}
.home-wordmark { height: 1.45rem; width: auto; display: block; }
.home-app-name {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #fff;
}
.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  flex: 1;
  min-height: 0;
}
#install-hint {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted);
  opacity: 0.7;
  font-weight: 500;
}
@media (display-mode: standalone) {
  #install-hint { display: none !important; }
}

.home-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.home-status p { margin: 0; }
.home-status p + p { margin-top: 0.15rem; }
#home-stock-time.is-stale {
  color: #f0b429;
  font-weight: 700;
}
.link-btn {
  display: inline;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  min-height: 0;
  text-decoration: underline;
  cursor: pointer;
}
#admin-links { margin: 0; }

@keyframes home-tile-in {
  from { opacity: 0; transform: translateY(0.55rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes home-scan {
  0% { left: 10%; opacity: 0; }
  12% { opacity: 0.95; }
  88% { opacity: 0.95; }
  100% { left: 90%; opacity: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  #screen-mode.hero-scan-run .home-hero-scan {
    animation: home-scan 3.8s ease-in-out 1 forwards;
  }
  .choice { transition: transform 140ms ease; }
  #screen-mode.is-ready #mode-transfer { animation: home-tile-in 420ms ease both; }
  #screen-mode.is-ready #mode-stocktake { animation: home-tile-in 420ms ease 70ms both; }
  #screen-mode.is-ready #mode-stock { animation: home-tile-in 420ms ease 140ms both; }
  #screen-mode.is-ready #mode-tracking { animation: home-tile-in 420ms ease 210ms both; }
  #screen-mode.is-ready #mode-lists { animation: home-tile-in 420ms ease 280ms both; }
}

#screen-mode.hero-scan-played .home-hero-scan {
  animation: none !important;
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .home-hero-scan, .choice { animation: none !important; transition: none !important; }
  .home-hero-scan { opacity: 0; }
  .choice:active { transform: none; }
}

.btn { width: 100%; }

.btn, .text-btn, .remove {
  touch-action: manipulation;
  border-radius: var(--radius);
  border: 2px solid #fff;
  background: #fff;
  color: #000;
  min-height: var(--touch);
  padding: 0.55rem 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.btn.secondary, .text-btn, .remove {
  background: #000;
  color: #fff;
}

.remove {
  background: var(--raised);
  border-color: var(--line);
  font-weight: 600;
}

.btn.ghost {
  background: var(--raised);
  border-color: var(--line);
  color: #fff;
  font-weight: 600;
}

a.text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  text-decoration: none;
}

.text-btn {
  min-height: clamp(2.75rem, 6dvh, 3.25rem);
  padding: 0.4rem 0.9rem;
  font-size: 1rem;
  width: auto;
}

.btn:disabled { opacity: 0.4; cursor: default; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { filter: brightness(0.92); }
  .btn.secondary:not(:disabled):hover,
  .text-btn:hover,
  .remove:hover { background: #222; border-color: #fff; }
}

label { display: block; margin-bottom: 0.35rem; }

select, input[type="text"], input[type="password"], input[type="search"] {
  width: 100%;
  min-height: max(2.75rem, var(--touch));
  background: #000;
  border: 2px solid #fff;
  border-radius: var(--radius);
  padding: 0 0.9rem;
}
#pick-search, #staff-filter { min-height: 2.75rem; }
.staff-picker { display: grid; gap: 0.4rem; }
.staff-filter-row { position: relative; }
.staff-filter-row #staff-filter { padding-right: 2.8rem; }
.staff-clear {
  position: absolute;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: var(--touch, 2.75rem);
  height: var(--touch, 2.75rem);
  min-width: 2.75rem;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0;
}
.staff-list {
  display: grid;
  gap: 0.35rem;
  max-height: 16rem;
  overflow: auto;
  padding: 0.15rem 0 0.25rem;
}
.staff-group-label {
  margin: 0.35rem 0 0.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c8c8c8;
}
.staff-choice {
  width: 100%;
  min-height: max(2.75rem, var(--touch, 2.75rem));
  text-align: left;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font: inherit;
  font-weight: 700;
}
.staff-choice.is-selected { background: #fff; color: #000; }

.pair, .manual-row, .review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.manual-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.manual-row .btn { min-width: clamp(5.5rem, 18cqi, 8rem); width: auto; }
.remove { width: auto; }

.review-actions { grid-template-columns: 1fr; }

.count-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}
.last-block { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.last-copy { min-width: 0; }
.plu-count { margin: 0.15rem 0 0; font-weight: 800; font-size: clamp(1.7rem, 7cqi, 2.8rem); line-height: 1.05; }
.style-count { margin: 0.1rem 0 0; font-weight: 700; font-size: clamp(1.15rem, 4.5cqi, 1.7rem); color: #c8c8c8; }
.snap-line { margin: 0.1rem 0 0; color: #c8c8c8; font-weight: 700; }
.over-mark { display: inline-block; margin-left: 0.35rem; background: #fff; color: #000; font-weight: 800; padding: 0.02rem 0.35rem; }
.row-counts .plu-count { font-size: clamp(1.05rem, 3.5cqi, 1.45rem); }
.row-counts .style-count { font-size: 1rem; }

.scan-controls { container-type: inline-size; display: flex; flex-direction: column; gap: var(--gap); flex-shrink: 0; }
.scan-board { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0.35rem; overflow: hidden; }
#screen-inquiry .scan-board { overflow: auto; }
.line-copy { min-width: 0; }
.line-title, .line-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-label { margin: 0; }

.count {
  margin: 0;
  font-size: clamp(2.4rem, 28cqi, 5rem);
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.count-label { margin: 0; color: var(--muted); }

.last-scan, .mono, .file-text {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
}

.last-scan {
  margin: 0;
  font-size: clamp(1.15rem, 8cqi, 2rem);
  word-break: break-all;
}

.scan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  border-top: 1px solid var(--line);
}

.scan-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  min-height: max(3.25rem, var(--touch));
  border-bottom: 1px solid #2c2c2c;
}

.scan-list li.empty {
  display: block;
  color: var(--muted);
  border-bottom: 0;
  padding: 0.8rem 0.2rem;
}

.scan-list .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.scan-list .mono { overflow-wrap: anywhere; }

.product-photo {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  background: #3a3a3a;
  border: 1px solid #4a4a4a;
  display: block;
  overflow: hidden;
}
.product-photo.is-main {
  width: clamp(6.5rem, 28cqi, 9.5rem);
  height: clamp(6.5rem, 28cqi, 9.5rem);
}
.product-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #3a3a3a;
}
.product-photo.is-empty { background: #3a3a3a; }
.line-title { display: block; font-weight: 700; }
.line-meta, .line-qty { display: block; color: var(--muted); font-size: 0.92rem; }
.line-qty { color: #fff; font-variant-numeric: tabular-nums; }

.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.armed.is-bulk {
  background: #fff;
  color: #000;
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  letter-spacing: 0.02em;
}
.armed, .count-flash { margin: 0; font-weight: 800; font-size: clamp(1.3rem, 4vw, 2rem); }
.count-flash { color: #fff; }
.soh-warn {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  background: #fff;
  color: #000;
  border: 3px solid #fff;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  flex: 0 0 auto;
}
.soh-warn p { margin: 0; }
#soh-title { font-weight: 800; font-size: clamp(1.05rem, 3.4vw, 1.5rem); }
#soh-detail { font-size: 0.95rem; overflow-wrap: anywhere; }
.soh-mark {
  width: 2.4rem;
  height: 2.4rem;
  border: 3px solid #000;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.4rem;
}
#qty-pad, #qty-confirm {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding:
    calc(0.8rem + env(safe-area-inset-top, 0px))
    calc(0.8rem + env(safe-area-inset-right, 0px))
    calc(0.8rem + env(safe-area-inset-bottom, 0px))
    calc(0.8rem + env(safe-area-inset-left, 0px));
}
#qty-readout, #qty-confirm-text {
  margin: 0;
  text-align: center;
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 3.5rem);
}
.qty-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  flex: 1;
  align-content: center;
  max-width: 28rem;
  width: 100%;
  margin: 0 auto;
}
.qty-keys button { min-height: clamp(3.4rem, 12dvh, 5.5rem); font-size: clamp(1.6rem, 6vw, 2.4rem); }
#qty-pad > .btn, #pick-layer > .btn { max-width: 28rem; width: 100%; margin: 0 auto; }

#pick-layer {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: #000;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding:
    calc(0.75rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    calc(0.75rem + env(safe-area-inset-bottom, 0px))
    calc(1rem + env(safe-area-inset-left, 0px));
  overflow: auto;
}
.pick-list, .pick-choices { display: grid; gap: var(--gap); align-content: start; }
.pick-list { overflow: auto; min-height: 6rem; }
.pick-choices {
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  max-height: 40vh;
  overflow: auto;
}
.pick-list button, .pick-choices button { text-align: left; white-space: normal; line-height: 1.25; }
.pick-choices button { min-height: 2.75rem; }
.pick-choices .pick-row {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  overflow: visible;
}
.pick-choices .product-photo { width: 2rem; height: 2rem; }
#pick-sizes {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  max-height: none;
  overflow: auto;
  grid-template-columns: none;
}
#pick-sizes:not(.has-colour-groups) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
}
.pick-colour-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.pick-colour-name {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-weight: 700;
}
.pick-colour-name .product-photo {
  width: 2.25rem;
  height: 2.25rem;
}
.pick-size-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr));
  gap: var(--gap);
}
.btn.pick-size {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.25rem;
  text-align: center;
  min-height: 4.25rem;
  padding: 0.45rem 0.4rem;
  overflow: visible;
  text-decoration: none;
}
.btn.pick-size .product-photo {
  width: 2rem;
  height: 2rem;
}
.pick-row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  /* border-box min-height must fit the 3.25rem thumb plus padding and border */
  min-height: calc(3.25rem + 1.2rem + 4px);
  padding: 0.6rem 0.9rem;
  overflow: visible;
  text-decoration: none;
}
.pick-list .pick-row .product-photo,
.pick-row .product-photo {
  width: 3.25rem;
  height: 3.25rem;
  align-self: center;
}
.pick-list .pick-row > span:last-child,
.pick-row > span:last-child {
  align-self: center;
  overflow-wrap: anywhere;
  text-decoration: none;
  border: 0;
}

.inquiry-figure { font-size: clamp(4rem, 18vw, 8rem); font-weight: 800; margin: 0; line-height: 0.9; font-variant-numeric: tabular-nums; }
.inquiry-label { margin: 0; color: var(--muted); font-weight: 700; }
.inquiry-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem; margin-bottom: var(--gap); }
#stock-filter-fields { margin: 0 0 var(--gap); }
.stock-branches { list-style: none; margin: 0.7rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.stock-branch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: var(--touch);
}
.stock-branch.is-featured {
  background: #fff;
  color: #000;
  border-color: #fff;
}
.stock-branch-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.55rem; }
.stock-branch-qty { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 1.25rem; }
.stock-mark {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}
.stock-branch.is-featured .stock-mark {
  color: #000;
  border-color: #000;
}
.not-found-title { font-size: clamp(2rem, 8vw, 3.5rem); font-weight: 800; margin: 0; }

#reject {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  background: #000;
  color: #fff;
  border-bottom: 4px solid #fff;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  cursor: pointer;
  padding:
    calc(0.7rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    0.7rem
    calc(1rem + env(safe-area-inset-left, 0px));
}
#reject-label { margin: 0; font-size: clamp(1.4rem, 5vw, 2.2rem); font-weight: 800; }
#reject-code {
  margin: 0;
  font-size: clamp(1.05rem, 4vw, 1.5rem);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  overflow-wrap: anywhere;
  max-width: 100%;
}

@container app (max-height: 45rem) {
  .product-photo.is-main { width: 5.5rem; height: 5.5rem; }
}

.remove {
  min-height: max(3rem, calc(var(--touch) - 0.4rem));
  min-width: 5.5rem;
}

.actions {
  flex-shrink: 0;
  background: #000;
  padding-top: 0.15rem;
  position: sticky;
  bottom: 0;
  z-index: 5;
}
.armed { border: 2px solid #fff; }

@media (max-height: 52rem) {
  .wrap {
    padding:
      calc(0.35rem + env(safe-area-inset-top, 0px))
      0.55rem
      calc(0.35rem + env(safe-area-inset-bottom, 0px));
  }
  h1 { font-size: 1.2rem; }
  #screen-scan .count { font-size: 1.7rem; }
  #screen-scan .last-scan { font-size: 1rem; }
  #screen-scan .product-photo.is-main { width: 2.6rem; height: 2.6rem; }
  #screen-scan .scan-actions { gap: 0.3rem; }
  #screen-scan .scan-actions .btn { min-height: 2.4rem; padding: 0.2rem 0.4rem; }
  #screen-scan .plu-count,
  #screen-scan .row-counts .plu-count { font-size: 0.95rem; }
  #screen-scan .style-count,
  #screen-scan .snap-line { font-size: 0.8rem; }
  #screen-scan label[for="wedge"],
  #screen-scan .board-label { display: none; }
  #screen-scan #scan-who { font-size: 0.85rem; margin: 0; }
  .soh-warn { padding: 0.3rem 0.45rem; }
  .count-row { gap: 0.4rem; }
}
#start-scan { margin-top: auto; }

.done-file {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
  color: var(--muted);
}
#done-detail {
  margin: 0 0 0.8rem;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.35rem, 4.2vw, 1.8rem);
  line-height: 1.2;
}

#screen-done {
  width: min(100%, 36rem);
  margin-inline: auto;
  justify-content: center;
}

#camera-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: #000;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding:
    calc(0.75rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    calc(0.75rem + env(safe-area-inset-bottom, 0px))
    calc(1rem + env(safe-area-inset-left, 0px));
}

.camera-stage {
  position: relative;
  width: min(100%, 42rem);
  align-self: center;
  flex: 1;
  min-height: 8rem;
  display: flex;
}
#camera-video {
  width: 100%;
  flex: 1;
  min-height: 8rem;
  background: #111;
  object-fit: cover;
  border-radius: 12px;
}
#camera-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background: rgba(255, 255, 255, 0.4);
  color: #000;
  font-weight: 800;
  font-size: clamp(2.4rem, 12vw, 5rem);
  border-radius: 12px;
  pointer-events: none;
}
#camera-message.is-added {
  background: #fff;
  color: #000;
  border-color: #fff;
}

#camera-layer .pair,
#camera-layer > .btn { width: min(100%, 42rem); align-self: center; }

.file {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  min-width: 0;
}

.file h2 { margin: 0 0 0.35rem; font-size: clamp(1rem, 1.5vw, 1.25rem); overflow-wrap: anywhere; }

.file-text {
  white-space: pre;
  overflow: auto;
  max-height: min(18rem, 40dvh);
  background: #000;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
}

#files { display: grid; grid-template-columns: 1fr; gap: var(--gap); align-content: start; }

body[data-screen="scan"] #example-banner { display: none; }

#screen-scan .btn,
#screen-scan input { min-height: var(--touch); }
#screen-scan label { margin-bottom: 0.15rem; }
#screen-scan .hint { margin: 0; }

/* Wide enough for a list beside the controls: landscape phones, tablets, desktops. */
@container app (min-width: 40rem) {
  body[data-screen="scan"] #example-banner {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #screen-mode {
    display: flex;
    flex-direction: column;
    width: min(100%, 56rem);
    margin-inline: auto;
    gap: 0.75rem;
  }

  .home-grid { gap: 0.75rem; }
  .choice { min-height: 0; }
  .choice-icon svg { width: min(100%, 11rem); }
  .home-wordmark { height: 1.8rem; }
  .home-hero-mark { height: 5.1rem; width: 5.1rem; }
  .home-hero-copy, .home-hero { min-height: 5.8rem; }

  #screen-setup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-content: center;
    width: min(100%, 64rem);
    margin-inline: auto;
    gap: 1rem 1.5rem;
  }

  #transfer-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
  }

  body[data-mode="stocktake"] #staff-fields,
  body[data-mode="scan"] #staff-fields { grid-column: 2; }
  body[data-mode="transfer"] #staff-fields,
  body[data-mode="stock"] #staff-fields,
  #start-scan { grid-column: 1 / -1; }

  #screen-inquiry {
    display: grid;
    grid-template-columns: minmax(18rem, 28rem) minmax(0, 1fr);
    grid-template-areas: "controls list";
    gap: 0.75rem 1.5rem;
    align-items: stretch;
    min-height: 0;
    flex: 1;
  }

  #screen-scan {
    display: grid;
    grid-template-columns: minmax(18rem, 28rem) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
      "controls list"
      "finish list";
    gap: 0.75rem 1.5rem;
    align-items: stretch;
  }

  .scan-controls { grid-area: controls; overflow: auto; min-height: 0; }
  .scan-board { grid-area: list; min-height: 0; }
  #screen-scan .actions { grid-area: finish; align-self: end; }

  #screen-review {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr);
    grid-template-areas:
      "copy device"
      "actions actions";
    align-content: center;
    width: min(100%, 64rem);
    margin-inline: auto;
    gap: 1rem 2rem;
  }

  .review-copy { grid-area: copy; }
  .review-device { grid-area: device; }
  .review-actions {
    grid-area: actions;
    grid-template-columns: 1fr 1fr;
  }

  #files { grid-template-columns: 1fr 1fr; }
}

@container app (min-width: 64rem) {
  #screen-mode { width: min(100%, 64rem); }
}

@container app (min-width: 70rem) {
  #screen-scan, #screen-inquiry { grid-template-columns: minmax(22rem, 32rem) minmax(0, 1fr); }
  #files { grid-template-columns: 1fr 1fr 1fr; }
}

/* Short landscape: keep targets usable and let a stacked screen scroll. */
@container app (max-height: 32rem) {
  h1 { font-size: 1.25rem; }
  .choice { min-height: 0; font-size: 1.15rem; padding: 0.45rem 0.55rem; }
  .choice-sub { font-size: 0.7rem; }
  .home-hero-copy, .home-hero { min-height: 3.6rem; }
  .home-hero-mark { height: 3rem; width: 3rem; }
  .home-wordmark { height: 1.15rem; }
  .choice-icon { min-height: 2rem; }
  .choice-icon svg { width: min(100%, 6rem); }
  .count { font-size: 2.2rem; }
  #screen-mode { overflow: auto; }
}

@container app (max-width: 39.99rem) and (max-height: 32rem) {
  #screen-scan { overflow: auto; }
  .scan-board { flex: none; min-height: 7rem; }
}

@media (min-width: 50rem) {
  #camera-layer { justify-content: center; }
}

.discard-entry {
  align-self: start;
  width: auto;
  margin: 0 0 0.5rem;
  opacity: 0.85;
}
#files .file > .btn,
#files .file > a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.6rem;
  text-decoration: none;
}
#discard-layer, #draft-layer {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
  padding:
    calc(1.1rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    calc(1.1rem + env(safe-area-inset-bottom, 0px))
    calc(1rem + env(safe-area-inset-left, 0px));
}
#discard-layer > div, #draft-layer > div {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(100%, 32rem);
  margin: 0 auto;
}
#discard-copy, #discard-type-hint, #draft-copy, #draft-over-copy {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.4;
  white-space: pre-line;
}
#discard-layer .btn, #draft-layer .btn { width: 100%; }
#draft-layer[hidden] { display: none; }
.choice .draft-badge {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
}

/* Where are you working? A person's choice for this session, not a device setting. */
.home-location {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.6rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: #fff;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  cursor: pointer;
}
.home-location-copy { display: flex; flex-direction: column; min-width: 0; }
.home-location-label { font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em; }
.home-location-detail {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-location-action {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
  color: #fff;
}
.home-location.is-unset { border-color: #fff; }
.home-location:active { transform: scale(0.99); }

.location-list {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  overflow: auto;
  min-height: 0;
}
.location-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.45rem 0.9rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: left;
  touch-action: manipulation;
  cursor: pointer;
}
.location-choice .location-code {
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.location-choice.is-current { background: #fff; color: #000; border-color: #fff; }
.location-choice.is-current .location-code { color: #000; }
@media (hover: hover) and (pointer: fine) {
  .location-choice:hover, .home-location:hover { border-color: #fff; }
}

/* ---- Pick & Receive ------------------------------------------------------------------- */
.home-grid { grid-template-rows: 1fr 1fr auto; }
.choice.choice-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  min-height: 4.4rem;
  padding: 0.55rem 0.75rem;
}
.choice-wide .choice-icon { flex: 0 0 4.6rem; min-height: 0; width: 4.6rem; }
.choice-wide .choice-icon svg { width: 4.6rem; }
.choice-wide .choice-copy { flex: 1 1 auto; min-width: 0; }

.list-head {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-list { display: flex; flex-direction: column; gap: 0.45rem; flex-shrink: 0; }
.card-list .empty, #courier-result .empty { display: block; margin: 0; color: #fff; padding: 0.6rem 0.75rem; border: 1px dashed var(--line); border-radius: var(--radius); }
.list-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: #fff;
  font: inherit;
  min-height: max(3.25rem, var(--touch));
  cursor: pointer;
}
.list-card:active { background: var(--raised); }
.list-card.is-match { border: 2px solid #fff; }
.list-card.is-done { opacity: 0.6; }
/* A received transfer stays readable with a solid white chip: mute the text instead of fading the card. */
.list-card.is-done.is-received { opacity: 1; }
.list-card.is-received .list-card-top, .list-card.is-received .list-card-note { color: var(--muted); }
/* Transfer status chips: greys only; Received is solid white (the confirmed state). */
.status-chip {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: 0.06em;
  white-space: nowrap;
}
.status-chip.is-in-transit { background: transparent; color: var(--muted); border-color: #6a6a6a; border-style: dashed; }
.status-chip.is-hand-delivered { background: #9a9a9a; color: #000; border-color: #9a9a9a; }
.status-chip.is-delivered { background: #5a5a5a; color: #fff; border-color: #5a5a5a; }
.status-chip.is-in-progress { background: #2a2a2a; color: #fff; border-color: #bdbdbd; }
.status-chip.is-received { background: #fff; color: #000; border-color: #fff; }
.list-card-top { display: flex; justify-content: space-between; gap: 0.5rem; font-weight: 800; }
.list-card-units { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-card-sub { color: var(--muted); font-size: 0.86rem; }
.list-card-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 0.86rem;
  text-align: left;
}
.transfer-note { margin: 0; color: #fff; overflow-wrap: anywhere; white-space: normal; }
.courier-scan label { display: block; margin-bottom: 0.3rem; }
.courier-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; }
#courier-result { display: flex; flex-direction: column; gap: 0.45rem; flex-shrink: 0; }
#courier-result[hidden] { display: none; }
.courier-note { margin: 0; font-weight: 700; }
#courier-result.is-miss .courier-note { border: 1px dashed #fff; padding: 0.55rem 0.7rem; border-radius: var(--radius); }
.link-btn { background: none; border: 0; padding: 0; color: #fff; text-decoration: underline; font: inherit; cursor: pointer; }
.example-tag, #lists-example {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: #000;
  background: #c8c8c8;
  border: 0;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  margin: 0;
  align-self: flex-start;
}
.list-summary { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 0.7rem 0.8rem; }
.list-summary p { margin: 0 0 0.25rem; }
.list-summary-head { font-weight: 800; font-size: 1.1rem; }

/* expected vs scanned rows */
.scan-list .list-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.6rem; align-items: center; }
.list-row.is-todo .line-title { color: var(--muted); }
.list-row.is-unexpected, .list-row.is-over { background: #1d1d1d; }
.list-row.is-nobarcode .line-title { font-style: italic; }
.row-tag {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #fff;
}
.row-tag.is-ok { background: #fff; color: #000; }
.row-tag.is-todo { border-color: var(--line); color: var(--muted); }
.row-tag.is-short { border-style: dashed; }
.row-tag.is-over { background: #8e8e8e; color: #000; border-color: #8e8e8e; }
.row-tag.is-unexpected { background: #000; color: #fff; border-width: 2px; }

/* stocktake snapshot indicator: validation only */
.snap-state {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  display: inline-block;
}
.snap-state[hidden] { display: none; }
.snap-state.is-in { background: #fff; color: #000; }
.snap-state.is-out { background: transparent; color: #fff; border: 1px dashed #fff; }
.snap-state.is-review { background: #d9d9d9; color: #000; border: 1px solid #fff; }

/* stocktake source: CI stocktake or SOH snapshot (black, white and grey only) */
.stocktake-source { border: 1px solid var(--line); border-radius: 8px; padding: 0.4rem 0.6rem; margin: 0.25rem 0 0.1rem; }
.stocktake-source[hidden] { display: none; }
.snap-source-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.snap-source { margin: 0; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.02em; color: #fff; }
.stocktake-source.is-ci .snap-source::before { content: "CI"; display: inline-block; margin-right: 0.4rem; padding: 0 0.3rem; border-radius: 4px; background: #fff; color: #000; font-size: 0.7rem; vertical-align: 1px; }
#new-count { font-size: 0.8rem; white-space: nowrap; min-height: 2.75rem; padding: 0.3rem 0.7rem; flex-shrink: 0; }
#new-count[data-blocked="yes"] { color: #8e8e8e; border-color: #4a4a4a; }
.snap-note { margin: 0.3rem 0 0; font-size: 0.8rem; color: #cfcfcf; }
.snap-note[hidden] { display: none; }
.snap-note.is-block { color: #000; background: #d9d9d9; border-radius: 6px; padding: 0.35rem 0.5rem; font-weight: 700; }
.stocktake-source.is-closed { border-style: dashed; }
.count-progress { margin-top: 0.35rem; }
.count-progress[hidden] { display: none; }
.progress-track { height: 0.55rem; border-radius: 999px; background: #2b2b2b; border: 1px solid #4a4a4a; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: #fff; transition: width 0.2s ease; }
.progress-text { margin: 0.25rem 0 0; font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.count-progress .snap-note { font-size: 0.72rem; color: #a8a8a8; margin-top: 0.15rem; }

/* review differences */
.review-diffs { border: 1px solid #fff; border-radius: var(--radius); padding: 0.7rem 0.8rem; flex-shrink: 0; }
.review-diffs[hidden] { display: none; }
#review-diff-summary { margin: 0 0 0.45rem; font-weight: 800; }
#review-diff-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.diff-row { border-top: 1px solid var(--line); padding-top: 0.45rem; }
.diff-row p { margin: 0; }
.diff-name { font-weight: 700; }
.diff-nums { color: var(--muted); font-size: 0.86rem; font-variant-numeric: tabular-nums; }
.diff-row select { margin-top: 0.35rem; width: 100%; }
#review-note { width: 100%; min-height: 3.2rem; }
.pick-courier[hidden] { display: none; }

/* held email preview */
.email-preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 0.6rem 0.75rem; text-align: left; width: 100%; }
.email-preview[hidden] { display: none; }
.email-preview summary { font-weight: 800; cursor: pointer; }
.email-preview dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.15rem 0.6rem; margin: 0.5rem 0; font-size: 0.86rem; }
.email-preview dt { color: var(--muted); }
.email-preview dd { margin: 0; overflow-wrap: anywhere; }
.email-preview pre { margin: 0; white-space: pre-wrap; font-size: 0.78rem; line-height: 1.35; max-height: 40dvh; overflow: auto; background: #000; padding: 0.5rem; border-radius: 8px; }

/* supervisor check */
#supervisor-layer {
  position: fixed;
  inset: 0;
  z-index: 36;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  padding:
    calc(1.1rem + env(safe-area-inset-top, 0px))
    calc(1rem + env(safe-area-inset-right, 0px))
    calc(1.1rem + env(safe-area-inset-bottom, 0px))
    calc(1rem + env(safe-area-inset-left, 0px));
}
#supervisor-layer[hidden] { display: none; }
#supervisor-layer > * { width: min(100%, 32rem); margin-left: auto; margin-right: auto; }
#supervisor-layer h2 { margin: 0; }
#supervisor-why { margin: 0; white-space: pre-line; }
#supervisor-code { letter-spacing: 0.4em; font-size: 1.3rem; }
#screen-done:not([hidden]) { justify-content: safe center; }
.done-sub { margin: -0.4rem 0 0.4rem; white-space: pre-line; color: #fff; line-height: 1.35; }
.done-sub[hidden] { display: none; }
/* compact expected-vs-scanned rows: two per small phone screen at least */
.scan-list .list-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem; padding: 0.35rem 0; min-height: 0; }
.list-row-copy { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.list-row-top { display: flex; justify-content: space-between; gap: 0.5rem; }
.list-row-top .line-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-qty { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-row-bottom { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.list-row-bottom .line-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8rem; }
.list-row-bottom .row-tag { margin-top: 0; flex: 0 0 auto; }
.list-row .remove { min-height: 2.4rem; min-width: 4.6rem; padding: 0 0.6rem; font-size: 0.85rem; }

#inquiry-search[hidden] { display: none; }
.inquiry-actions { margin: 0; }
.inquiry-actions .btn { min-height: var(--touch, 2.75rem); }

.stock-result {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
  max-width: 100%;
  container-type: inline-size;
}
.stock-result-head {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.7rem 0.8rem;
  align-items: start;
}
.stock-result-photo,
.stock-result-photo .product-photo,
.stock-result-photo .product-photo img {
  width: 4.5rem;
  height: 4.5rem;
}
.stock-result-meta { min-width: 0; }
.stock-result-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.stock-result-sub,
.stock-result-stat {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-weight: 500;
}
.stock-result-price {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.stock-result-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
  margin: 0.25rem 0 0;
}
.stock-thumbs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding-bottom: 0.15rem;
}
.stock-thumbs button {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #111;
  overflow: hidden;
  scroll-snap-align: start;
}
.stock-thumbs button.is-current { border-color: #fff; }
.stock-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #222;
}
.stock-store-link {
  width: 100%;
  min-height: var(--touch, 2.75rem);
  text-align: center;
  text-decoration: none;
}
.stock-size-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stock-size-table {
  width: max(100%, 16rem);
  border-collapse: collapse;
}
.stock-size-table th,
.stock-size-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: #fff;
  min-width: 2.4rem;
}
.stock-size-table th:first-child,
.stock-size-table td:first-child {
  text-align: left;
  font-weight: 700;
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
  min-width: 3rem;
}
.stock-size-table thead th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
}
.stock-size-table tr:last-child th,
.stock-size-table tr:last-child td { border-bottom: 0; }
.stock-size-table th.is-featured,
.stock-size-table td.is-featured {
  background: #fff;
  color: #000;
  font-weight: 800;
}
.stock-size-table th.is-featured:first-child,
.stock-size-table td.is-featured:first-child { background: #fff; }
.stock-size-table .quiet { color: inherit; opacity: 0.7; font-weight: 500; font-size: 0.75rem; }
.stock-sold-row {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.stock-sold-row strong { color: #fff; font-weight: 700; }
.pick-colour-choice { width: 100%; }
.pick-row-store {
  display: block;
  margin-top: 0.2rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.pick-row-label { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.pick-row-name { font-weight: 700; overflow-wrap: anywhere; }
.pick-row-meta { color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }

/* Size the header from the result card, not the viewport. On tablets the Stock
   screen already places this card in a side pane of about 360-500px. */
@container (min-width: 22rem) {
  .stock-result-head { grid-template-columns: 5.5rem minmax(0, 1fr); }
  .stock-result-photo,
  .stock-result-photo .product-photo,
  .stock-result-photo .product-photo img { width: 5.5rem; height: 5.5rem; }
  .stock-thumbs button { width: 3.25rem; height: 3.25rem; min-width: 3.25rem; }
}

@container (min-width: 36rem) {
  .stock-result-head { grid-template-columns: 8rem minmax(0, 1fr); align-items: center; }
  .stock-result-photo,
  .stock-result-photo .product-photo,
  .stock-result-photo .product-photo img { width: 8rem; height: 8rem; }
  .stock-store-link { max-width: 22rem; }
  .stock-size-table th,
  .stock-size-table td { padding: 0.65rem 0.7rem; }
}


/* ---- Stock result polish (UX review 14 Nov 2026) ---- */
.status-bar.is-offline {
  background: #2a2a2a;
  border: 1px dashed #fff;
  color: #fff;
}
.status-bar.is-failed {
  background: #fff;
  border: 2px solid #000;
  color: #000;
}
.status-check { position: relative; }
.status-check::after { content: ""; position: absolute; inset: -6px -4px; }

body.has-result .brand { display: none; }
body.has-result .top { gap: 0.5rem; margin-bottom: 0.5rem; }
body.has-result .top-main { min-height: 2.5rem; }
body.has-result h1 { font-size: 1.25rem; }
body.has-result #home {
  position: relative;
  min-height: 2.5rem;
  min-width: 2.75rem;
  padding: 0.2rem 0.9rem;
}
body.has-result #home::after { content: ""; position: absolute; inset: -4px -2px; }
body.has-result #inquiry-hint,
body.has-result #inquiry-offline,
body.has-result #stock-filter-fields,
body.has-result #inquiry-label { display: none !important; }
body.has-result .scan-controls { gap: 0; flex-shrink: 0; }

.scanbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.4rem;
  align-items: center;
}
.scanbar input,
.scanbar .btn {
  min-height: 3rem;
  margin: 0;
}
.scanbar .btn {
  width: auto;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.scanbar .btn.icon { width: 3rem; padding: 0; }
.scanbar .btn.icon .lbl,
body.has-result .scanbar #inquiry-camera .lbl {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.scanbar .btn svg { width: 1.2rem; height: 1.2rem; flex: none; }
#scanbar-filter-slot { display: none; }

.chip-select,
#result-filter-slot,
#scanbar-filter-slot.chip-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.15rem 0 0.2rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-weight: 700;
}
#result-filter-slot::after,
#scanbar-filter-slot::after { content: ""; position: absolute; inset: -6px -2px; }
.chip-select select,
#result-filter-slot select,
#scanbar-filter-slot select {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  min-height: 2.5rem;
  padding: 0 1.6rem 0 0.7rem;
  border: 0;
  background: #000 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='white' d='M1 1l5 5 5-5'/></svg>") no-repeat right 0.55rem center;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  max-width: 11rem;
}

.stock-result { gap: 0.6rem; padding: 0.75rem; min-width: 0; max-width: 100%; }
.stock-head {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}
.stock-photo {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: #222;
  border: 1px solid var(--line);
  padding: 0;
}
.stock-photo .product-photo,
.stock-photo .product-photo img,
.stock-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stock-photo-count {
  position: absolute;
  right: 2px;
  bottom: 2px;
  z-index: 1;
  font-size: 0.7rem;
  line-height: 1;
  font-weight: 800;
  background: #000;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 3px 5px;
  min-height: 0;
}
.stock-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.stock-sub {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}
.stock-facts {
  display: grid;
  grid-template-columns: 0.8fr 0.9fr 1.7fr;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.stock-facts > div { padding: 0.35rem 0.55rem; min-width: 0; }
.stock-facts > div + div { border-left: 1px solid var(--line); }
.stock-facts .k { display: block; font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.stock-facts .v {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-sechead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.25rem;
}
.stock-sechead h2 { margin: 0; font-size: 0.95rem; font-weight: 800; }
.stock-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px dashed #fff;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.stock-grid-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
  max-width: 100%;
}
.stock-grid-wrap.is-compact { overflow: hidden; }
table.stock-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.stock-grid.is-compact { width: 100%; }
.stock-grid.is-compact th:nth-child(1),
.stock-grid.is-compact td:nth-child(1) { width: 32%; }
.stock-grid.is-compact th:nth-child(2),
.stock-grid.is-compact td:nth-child(2) { width: 19%; }
.stock-grid.is-compact th:nth-child(3),
.stock-grid.is-compact td:nth-child(3) { width: 26%; }
.stock-grid.is-compact th:nth-child(4),
.stock-grid.is-compact td:nth-child(4) { width: 23%; }
.stock-grid th, .stock-grid td {
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.55rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.stock-grid th:first-child, .stock-grid td:first-child { text-align: left; }
.stock-grid thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 3rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.15;
  vertical-align: middle;
  background: var(--card);
}
.stock-grid thead th button {
  all: unset;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.stock-grid thead th:first-child button { align-items: flex-start; }
.stock-grid thead th button::after { content: ""; position: absolute; inset: -10px -6px; }
.stock-grid thead .code { color: #fff; font-size: 0.85rem; font-weight: 800; }
.stock-grid thead .sort { font-size: 0.65rem; margin-left: 0.15rem; }
.stock-grid thead .name2 { display: none; font-weight: 500; font-size: 0.72rem; opacity: 0.8; }
.stock-grid thead .tag { display: block; font-size: 0.68rem; font-weight: 700; }
.stock-grid tbody th { font-weight: 800; font-size: 1rem; }
.stock-grid tbody td { font-size: 1.05rem; font-weight: 600; }
.stock-grid .feat { background: #fff; color: #000 !important; font-weight: 800 !important; }
.stock-grid thead .feat, .stock-grid thead .feat .code, .stock-grid thead .feat .tag { color: #000; }
.stock-grid tfoot th, .stock-grid tfoot td {
  border-top: 2px solid #fff;
  border-bottom: 0;
  font-weight: 800;
  font-size: 1rem;
  background: var(--card);
}
.stock-grid tbody tr.is-row { cursor: pointer; }
.stock-grid tbody tr.is-open th,
.stock-grid tbody tr.is-open td:not(.feat) { background: #2a2a2a; }
.stock-grid .chev { display: inline-block; width: 0.8rem; color: var(--muted); font-size: 0.8rem; }
.stock-grid tr.detail td {
  height: auto;
  min-height: 0;
  padding: 0.4rem 0.55rem 0.55rem;
  text-align: left;
  background: #2a2a2a;
  white-space: normal;
}
.stock-grid .is-neg { color: var(--muted); font-weight: 600; }
.stock-grid .ph, .bchip .ph {
  display: inline-block;
  min-width: 1.6em;
  height: 1.1em;
  border: 1.5px dashed #9a9a9a;
  border-radius: 3px;
  vertical-align: middle;
}
.stock-grid .feat .ph { border-color: #555; }
.bchips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.bchip {
  display: inline-flex;
  gap: 0.4rem;
  align-items: baseline;
  border: 1px solid var(--line);
  background: #000;
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  min-height: 2.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.bchip b { font-size: 1rem; }
.bchip.is-neg { color: var(--muted); }

.stock-disclose {
  position: relative;
  width: 100%;
  min-height: 2.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.8rem;
  background: #000;
  color: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
}
.stock-blist { border: 1px solid var(--line); border-radius: 10px; }
.stock-blist .bh {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.stock-seg { display: inline-flex; border: 1px solid #fff; border-radius: 999px; overflow: hidden; }
.stock-seg button {
  min-height: 2.75rem;
  padding: 0 0.7rem;
  border: 0;
  background: #000;
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.8rem;
}
.stock-seg button.is-on { background: #fff; color: #000; }
.stock-br { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.stock-br:last-child { border-bottom: 0; }
.stock-br.is-feat { background: #fff; color: #000; }
.stock-br .t { display: flex; justify-content: space-between; font-weight: 800; }
.stock-br .t small { font-weight: 600; opacity: 0.7; margin-left: 0.3rem; }
.stock-sz {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.15rem 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.stock-sz span { display: flex; justify-content: space-between; opacity: 0.85; }
.stock-sz .is-neg { color: inherit; opacity: 0.65; }

.stock-tail { display: flex; flex-direction: column; gap: 0.55rem; }
.stock-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  overflow: visible;
  padding: 2px 0;
}
.stock-thumbs button {
  position: relative;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  min-width: 2.75rem;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #222;
}
.stock-thumbs button::after { content: ""; position: absolute; inset: -2px; }
.stock-thumbs button.is-current { border-color: #fff; }
.stock-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stock-thumbs .more { color: #fff; font-weight: 800; font-size: 0.9rem; background: #000; display: grid; place-items: center; }
.stock-store-link {
  min-height: 3rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  border-radius: var(--radius);
  font-weight: 700;
}

#photo-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem;
  background: rgba(0,0,0,0.92);
}
#photo-layer[hidden] { display: none; }
#photo-layer-image { width: 100%; max-height: 70dvh; object-fit: contain; background: #111; border-radius: 12px; }
#photo-layer .pair { margin: 0; }
#photo-layer .btn, #photo-close { min-height: 2.75rem; }

.stock-grid-wrap.is-matrix { overflow: auto; }
.stock-grid.is-matrix { table-layout: auto; }
.stock-disclose.is-wide-hidden { display: none; }

/* Phones: compact 4-col grid. Tablet matrix is shown instead. */
.stock-grid-wrap.is-matrix { display: none; }

@container app (min-width: 40rem) {
  body.has-result #screen-inquiry {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-areas: none;
  }
  body.has-result .scan-controls { overflow: visible; }
  body.has-result .scanbar { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  body.has-result .scanbar #inquiry-camera { width: auto; padding: 0 0.7rem; }
  body.has-result .scanbar #inquiry-camera .lbl {
    position: static;
    width: auto;
    height: auto;
    clip: auto;
    overflow: visible;
  }
  body.has-result #scanbar-filter-slot { display: inline-flex; min-height: 3rem; border-radius: var(--radius); }
  body.has-result #result-filter-slot { display: none; }
  .stock-head { grid-template-columns: 7rem minmax(0, 1fr); align-items: start; gap: 1rem; }
  .stock-photo { width: 7rem; height: 7rem; }
  .stock-name { font-size: 1.25rem; }
  .stock-facts { grid-template-columns: 1fr 1fr 1.6fr; max-width: 34rem; }
  .stock-facts .v { font-size: 1.15rem; }
  .stock-tail { flex-direction: row; align-items: center; }
  .stock-tail .stock-thumbs { flex: 1; }
  .stock-store-link { width: auto; padding: 0 1rem; flex: none; }
  .stock-grid th, .stock-grid td { height: 3rem; min-height: 3rem; padding: 0 0.8rem; }
  .stock-grid tbody td { font-size: 1.15rem; }
  .stock-grid thead .name2 { display: block; }
  .stock-grid-wrap.is-compact, .stock-disclose { display: none; }
  .stock-grid-wrap.is-matrix { display: block; }
}

@container app (min-width: 64rem) {
  body.has-result #screen-inquiry {
    display: grid !important;
    grid-template-columns: minmax(0, 18rem) minmax(0, 1fr);
    grid-template-areas: "controls list";
  }
  body.has-result .scan-controls { grid-area: controls; }
  body.has-result #inquiry-result { grid-area: list; }
}

@media (max-height: 42rem) {
  .stock-head { grid-template-columns: 3.5rem minmax(0, 1fr); }
  .stock-photo { width: 3.5rem; height: 3.5rem; }
}
/* ---- Online picking (WWW) ------------------------------------------------------------- */
.home-grid { grid-template-rows: 1fr 1fr auto auto; }
.choice-wide { position: relative; }
.choice-badge {
  flex: 0 0 auto;
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.online-who { display: flex; flex-direction: column; gap: 0.25rem; }
.online-summary-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.online-summary-row .hint { margin: 0; }
.online-review-hint { margin: 0; font-size: 0.78rem; }
.online-card.is-dhl { border-left: 0.35rem solid #fff; }
.online-card.is-held { border-style: dashed; }
.online-flags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.online-chip {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border: 1px solid #8e8e8e;
  color: #d4d4d4;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.online-chip.is-strong { background: #fff; color: #000; border-color: #fff; }
.online-status { color: #fff; }
#online-pick-view { display: flex; flex-direction: column; gap: 0.6rem; }
#online-pick-view[hidden] { display: none; }
.online-order-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.online-order-name { margin: 0; font-size: 1.6rem; font-weight: 800; }
.online-count-box { text-align: right; }
.online-count { font-size: 2rem; white-space: nowrap; }
.online-warning {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  padding: 0.6rem 0.75rem;
  background: #fff;
  color: #000;
  border-left: 0.5rem solid #6a6a6a;
  font-size: 0.95rem;
}
.online-warning[hidden] { display: none; }
.online-actions { grid-template-columns: 1fr 1fr; }
.online-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.online-line { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border: 1px solid #5a5a5a; }
.online-line.is-done { opacity: 0.55; border-color: #333; }
.online-line .product-photo { flex: 0 0 3.2rem; width: 3.2rem; height: 3.2rem; }
.online-line-copy { flex: 1 1 auto; min-width: 0; }
.online-line-copy p { margin: 0; }
.online-line-title { font-weight: 700; font-size: 0.92rem; }
.online-line-qty { margin: 0; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.online-line.is-done .online-line-qty::after { content: " ✓"; }
.online-done { border: 2px solid #fff; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; }
.online-done[hidden] { display: none; }
.online-done p { margin: 0; }
.online-done-title { font-size: 1.4rem; font-weight: 800; text-transform: uppercase; }
.online-tag { padding: 0.4rem 0.55rem; background: #1c1c1c; border: 1px solid #8e8e8e; font-weight: 700; }
.online-tag.is-held::before { content: "HELD · "; }
.online-missing { margin: 0; padding-left: 1.1rem; }
.online-layer {
  position: fixed;
  inset: 0;
  z-index: 36;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(1.1rem + env(safe-area-inset-top, 0px)) 1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.online-layer[hidden] { display: none; }
.online-layer > div { display: flex; flex-direction: column; gap: 0.6rem; width: min(100%, 32rem); margin: 0 auto; }
.online-layer .message { white-space: pre-line; margin: 0; }
.online-layer .btn { width: 100%; }
.online-short-steps { display: flex; flex-direction: column; gap: 0.45rem; }
/* Six tiles at WWW: keep the 2x2 icons whole (scale to fit, never crop) and the wide tiles compact. */
.home-grid.has-online .choice:not(.choice-wide) .choice-icon { min-height: 2.6rem; position: relative; }
.home-grid.has-online .choice:not(.choice-wide) .choice-icon svg { position: absolute; inset: 0; margin: auto; width: 100%; height: 100%; max-width: 8.6rem; }
.home-grid.has-online .choice.choice-wide { min-height: 3.9rem; padding-top: 0.4rem; padding-bottom: 0.4rem; }
.home-grid.has-online .choice-wide .choice-icon,
.home-grid.has-online .choice-wide .choice-icon svg { width: 4rem; flex-basis: 4rem; }
.home-grid.has-online #mode-online.choice-wide { min-height: 4.2rem; }
.home-grid.has-online #mode-online .choice-icon,
.home-grid.has-online #mode-online .choice-icon svg {
  width: 3rem;
  flex-basis: 3rem;
  height: auto;
  aspect-ratio: 80 / 91;
}
.online-subhead { font-size: 0.95rem; margin: 0.7rem 0 0.25rem; }
.online-dispatch-msg { margin: 0; font-size: 1.15rem; font-weight: 800; }
.online-sourcing-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #8e8e8e;
  background: #111;
  text-align: left;
  color: #fff;
}
.online-sourcing-card .list-card-title { font-size: 1.15rem; }
.online-sourcing-missing { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; }
.online-sourcing-missing li { margin: 0.15rem 0; }
.online-sourcing-meta { margin: 0; font-size: 0.8rem; color: #d4d4d4; }
.online-sourcing-chosen { margin: 0; font-size: 0.9rem; font-weight: 700; }
.online-short-steps .btn { width: 100%; }
.online-sourcing-actions { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.15rem; }
.online-order-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.online-order-head .line-meta { white-space: normal; overflow: visible; text-overflow: clip; }
.online-count-box { flex: 0 0 auto; }
.online-count-box p { margin: 0; }
#screen-online.is-picking #online-where,
#screen-online.is-picking .online-who,
#screen-online.is-picking #online-example { display: none; }


/* Press-and-hold to select a barcode (14 Nov 2026). Barcodes are selectable text, and the
   periodic scanner refocus pauses while a selection is open. */
.barcode-text,
.last-scan,
.line-barcode {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
  cursor: text;
}
.last-scan-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}
.copy-chip {
  min-height: 2.75rem;
  min-width: 3.6rem;
  padding: 0 0.8rem;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
}
.copy-chip.is-small { min-height: 2.2rem; min-width: 3rem; padding: 0 0.55rem; font-size: 0.75rem; }
.copied-note {
  font-size: 0.85rem;
  font-weight: 800;
  color: #000;
  background: #fff;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.line-barcode {
  display: inline-block;
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  word-break: break-all;
}
.line-barcode-row { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }

/* Warehouse Location (CI shelf) and WWW on hand on pick lines (14 Nov 2026). */
.online-line-where { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; margin: 0 0 0.2rem; }
.loc-chip { display: inline-block; padding: 0.1rem 0.45rem; background: #fff; color: #000; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em; line-height: 1.3; }
.loc-chip.is-none { background: transparent; color: #bbb; border: 1px dashed #777; font-weight: 600; font-size: 0.85rem; }
.list-row-bottom .loc-chip { font-size: 0.95rem; margin-right: 0.4rem; }
.online-onhand { font-size: 0.85rem; font-weight: 700; color: #ddd; }
.online-onhand.is-low { background: #ffb020; color: #000; padding: 0.05rem 0.35rem; }
.online-soh-at { margin-top: 0.4rem; }

/* Admin: Location pick order (drag, long-press drag on touch, or the arrow buttons). */
.loc-order { list-style: none; margin: 0.5rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.loc-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.4rem; border: 1px solid #5a5a5a; background: #111; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.loc-item.is-dragging { border-color: #fff; background: #222; box-shadow: 0 0 0 2px #fff; }
.loc-handle { flex: 0 0 2.4rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: #ccc; cursor: grab; touch-action: none; border: 1px solid #444; background: #1a1a1a; }
.loc-rank { flex: 0 0 1.6rem; text-align: right; color: #999; font-variant-numeric: tabular-nums; }
.loc-name { flex: 1 1 auto; font-weight: 800; font-size: 1.05rem; }
.loc-meta { color: #aaa; font-size: 0.8rem; font-weight: 400; margin-left: 0.3rem; }
.loc-move { flex: 0 0 2.4rem; height: 2.4rem; padding: 0; font-size: 1.1rem; background: #1a1a1a; color: #fff; border: 1px solid #555; }
.loc-move:disabled { opacity: 0.3; }
.loc-item.is-last { opacity: 0.7; }
