.manual-search input {
  color: var(--ink);
}

.camera-guide {
  inset: 22% 5%;
  pointer-events: none;
}

.camera-guide span {
  position: absolute;
  left: 50%;
  bottom: -30px;
  width: max-content;
  max-width: 92vw;
  transform: translateX(-50%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .75);
}

.camera-guide span[data-stage="enhanced"] {
  color: #ffe2a9;
}

.camera-guide span[data-stage="wide"] {
  color: #9df1e5;
}

.camera-panel .camera-actions {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.camera-panel .camera-actions .btn {
  position: static;
  min-height: 38px;
  padding: 8px 12px;
  transform: none;
  background: rgba(255, 255, 255, .94);
}

.source-verification {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #d7ded9;
  border-radius: 14px;
  background: #f3f6f2;
}

.source-verification div {
  display: grid;
  gap: 5px;
}

.source-verification span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.source-verification b,
.source-verification p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.row-select {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

.source-context {
  min-width: 220px;
  white-space: normal;
}

.source-context b,
.source-context small {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.source-context small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}

.missing-code-form {
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) minmax(88px, .7fr) minmax(100px, .8fr) minmax(150px, 1.2fr) minmax(120px, 1fr) auto;
  gap: 8px;
  min-width: 760px;
  align-items: center;
}

.missing-code-form input {
  min-width: 0;
}

.queue-import-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.work-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 0 0 12px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .78);
}

.work-mode-switch button {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px 9px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.work-mode-switch button b {
  color: inherit;
  font-size: 13px;
}

.work-mode-switch button small {
  overflow: hidden;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-mode-switch button.is-active {
  color: #fff;
  background: var(--teal);
  box-shadow: 0 5px 14px rgba(15, 118, 110, .18);
}

.mobile-app.is-receipt-mode .scan-stage {
  background: linear-gradient(145deg, #173f3d, #18756d);
}

.search-result {
  scroll-margin-top: 74px;
}

.package-title-row,
.receipt-item-list-head,
.receipt-item-row,
.compact-context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.package-title-row > div:first-child {
  min-width: 0;
}

.package-title-row .waybill-number {
  margin-bottom: 3px;
}

.mobile-scan-count {
  flex: 0 0 auto;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  font-size: 10px;
  white-space: nowrap;
}

.mobile-scan-count b {
  font-size: 14px;
}

.compact-decision {
  padding: 8px 9px;
  font-size: 11px;
}

.compact-info-grid {
  margin: 7px 0;
}

.compact-info-grid .info-cell {
  padding: 7px 8px;
}

.compact-info-grid .info-cell b {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}

.compact-source-verification {
  grid-template-columns: minmax(92px, .7fr) minmax(0, 1.3fr);
  gap: 7px;
  margin: 7px 0 8px;
  padding: 8px 9px;
}

.compact-source-verification b,
.compact-source-verification p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.dispatch-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 7px 0 8px;
  padding: 8px 9px;
  border: 1px solid #b9dfd7;
  border-radius: 12px;
  background: #eef8f5;
}

.dispatch-switcher > div:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.dispatch-switcher span,
.dispatch-switcher small {
  color: var(--muted);
  font-size: 10px;
}

.dispatch-switcher b,
.dispatch-switcher small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-switcher > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
}

.dispatch-switcher .btn {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 10px;
}

.missing-count {
  color: var(--red) !important;
  font-weight: 900;
}

.compact-package-card .inspection-item {
  padding: 8px 9px;
}

.compact-package-card .item-meta {
  margin-top: 2px;
}

.compact-package-card .tag-grid {
  margin-top: 6px;
}

.compact-package-card .tag-grid button {
  min-height: 33px;
  font-size: 11px;
}

.compact-package-card .inspection-form {
  margin-top: 7px;
}

.compact-package-card .rejected-order-check {
  padding: 8px 9px;
}

.compact-package-card .rejected-order-check small {
  display: none;
}

.compact-package-card .inspection-extras summary {
  padding: 8px 10px;
}

.receipt-status-banner {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #b9dfd7;
  border-radius: 12px;
  background: #e9f7f3;
}

.receipt-status-banner b {
  color: var(--teal);
  font-size: 13px;
}

.receipt-status-banner span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.receipt-status-banner.is-exception {
  border-color: #efd098;
  background: #fff7e8;
}

.receipt-status-banner.is-exception b,
.receipt-status-banner.is-warning b {
  color: #9a6519;
}

.receipt-status-banner.is-complete {
  border-color: #cfd5d1;
  background: #f3f5f2;
}

.compact-context-row {
  padding: 6px 2px;
  border-bottom: 1px solid #edf0ed;
  font-size: 11px;
}

.compact-context-row span {
  flex: 0 0 auto;
  color: var(--muted);
}

.compact-context-row b {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-item-list {
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.receipt-item-list-head {
  padding: 8px 10px;
  background: #f3f6f2;
  font-size: 10px;
}

.receipt-item-list-head span {
  color: var(--muted);
}

.receipt-item-row {
  min-height: 48px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
}

.receipt-item-row > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.receipt-item-row b {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-item-row small,
.receipt-item-row > span {
  color: var(--muted);
  font-size: 10px;
}

.receipt-item-row > span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf5f1;
}

.receipt-item-row > span.has-exception {
  color: #9a6519;
  background: #fff0d4;
}

.receipt-exception-panel {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf7;
}

.receipt-exception-panel summary {
  padding: 9px 10px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

#receiptExceptionForm {
  display: grid;
  gap: 8px;
  padding: 0 9px 9px;
}

#receiptExceptionForm > label:not(.image-picker) {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}

#receiptExceptionForm select,
#receiptExceptionForm textarea,
.receipt-qty-field input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

#receiptExceptionForm textarea {
  min-height: 56px;
  padding: 9px;
  resize: vertical;
}

.receipt-qty-grid {
  display: grid;
  gap: 6px;
}

.receipt-qty-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  align-items: center;
  gap: 8px;
}

.receipt-qty-field > span {
  display: grid;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.receipt-qty-field small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 400;
}

.receipt-qty-field input {
  padding: 8px;
  text-align: center;
}

.receipt-submit-bar {
  align-items: center;
}

.receipt-submit-bar .receipt-bar-actions {
  display: flex;
  grid-auto-flow: column;
  gap: 6px;
}

.receipt-submit-bar .receipt-bar-actions .btn {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 11px;
}

.receipt-submit-bar .receipt-undo {
  color: #9a6519;
}

.batch-code > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.batch-code > div span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-code.batch-exception {
  border-color: #efd098;
  background: #fffaf0;
}

.batch-code.batch-received {
  border-color: #b9dfd7;
  background: #f1faf7;
}

.batch-code.batch-duplicate {
  border-color: #b9dfd7;
  background: #f1faf7;
}

.batch-code.batch-unmatched {
  border-color: #efaaa4;
  background: #fff0ee;
}

.batch-code.batch-deferred {
  border-color: #d7d9d4;
  background: #f3f4f1;
}

.batch-code.batch-pending {
  border-style: dashed;
  opacity: .78;
}

.batch-defer-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #ca5b51;
  border-radius: 9px;
  background: #fff;
  color: #a63b32;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.voice-announcer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 12px 0 2px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 14px;
  background: rgba(255,255,255,.1);
}

