/* Barcode scanning (OP-056): the scanner (Components/Shared/BarcodeScanner.razor — the camera button, the typed field, the
   camera layer js/onix-barcode.js shows over the page) and the Inventory scan pages (Pages/Inventory/Scan), which sit in the
   phone column of css/onix-road.css. Nothing is wider than a 390 px screen and every target is at least 44 px high.
   Tokens from onix-theme.css; the camera layer is dark whatever the theme, as a viewfinder is. */

.barcode-scanner { display: grid; gap: 8px; min-width: 0; }
.barcode-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.barcode-camera-button { min-height: 48px; min-width: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; }
.barcode-manual { display: flex; gap: 8px; flex: 1; min-width: 0; }
.barcode-manual input { flex: 1; min-width: 0; min-height: 48px; font-size: 1rem; box-sizing: border-box; }
.barcode-manual .button { min-height: 48px; }
.barcode-feedback { margin: 0; font-size: 0.95rem; overflow-wrap: anywhere; }
.barcode-feedback.is-ok { color: var(--good); }
.barcode-feedback.is-error { color: var(--danger-strong); }
.barcode-scanner--compact { display: block; }

/* The camera layer: the picture full screen, a frame to aim with, what the page answered, Light and Done. */
html.barcode-scanning { overflow: hidden; }
.barcode-camera { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; }
.barcode-camera[hidden] { display: none; }
.barcode-camera-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.barcode-camera-frame {
    position: absolute; left: 8%; right: 8%; top: 32%; height: 28%;
    border: 3px solid rgba(255, 255, 255, 0.85); border-radius: 16px;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35); pointer-events: none; transition: border-color 0.15s;
}
.barcode-camera.is-hit .barcode-camera-frame { border-color: var(--good); }
.barcode-camera.is-miss .barcode-camera-frame { border-color: var(--danger); }
.barcode-camera-status {
    position: absolute; left: 16px; right: 16px; bottom: calc(100px + env(safe-area-inset-bottom)); margin: 0;
    text-align: center; font-size: 1.05rem; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); overflow-wrap: anywhere;
}
.barcode-camera-status.is-ok { color: #a6f0c0; }
.barcode-camera-status.is-error { color: #ffb8ad; }
.barcode-camera-actions {
    position: absolute; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom));
    display: flex; gap: 12px; justify-content: center;
}
.barcode-camera-actions .button { min-height: 52px; min-width: 120px; }
.barcode-camera-actions .button.is-on { outline: 3px solid var(--warn); }

/* Check stock · Transfers · Count */
.scan-nav { display: flex; width: 100%; box-sizing: border-box; }
.scan-nav a { flex: 1; text-align: center; padding: 10px 8px; border-radius: 999px; color: var(--ink-soft); font-weight: 500; text-decoration: none; min-height: 24px; }
.scan-nav a.is-active { background: var(--solid); color: var(--solid-ink); font-weight: 600; }

.scan-filter { display: grid; gap: 4px; min-width: 0; }
.scan-filter select { min-height: 44px; width: 100%; box-sizing: border-box; }
.scan-route { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; overflow-wrap: anywhere; }
.scan-stock li { display: grid; gap: 2px; }

/* A line of a transfer or a count: its colour on the left — short or waiting (amber), done (green), beyond or different (red). */
.scan-line {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
    padding: 10px 0 10px 10px; border-top: 1px solid var(--line); border-left: 4px solid transparent; min-width: 0;
}
.scan-line--short { border-left-color: var(--warn); }
.scan-line--done { border-left-color: var(--good); }
.scan-line--over, .scan-line--differs { border-left-color: var(--danger); }
.scan-progress { font-weight: 600; color: var(--ink); }
.scan-hint { margin: 4px 0 0; color: var(--warn); font-size: 0.9rem; }

.scan-validate { display: grid; gap: 10px; }
.scan-choice { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; min-width: 0; }
.scan-choice legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.scan-choice label { display: flex; gap: 10px; align-items: center; min-height: 44px; }