.voice-announcer-switch,
.voice-cue-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.voice-announcer input {
  width: 17px;
  height: 17px;
  accent-color: #50d1c0;
}

.voice-announcer select {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 9px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 10px;
}

.voice-announcer select option {
  color: #102b2a;
}

.quick-batch-live {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(8,60,58,.07);
}

.quick-batch-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-batch-live-head > div {
  display: grid;
  gap: 2px;
}

.quick-batch-live-head b {
  font-size: 13px;
}

.quick-batch-live-head small {
  color: var(--muted);
  font-size: 9px;
}

.quick-batch-live-head strong {
  color: var(--teal);
  font-size: 12px;
}

.quick-batch-live-list {
  max-height: 34vh;
  scroll-behavior: smooth;
}

.unmatched-code {
  margin: 10px auto;
  padding: 9px 11px;
  border-radius: 10px;
  background: #fff0ee;
  color: #8d3129;
  font-size: 12px;
  word-break: break-all;
}

.unmatched-code strong {
  font-size: 14px;
}

@media (max-width: 980px) {
  .queue-import-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .voice-announcer {
    grid-template-columns: 1fr 1fr;
  }

  .voice-cue-switch {
    grid-column: 1 / -1;
  }

  .mobile-app.has-result .mobile-header {
    padding-top: calc(8px + env(safe-area-inset-top));
    padding-bottom: 8px;
  }

  .mobile-app.has-result .mobile-header .eyebrow {
    display: none;
  }

  .mobile-app.has-result .mobile-header h1 {
    font-size: 21px;
  }

  .mobile-app.has-result .live-dot {
    padding: 5px 8px;
  }

  .mobile-app.has-result .mobile-main {
    padding-top: 8px;
  }

  .package-head {
    padding: 10px 12px;
  }

  .package-head h2 {
    margin-top: 5px;
    font-size: 19px;
  }

  .package-body {
    padding: 8px;
  }

  .compact-package-card .item-list {
    gap: 6px;
  }

  .inspection-submit-bar {
    padding: 7px 10px;
  }

  .inspection-submit-bar > div:first-child {
    min-width: 0;
  }

  .inspection-submit-bar > div:first-child b,
  .inspection-submit-bar > div:first-child span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .receipt-item-list-head span {
    display: none;
  }
}

/* v1.13.0: continuous camera dock, latest scan HUD and audible offline voice controls */
.voice-test-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.voice-test-actions button {
  min-height: 32px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 9px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.voice-status {
  grid-column: 1 / -1;
  color: rgba(255,255,255,.7);
  font-size: 9px;
  line-height: 1.4;
}

.voice-status[data-status="ready"] {
  color: #9df1e5;
}

.voice-status[data-status="warning"] {
  color: #ffe2a9;
}

.search-result,
.quick-batch-live,
.batch-review {
  scroll-margin-top: calc(96px + env(safe-area-inset-top));
  scroll-margin-bottom: calc(154px + env(safe-area-inset-bottom));
}

.mobile-app.is-camera-docked .camera-panel {
  position: fixed;
  z-index: 28;
  top: calc(78px + env(safe-area-inset-top));
  right: max(12px, calc((100vw - 520px) / 2 + 12px));
  width: min(188px, 46vw);
  height: 138px;
  border: 2px solid rgba(157,241,229,.92);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(0,0,0,.34);
}

.mobile-app.is-camera-docked .camera-panel video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.mobile-app.is-camera-docked .camera-guide {
  inset: 24% 7%;
  border-width: 1px;
  border-radius: 8px;
}

.mobile-app.is-camera-docked .camera-guide span {
  top: 5px;
  bottom: auto;
  max-width: 145px;
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-app.is-camera-docked .camera-panel .camera-actions {
  right: 5px;
  bottom: 5px;
  left: 5px;
  justify-content: flex-end;
  gap: 4px;
}

.mobile-app.is-camera-docked .camera-panel .camera-actions .btn {
  min-height: 26px;
  padding: 4px 7px;
  border-radius: 7px;
  font-size: 8px;
}

.scan-result-hud {
  position: fixed;
  z-index: 35;
  right: max(9px, calc((100vw - 520px) / 2 + 9px));
  bottom: calc(69px + env(safe-area-inset-bottom));
  left: max(9px, calc((100vw - 520px) / 2 + 9px));
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 38px;
  align-items: stretch;
  min-height: 66px;
  overflow: hidden;
  border: 1px solid #91cabf;
  border-radius: 17px;
  background: rgba(7,63,59,.97);
  color: #fff;
  box-shadow: 0 15px 38px rgba(3,34,32,.3);
  backdrop-filter: blur(14px);
}

.scan-result-hud[data-status="unmatched"] {
  border-color: #e99388;
  background: rgba(128,42,35,.97);
}

.scan-result-hud[data-status="pending"] {
  border-color: #d7b678;
  background: rgba(91,69,31,.97);
}

.scan-hud-arrow,
.scan-hud-main {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.scan-hud-arrow {
  font-size: 27px;
  font-weight: 900;
}

.scan-hud-arrow:disabled {
  opacity: .28;
}

.scan-hud-main {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
  padding: 8px 4px;
  text-align: left;
}

.scan-hud-state {
  color: #9df1e5;
  font-size: 9px;
  font-weight: 900;
}

.scan-result-hud[data-status="unmatched"] .scan-hud-state {
  color: #ffd8d3;
}

.scan-hud-main strong,
.scan-hud-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-hud-main strong {
  font-size: 14px;
  letter-spacing: .02em;
}

.scan-hud-main small {
  color: rgba(255,255,255,.75);
  font-size: 9px;
}

.scan-hud-side {
  display: grid;
  grid-template-rows: 20px 1fr;
  align-items: center;
  text-align: center;
}

.scan-hud-side span {
  padding-top: 5px;
  color: rgba(255,255,255,.7);
  font-size: 8px;
}

.mobile-app.has-scan-hud {
  padding-bottom: 158px;
}

@media (min-width: 521px) {
  .scan-result-hud {
    right: calc((100vw - 520px) / 2 + 9px);
    left: calc((100vw - 520px) / 2 + 9px);
  }
}
