/*
 * Fichier  : assets/css/scanner_terrain.css
 * Auteur   : KREMER Régis
 * Version  : 2.6.98
 * Date     : 2026-07-20
 * Description : Scanner terrain et expérience camera-first mobile/tablette.
 *
 * Changelog :
 *   v2.6.89 (2026-07-20) — SCANNER MOBILE EXPERIENCE2 : caméra prioritaire, résultat en volet,
 *                           historique, file hors ligne et outils secondaires tactiles.
 *   v2.6.91 (2026-07-20) — SCANNER FULL FIELD RECETTE4 : commande caméra centrale,
 *                           résultat produit hiérarchisé et derniers correctifs terrain.
 *   v2.6.92 (2026-07-20) — SCANNER UX POLISH OPTIONAL1 : barre premium, historique à droite et fiche produit simplifiée.
 *   v2.6.93 (2026-07-20) — SCANNER UX POLISH FIX2 : Historique et Attente séparés.
 *   v2.6.94 (2026-07-20) — SCANNER UX FINAL FIELD VALIDATION2 : barre cinq actions renforcée
 *                           sur écrans étroits et validation cumulative des états.
 *   v2.6.98 (2026-07-20) — SCANNER TERRAIN CONFIRMATION1 : verrouillage hidden/inert
 *                           de la fiche source pendant le volet tactile.
 */

/* ── Mode terrain : masquer le chrome de l'app ────────────────── */
body.sm-terrain-mode .sidebar,
body.sm-terrain-mode .mobile-bottom-nav,
body.sm-terrain-mode .top-header { display: none !important; }

body.sm-terrain-mode .main-area    { width: 100%; }
body.sm-terrain-mode .main-content { padding: 8px !important; }

body.sm-terrain-mode #pgScanner .scanner-container {
    max-width: 980px;
    margin: 0 auto;
}

/* Preview plus grande en mode terrain */
body.sm-terrain-mode #pgScanner .scanner-preview {
    aspect-ratio: 3 / 4;
}

/* ── Panneau terrain ─────────────────────────────────────────── */
#pgScanner .terrain-panel {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--bg-elevated);
}

/* Lignes de champs */
#pgScanner .terrain-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
#pgScanner .terrain-row:last-of-type { margin-bottom: 0; }

/* Colonnes flexibles - min-width réduit pour tenir sur 320px */
#pgScanner .terrain-col {
    flex: 1 1 140px;
    min-width: 0;
}

/* Saisie quantité */
#pgScanner .terrain-qty {
    display: flex;
    gap: 6px;
    align-items: center;
}
#pgScanner .terrain-qty .inp {
    flex: 1;
    min-width: 0;
    text-align: center;
}
#pgScanner .terrain-qty .btn {
    flex-shrink: 0;
    padding: 0 12px;
    min-width: 44px;
}

/* Actions terrain */
#pgScanner .terrain-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}
#pgScanner .terrain-actions .btn {
    flex: 1 1 120px;
    max-width: 200px;
}

/* Hint hors-ligne */
#pgScanner .terrain-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

/* ── Responsive mobile ───────────────────────────────────────── */
@media (max-width: 480px) {
    #pgScanner .terrain-col {
        flex-basis: 100%;
    }
    #pgScanner .terrain-actions .btn {
        flex-basis: calc(50% - 4px);
        max-width: none;
    }
    #pgScanner .terrain-qty .btn {
        min-width: 38px;
        padding: 0 8px;
    }
}

/* ─────────────────────────────────────────────────────────────
   MageStock v2.3.7 — Scanner UX terrain / accessibilité
   ───────────────────────────────────────────────────────────── */
#pgScanner .scanner-main-actions .btn,
#pgScanner .manual-scan-row .btn,
#pgScanner #scanResultActions .btn {
    min-height: 44px;
    border-radius: 12px;
}

#pgScanner .scanner-status {
    margin: 12px auto 0;
    width: fit-content;
    max-width: 100%;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid var(--border);
    background: var(--bg-elevated, #f8fafc);
    color: var(--text-secondary, #475569);
}
#pgScanner .scanner-status-running {
    background: rgba(59, 130, 246, .14);
    color: var(--blue, #2563eb);
    border-color: rgba(59, 130, 246, .35);
}
#pgScanner .scanner-status-success {
    background: rgba(34, 197, 94, .14);
    color: var(--green, #16a34a);
    border-color: rgba(34, 197, 94, .35);
}
#pgScanner .scanner-status-error {
    background: rgba(239, 68, 68, .14);
    color: var(--red, #dc2626);
    border-color: rgba(239, 68, 68, .35);
}

#pgScanner .manual-scan-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
#pgScanner .manual-scan-input-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
#pgScanner .manual-scan-input-wrap .form-input {
    width: 100%;
    min-height: 44px;
    padding-right: 42px;
    font-size: 16px;
}
#pgScanner .manual-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(100, 116, 139, .16);
    color: var(--text-secondary, #475569);
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
#pgScanner .manual-clear-btn:focus-visible,
#pgScanner .recent-item:focus-visible,
#pgScanner .scan-variant-chip:focus-visible {
    outline: 3px solid rgba(59, 130, 246, .55);
    outline-offset: 2px;
}

#pgScanner .scan-result-text {
    width: 100%;
}
#pgScanner .scan-product-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-elevated, #f8fafc);
    text-align: left;
}
#pgScanner .scan-product-thumb {
    width: 92px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted, #94a3b8);
    font-size: 30px;
}
#pgScanner .scan-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#pgScanner .scan-product-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
#pgScanner .scan-product-title-row h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    line-height: 1.2;
}
#pgScanner .scan-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: var(--blue, #2563eb);
    background: rgba(59, 130, 246, .13);
    border: 1px solid rgba(59, 130, 246, .28);
}
#pgScanner .scan-badge-warning {
    color: #b45309;
    background: rgba(245, 158, 11, .15);
    border-color: rgba(245, 158, 11, .35);
}
#pgScanner .scan-badge-ok {
    color: var(--green, #16a34a);
    background: rgba(34, 197, 94, .15);
    border-color: rgba(34, 197, 94, .35);
}
#pgScanner .scan-product-meta,
#pgScanner .scan-product-attrs,
#pgScanner .scan-detected-code {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    margin-top: 4px;
}
#pgScanner .scan-stock-summary {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(34, 197, 94, .12);
    color: var(--text-primary);
    border: 1px solid rgba(34, 197, 94, .25);
}
#pgScanner .scan-stock-summary span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}
#pgScanner .scan-stock-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
#pgScanner .scan-stock-list span {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(100, 116, 139, .12);
    color: var(--text-secondary);
    font-size: 12px;
}
#pgScanner .scan-variant-warning {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(245, 158, 11, .14);
    color: var(--text-primary);
    border: 1px solid rgba(245, 158, 11, .28);
    font-size: 13px;
}
#pgScanner .scan-variant-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
#pgScanner .scan-variant-chip {
    min-height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(59, 130, 246, .35);
    background: rgba(59, 130, 246, .12);
    color: var(--blue, #2563eb);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 10px;
    cursor: pointer;
}

#pgScanner .scanner-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
#pgScanner .recent-scans {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#pgScanner .recent-item {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}
#pgScanner .recent-item:hover {
    border-color: rgba(59, 130, 246, .45);
}
#pgScanner .recent-notfound {
    border-color: rgba(239, 68, 68, .28);
}
#pgScanner .ri-thumb {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--bg-elevated, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--text-muted);
}
#pgScanner .ri-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#pgScanner .ri-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
#pgScanner .ri-main strong,
#pgScanner .ri-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#pgScanner .ri-main small,
#pgScanner .ri-time {
    color: var(--text-muted);
    font-size: 12px;
}

[data-theme="dark"] #pgScanner .scan-product-card,
.dark #pgScanner .scan-product-card,
body.dark #pgScanner .scan-product-card,
[data-theme="dark"] #pgScanner .recent-item,
.dark #pgScanner .recent-item,
body.dark #pgScanner .recent-item {
    background: #111827;
    border-color: rgba(148, 163, 184, .22);
}
[data-theme="dark"] #pgScanner .scan-product-thumb,
.dark #pgScanner .scan-product-thumb,
body.dark #pgScanner .scan-product-thumb,
[data-theme="dark"] #pgScanner .ri-thumb,
.dark #pgScanner .ri-thumb,
body.dark #pgScanner .ri-thumb {
    background: #0b1220;
    border-color: rgba(148, 163, 184, .18);
}
[data-theme="dark"] #pgScanner .manual-clear-btn,
.dark #pgScanner .manual-clear-btn,
body.dark #pgScanner .manual-clear-btn {
    background: rgba(148, 163, 184, .18);
    color: #dbeafe;
}

@media (max-width: 768px) {
    #pgScanner .scan-product-card {
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 12px;
    }
    #pgScanner .scan-product-thumb {
        width: 72px;
    }
    #pgScanner #scanResultActions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    #pgScanner #scanResultActions .btn {
        width: 100%;
    }
}
@media (max-width: 520px) {
    #pgScanner .manual-scan-row {
        flex-direction: column;
    }
    #pgScanner .scan-product-card {
        grid-template-columns: 1fr;
    }
    #pgScanner .scan-product-thumb {
        width: 96px;
    }
    #pgScanner #scanResultActions {
        grid-template-columns: 1fr;
    }
}


/* ================================================================
   v2.3.8 — Mouvements terrain / boîte d'envoi hors ligne
   ================================================================ */
#pgScanner .btn.is-loading {
    opacity: .74;
    pointer-events: none;
    cursor: wait;
}
#pgScanner #tsOfflineBox {
    font-weight: 700;
}
#pgScanner .terrain-hint {
    border: 1px solid rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .10);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 10px;
    font-size: 13px;
}
.offline-move-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(68vh, 620px);
    overflow: auto;
    padding-right: 4px;
}
.offline-move-row {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border, rgba(148, 163, 184, .25));
    border-radius: 14px;
    background: var(--bg-card, #fff);
    padding: 10px;
}
.offline-thumb {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--bg-elevated, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.offline-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.offline-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.offline-main strong,
.offline-main small,
.offline-main em {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.offline-main small,
.offline-main em {
    color: var(--text-muted);
    font-size: 12px;
}
.offline-error {
    margin-top: 4px;
    color: var(--red, #ef4444);
    font-size: 12px;
    font-weight: 700;
}
.offline-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.offline-empty {
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed var(--border, rgba(148, 163, 184, .25));
    border-radius: 14px;
}
[data-theme="dark"] .offline-move-row,
.dark .offline-move-row,
body.dark .offline-move-row {
    background: #111827;
    border-color: rgba(148, 163, 184, .22);
}
[data-theme="dark"] .offline-thumb,
.dark .offline-thumb,
body.dark .offline-thumb {
    background: #0b1220;
}
@media (max-width: 640px) {
    .offline-move-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }
    .offline-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }
    .offline-actions .btn {
        flex: 1;
        min-height: 42px;
    }
}


/* v2.3.9 — Fiche produit ouvrable depuis le résultat de scan */
.scan-product-card-action {
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.scan-product-card-action:hover {
  border-color: var(--blue, #3b82f6);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .16);
}
.scan-product-card-action:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .55);
  outline-offset: 3px;
}
.scan-product-card-action:active {
  transform: translateY(1px);
}
.scan-product-card-action .scan-product-thumb {
  position: relative;
}
.scan-product-card-action .scan-product-thumb::after {
  content: "Ouvrir";
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .78);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.scan-product-card-action:hover .scan-product-thumb::after,
.scan-product-card-action:focus-visible .scan-product-thumb::after {
  opacity: 1;
}
@media (hover: none), (max-width: 768px) {
  .scan-product-card-action .scan-product-thumb::after {
    opacity: 1;
    font-size: 9px;
  }
}

/* v2.3.10 — Scans récents : accès direct à la fiche produit */
#pgScanner .recent-product-link {
    border-color: rgba(59, 130, 246, .28);
}
#pgScanner .recent-product-link:hover {
    background: color-mix(in srgb, var(--bg-card, #fff) 86%, #3b82f6 14%);
}
#pgScanner .ri-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, .12);
    color: var(--blue, #2563eb);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
[data-theme="dark"] #pgScanner .recent-product-link:hover,
.dark #pgScanner .recent-product-link:hover,
body.dark #pgScanner .recent-product-link:hover {
    background: rgba(37, 99, 235, .18);
}
[data-theme="dark"] #pgScanner .ri-action,
.dark #pgScanner .ri-action,
body.dark #pgScanner .ri-action {
    background: rgba(96, 165, 250, .18);
    color: #bfdbfe;
}
@media (max-width: 520px) {
    #pgScanner .recent-item {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }
    #pgScanner .ri-time {
        display: none;
    }
    #pgScanner .ri-action {
        min-width: 48px;
    }
}


/* ================================================================
   MageStock v2.6.89 — SCANNER MOBILE EXPERIENCE2
   Expérience camera-first, résultat en volet et outils secondaires.
   ================================================================ */
#pgScanner,
#pgScanner * {
    box-sizing: border-box;
}

#pgScanner.scanner-page {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding-bottom: 16px;
}

#pgScanner .scanner-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

#pgScanner .scanner-page-heading {
    min-width: 0;
}

#pgScanner .scanner-eyebrow {
    margin: 0 0 5px;
    color: var(--blue, #2563eb);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#pgScanner .scanner-page-heading h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(24px, 2.3vw, 34px);
    line-height: 1.08;
}

#pgScanner .scanner-page-heading > p:last-child,
#pgScanner .scanner-secondary-copy {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

#pgScanner .scanner-page-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

#pgScanner .scanner-page-header-actions .btn,
#pgScanner .scanner-utility-actions .btn {
    min-height: 44px;
}

#pgScanner svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#pgScanner .scanner-workspace {
    display: block;
}

#pgScanner .scanner-camera-column,
#pgScanner .scanner-side-column {
    min-width: 0;
}

#pgScanner .scanner-side-column {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

#pgScanner .scanner-stage,
#pgScanner .scanner-result-card {
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
}

#pgScanner .scanner-stage {
    padding: 16px;
}

#pgScanner .scanner-preview {
    width: 100%;
    max-height: min(68vh, 620px);
    min-height: 360px;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, .28);
    background: #05070b;
}

#pgScanner .scanner-placeholder {
    gap: 8px;
    padding: 24px;
    text-align: center;
    background:
      linear-gradient(135deg, rgba(37, 99, 235, .12), transparent 54%),
      var(--bg-elevated, #f8fafc);
}

#pgScanner .scanner-placeholder svg {
    width: 62px;
    height: 62px;
    opacity: .62;
}

#pgScanner .scanner-placeholder strong {
    color: var(--text-primary);
    font-size: 18px;
}

#pgScanner .scanner-placeholder span {
    max-width: 320px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.4;
}

#pgScanner .scanner-camera-guidance {
    position: absolute;
    z-index: 7;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    max-width: calc(100% - 28px);
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(5, 7, 11, .7);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    backdrop-filter: blur(8px);
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
}

#pgScanner .scanner-preview[data-scan-mode]:not([data-scan-mode=""]) .scanner-camera-guidance {
    opacity: 1;
}

#pgScanner .scanner-status {
    width: 100%;
    margin: 10px 0 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-align: center;
}

#pgScanner .scanner-primary-actions {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

#pgScanner .scanner-camera-primary {
    width: min(100%, 420px);
    min-height: 52px;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
}

#pgScanner .scanner-camera-primary svg,
#pgScanner .scanner-page-header-actions svg,
#pgScanner .scanner-utility-actions svg {
    width: 20px;
    height: 20px;
}

#pgScanner .scanner-utility-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

#pgScanner .scanner-result-card {
    margin-top: 14px;
    padding: 16px;
}

#pgScanner .scan-result-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

#pgScanner .scan-result-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(34, 197, 94, .3);
    background: rgba(34, 197, 94, .12);
    color: var(--green, #16a34a);
}

#pgScanner .scan-result-icon svg {
    width: 25px;
    height: 25px;
}

#pgScanner .is-notfound .scan-result-icon,
#pgScanner .is-error .scan-result-icon {
    border-color: rgba(239, 68, 68, .32);
    background: rgba(239, 68, 68, .12);
    color: var(--red, #dc2626);
}

#pgScanner .scan-result-kicker {
    margin: 0 0 2px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

#pgScanner .scan-result-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 21px;
    line-height: 1.18;
}

#pgScanner .scan-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

#pgScanner .scan-result-actions .btn {
    width: 100%;
    min-height: 46px;
    justify-content: center;
}

#pgScanner .scan-product-card {
    margin-top: 14px;
    border-radius: 10px;
}

#pgScanner .scan-stock-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#pgScanner .scan-stock-list span {
    min-width: 0;
    justify-content: space-between;
    border-radius: 8px;
}

#pgScanner .terrain-panel {
    margin-top: 16px;
    border-radius: 10px;
}

#pgScanner .terrain-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

#pgScanner .terrain-panel-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
}

#pgScanner .terrain-panel-note {
    max-width: 300px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    text-align: right;
}

#pgScanner .terrain-col-qty {
    flex-basis: 240px;
}

#pgScanner .terrain-stock-info {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.45;
}

#pgScanner .terrain-stock-info--ok {
    border-color: rgba(34, 197, 94, .3);
    background: rgba(34, 197, 94, .09);
}

#pgScanner .terrain-stock-info--low {
    border-color: rgba(245, 158, 11, .35);
    background: rgba(245, 158, 11, .1);
}

#pgScanner .terrain-stock-info--empty {
    border-color: rgba(239, 68, 68, .32);
    background: rgba(239, 68, 68, .08);
}

#pgScanner .scanner-manual-card .card-body,
#pgScanner .scanner-recent-card .card-body {
    padding: 14px;
}

#pgScanner .scanner-manual-card .manual-scan-row {
    margin-top: 12px;
    flex-direction: column;
}

#pgScanner .scanner-manual-card .btn {
    width: 100%;
}

#pgScanner .scanner-recent-card .card-header {
    align-items: flex-start;
}

#pgScanner .scanner-recent-card .recent-scans {
    max-height: min(62vh, 650px);
    overflow: auto;
}

#pgScanner .recent-item {
    border-radius: 9px;
}

#pgScanner .scanner-mobile-toolbar,
#pgScanner .scanner-touch-only {
    display: none;
}

/* Contenu des volets tactiles */
.scanner-panel-intro {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.scanner-option-list {
    display: grid;
    gap: 8px;
}

.scanner-option-button {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.scanner-option-button svg {
    width: 23px;
    height: 23px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.scanner-option-button span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scanner-option-button small {
    color: var(--text-muted);
    font-size: 12px;
}

.scanner-manual-panel {
    display: grid;
    gap: 12px;
}

.scanner-manual-panel input {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
}

.scanner-panel-recent-list {
    display: grid;
    gap: 8px;
}

.scanner-panel-empty {
    padding: 18px;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    text-align: center;
}

/* Le mode terrain masque toujours le chrome mais conserve les safe areas. */
body.sm-terrain-mode #pgScanner.scanner-page {
    max-width: 1120px;
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
}

@media (min-width: 1200px) {
    #pgScanner .scanner-page-header {
        display: none;
    }
}

@media (max-width: 1199px) {
    #pgScanner.scanner-page {
        padding-bottom: calc(86px + env(safe-area-inset-bottom));
    }

    #pgScanner .scanner-desktop-tools {
        display: none !important;
    }

    #pgScanner .scanner-touch-only {
        display: inline-flex;
    }

    #pgScanner .scanner-workspace {
        display: block;
    }

    #pgScanner .scanner-stage {
        padding: 0;
        border: 0;
        background: transparent;
    }

    #pgScanner .scanner-preview {
        min-height: 0;
        max-height: none;
        aspect-ratio: 4 / 3;
        border-radius: 12px;
    }

    #pgScanner .scanner-result-card {
        margin-top: 12px;
    }

    #pgScanner .scanner-primary-actions {
        margin-top: 10px;
    }

    #pgScanner .scanner-mobile-toolbar {
        position: fixed;
        z-index: 36;
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
        bottom: calc(var(--mobile-bottom-nav-height, 64px) + 10px + env(safe-area-inset-bottom));
        min-height: 58px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
        align-items: center;
        gap: 6px;
        padding: 5px;
        border: 1px solid var(--border);
        background: color-mix(in srgb, var(--bg-card, #fff) 94%, transparent);
        box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
        backdrop-filter: blur(16px);
    }

    #pgScanner .scanner-mobile-toolbar-group {
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 2px;
    }

    #pgScanner .scanner-mobile-toolbar button {
        position: relative;
        min-width: 0;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        border: 0;
        background: transparent;
        color: var(--text-secondary);
        font: inherit;
        font-size: 13px;
        font-weight: 800;
        cursor: pointer;
    }

    #pgScanner .scanner-mobile-toolbar-group button {
        width: 100%;
        max-width: none;
        padding-inline: 4px;
    }

    #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle {
        width: 64px;
        min-width: 64px;
        height: 64px;
        min-height: 64px;
        justify-self: center;
        align-self: center;
        flex-direction: column;
        gap: 2px;
        margin-top: -18px;
        border-radius: 50%;
        background: var(--blue, #2563eb);
        color: #fff;
        border: 5px solid var(--bg-card, #fff);
        box-shadow: 0 10px 24px rgba(37, 99, 235, .28);
    }

    #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle.is-active {
        background: var(--red, #dc2626);
        box-shadow: 0 10px 24px rgba(220, 38, 38, .26);
    }

    #pgScanner .scanner-mobile-toolbar button:focus-visible {
        outline: 3px solid rgba(59, 130, 246, .5);
        outline-offset: -2px;
    }

    #pgScanner .scanner-mobile-toolbar svg {
        width: 20px;
        height: 20px;
    }

    #pgScanner .scanner-mobile-toolbar .scanner-toolbar-badge {
        position: absolute;
        top: 1px;
        right: 3px;
        min-width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 5px;
        border-radius: 999px;
        color: #fff;
        font-size: 11px;
        line-height: 1;
    }

    #pgScanner .scanner-toolbar-badge--history {
        background: var(--blue, #2563eb);
    }

    #pgScanner .scanner-toolbar-badge--queue {
        background: var(--red, #dc2626);
    }

    #pgScanner .scan-result-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #pgScanner .terrain-panel {
        padding: 12px;
    }

    #pgScanner .terrain-actions .btn {
        max-width: none;
    }
}

@media (max-width: 599px) {
    #pgScanner .scanner-page-header {
        margin-bottom: 12px;
    }

    #pgScanner .scanner-page-heading > p:last-child {
        display: none;
    }

    #pgScanner .scanner-page-header-actions .btn {
        width: 46px;
        min-width: 46px;
        padding: 0;
        justify-content: center;
    }

    #pgScanner .scanner-page-header-actions .btn span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    #pgScanner .scanner-preview {
        width: 100%;
        height: clamp(290px, 46dvh, 430px);
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
    }

    #pgScanner .scanner-camera-primary {
        min-height: 54px;
    }

    #pgScanner .scanner-status {
        font-size: 12px;
    }

    #pgScanner .scan-product-card {
        display: block;
        padding: 12px;
    }

    #pgScanner .scan-product-thumb {
        width: 86px;
    }

    #pgScanner .scan-stock-list {
        grid-template-columns: 1fr;
    }

    #pgScanner .scan-result-actions {
        grid-template-columns: 1fr 1fr;
    }

    #pgScanner .terrain-panel-heading {
        display: block;
    }

    #pgScanner .terrain-panel-note {
        display: block;
        max-width: none;
        margin-top: 6px;
        text-align: left;
    }

    #pgScanner .terrain-col {
        flex-basis: 100%;
    }

    #pgScanner .terrain-qty {
        display: grid;
        grid-template-columns: 48px minmax(72px, 1fr) 48px 48px;
    }

    #pgScanner .terrain-qty .btn {
        min-width: 48px;
        padding: 0 6px;
    }

    #pgScanner .terrain-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    #pgScanner .terrain-actions .btn {
        min-width: 0;
    }
}

@media (max-width: 359px) {
    #pgScanner .scanner-preview {
        min-height: 330px;
    }

    #pgScanner .scan-result-actions,
    #pgScanner .terrain-actions {
        grid-template-columns: 1fr;
    }

    #pgScanner .scanner-mobile-toolbar button span {
        display: none;
    }
}

@media (min-width: 600px) and (max-width: 1199px) {
    #pgScanner.scanner-page {
        max-width: 980px;
    }

    #pgScanner .scanner-preview {
        aspect-ratio: 16 / 10;
        min-height: 440px;
    }

    #pgScanner .scanner-mobile-toolbar {
        left: 50%;
        right: auto;
        width: min(620px, calc(100% - 24px));
        transform: translateX(-50%);
    }
}

@media (orientation: landscape) and (max-height: 600px) and (max-width: 1199px) {
    #pgScanner .scanner-page-header {
        display: none;
    }

    #pgScanner .scanner-preview {
        min-height: 0;
        height: calc(100dvh - 174px);
        max-height: none;
        aspect-ratio: auto;
    }

    #pgScanner .scanner-status {
        min-height: 34px;
        padding: 4px 8px;
    }

    #pgScanner .scanner-camera-primary {
        min-height: 44px;
    }
}

[data-theme="dark"] #pgScanner .scanner-stage,
[data-theme="dark"] #pgScanner .scanner-result-card,
[data-theme="dark"] #pgScanner .scanner-option-button,
.dark #pgScanner .scanner-stage,
.dark #pgScanner .scanner-result-card,
.dark #pgScanner .scanner-option-button,
body.dark #pgScanner .scanner-stage,
body.dark #pgScanner .scanner-result-card,
body.dark #pgScanner .scanner-option-button {
    background: #0f172a;
    border-color: rgba(148, 163, 184, .22);
}

[data-theme="dark"] #pgScanner .scanner-mobile-toolbar,
.dark #pgScanner .scanner-mobile-toolbar,
body.dark #pgScanner .scanner-mobile-toolbar {
    background: rgba(15, 23, 42, .94);
    border-color: rgba(148, 163, 184, .24);
}

@media (prefers-reduced-motion: reduce) {
    #pgScanner .scanner-camera-guidance,
    #pgScanner .scan-product-card-action {
        transition: none !important;
    }
}

/* Résultats particuliers de la résolution commune */
#pgScanner .scanner-choice-list,
#pgScanner .scanner-notfound-code {
    margin-top: 14px;
}

#pgScanner .scanner-choice-list > p,
#pgScanner .scanner-notfound-code > p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

#pgScanner .scanner-choice-product {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

#pgScanner .scanner-choice-product span {
    color: var(--text-muted);
    font-size: 12px;
}

#pgScanner .scanner-notfound-code {
    display: grid;
    gap: 7px;
    padding: 14px;
    border: 1px solid rgba(239, 68, 68, .28);
    background: rgba(239, 68, 68, .07);
}

#pgScanner .scanner-notfound-code > span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}

#pgScanner .scanner-notfound-code code {
    overflow-wrap: anywhere;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 800;
}

#pgScanner .scanner-action-wide {
    grid-column: 1 / -1;
}

#pgScanner .scan-stock-list > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
}

#pgScanner .scan-stock-list > span > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

#pgScanner .scan-stock-list b,
#pgScanner .scan-stock-list small {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#pgScanner .scan-stock-list small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}

#pgScanner .scan-stock-list-empty {
    grid-template-columns: 1fr;
}

.scanner-result-sheet .scanner-result-card {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.scanner-result-sheet .ms-panel__body {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
}

[data-theme="dark"] #pgScanner .scanner-choice-product,
.dark #pgScanner .scanner-choice-product,
body.dark #pgScanner .scanner-choice-product {
    background: #111827;
    border-color: rgba(148, 163, 184, .22);
}


/* v2.6.91 — Résultat scanner structuré et commande caméra centrale */
#pgScanner .scan-product-card {
    display: block;
    margin-top: 0;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-elevated, #f8fafc);
    text-align: left;
}
#pgScanner .scan-product-hero {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
#pgScanner .scan-product-thumb {
    width: 104px;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
}
#pgScanner .scan-product-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}
#pgScanner .scan-product-name {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    line-height: 1.2;
}
#pgScanner .scan-product-open {
    margin-top: 12px;
    min-height: 44px;
}
#pgScanner .scan-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}
#pgScanner .scan-kpi-card {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card, #fff);
    display: grid;
    gap: 4px;
}
#pgScanner .scan-kpi-card span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
#pgScanner .scan-kpi-card strong {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
#pgScanner .scan-info-section {
    margin-top: 14px;
}
#pgScanner .scan-section-title {
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
#pgScanner .scan-result-actions {
    gap: 8px;
}
#pgScanner .scan-result-actions .btn {
    min-height: 48px;
}
@media (max-width: 1199px) {
    #pgScanner .scanner-primary-actions {
        display: none;
    }
    .scanner-result-sheet .scan-result-heading {
        display: none;
    }
    .scanner-result-sheet #terrainPanel {
        display: none !important;
    }
    #pgScanner .scanner-mobile-toolbar {
        overflow: visible;
    }
}
@media (max-width: 599px) {
    #pgScanner .scan-product-hero {
        grid-template-columns: 86px minmax(0, 1fr);
        gap: 12px;
    }
    #pgScanner .scan-product-thumb {
        width: 86px;
    }
    #pgScanner .scan-product-name {
        font-size: 18px;
    }
    #pgScanner .scan-kpi-grid {
        grid-template-columns: 1fr;
    }
    #pgScanner .scanner-mobile-toolbar-group button {
        max-width: 66px;
        padding-inline: 4px;
        font-size: 11px;
    }
    #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle {
        width: 62px;
        min-width: 62px;
        height: 62px;
        min-height: 62px;
    }
}
@media (max-height: 520px) and (orientation: landscape) and (max-width: 1199px) {
    #pgScanner .scanner-preview {
        height: clamp(190px, 54dvh, 290px);
    }
}
[data-theme="dark"] #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle,
.dark #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle,
body.dark #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle {
    border-color: var(--bg-card, #111827);
}


/* v2.6.92 — polish premium scanner */
#pgScanner .scanner-mobile-toolbar{border-radius:18px;padding:7px 8px;background:color-mix(in srgb,var(--bg-card,#fff) 96%,transparent);box-shadow:0 16px 38px rgba(15,23,42,.20)}
#pgScanner .scanner-mobile-toolbar::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.7)}
#pgScanner .scanner-mobile-toolbar-group button{border-radius:12px;transition:background .16s ease,color .16s ease,transform .16s ease}
#pgScanner .scanner-mobile-toolbar-group button:active{transform:scale(.97)}
#pgScanner .scanner-mobile-toolbar-group button:hover{background:rgba(37,99,235,.07);color:var(--blue,#2563eb)}
#pgScanner .scanner-mobile-toolbar .scanner-camera-toggle{width:68px;min-width:68px;height:68px;min-height:68px;border-width:6px;box-shadow:0 14px 30px rgba(37,99,235,.34)}
#pgScanner .scanner-mobile-toolbar .scanner-camera-toggle svg{width:24px;height:24px}
#pgScanner .scanner-mobile-toolbar .scanner-camera-toggle span{font-size:11px}
#pgScanner .scan-product-card{padding:16px;border-radius:18px;background:var(--bg-card,#fff);box-shadow:0 8px 24px rgba(15,23,42,.08)}
#pgScanner .scan-product-hero{grid-template-columns:96px minmax(0,1fr);gap:14px;align-items:center}
#pgScanner .scan-product-thumb{width:96px;border-radius:16px;background:var(--bg-elevated,#f8fafc)}
#pgScanner .scan-product-name{font-size:21px}
#pgScanner .scan-product-meta{margin-top:6px;line-height:1.45}
#pgScanner .scan-product-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}
#pgScanner .scan-product-facts>div{min-width:0;padding:12px 14px;border:1px solid var(--border);border-radius:14px;background:var(--bg-elevated,#f8fafc);display:grid;gap:4px}
#pgScanner .scan-product-facts span,#pgScanner .scan-code-row span{color:var(--text-muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
#pgScanner .scan-product-facts strong{color:var(--text-primary);font-size:16px;line-height:1.3;overflow-wrap:anywhere}
#pgScanner .scan-code-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:10px;padding:11px 14px;border:1px solid var(--border);border-radius:14px;background:var(--bg-elevated,#f8fafc)}
#pgScanner .scan-code-row code{min-width:0;color:var(--text-primary);font-size:14px;font-weight:800;overflow-wrap:anywhere;text-align:right}
#pgScanner .scan-stock-disclosure{margin-top:12px;border:1px solid var(--border);border-radius:14px;background:var(--bg-elevated,#f8fafc);overflow:hidden}
#pgScanner .scan-stock-disclosure summary{min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;cursor:pointer;color:var(--text-primary);font-weight:800;list-style:none}
#pgScanner .scan-stock-disclosure summary::-webkit-details-marker{display:none}
#pgScanner .scan-stock-disclosure summary strong{display:inline-flex;align-items:center;justify-content:center;min-width:26px;height:26px;border-radius:999px;background:rgba(37,99,235,.11);color:var(--blue,#2563eb);font-size:12px}
#pgScanner .scan-stock-disclosure .scan-stock-list,#pgScanner .scan-stock-disclosure .scan-variant-warning,#pgScanner .scan-stock-disclosure .scan-variant-list{margin:0 12px 12px}
#pgScanner .scan-stock-empty{margin-top:12px;padding:13px 14px;border:1px dashed var(--border);border-radius:14px;display:grid;gap:4px;color:var(--text-primary)}
#pgScanner .scan-stock-empty span{color:var(--text-muted);font-size:13px}
#pgScanner .scan-result-actions{position:sticky;bottom:0;z-index:3;margin:14px -2px -2px;padding:12px 2px 2px;background:linear-gradient(to top,var(--bg-card,#fff) 75%,transparent);grid-template-columns:repeat(2,minmax(0,1fr))}
#pgScanner .scan-result-actions .scanner-action-rescan{order:-1;grid-column:1/-1;min-height:52px;font-size:16px}
#pgScanner .scan-result-actions #btnScanAdd,#pgScanner .scan-result-actions #btnScanRemove{font-weight:800}
@media(max-width:599px){#pgScanner .scan-product-card{padding:14px}#pgScanner .scan-product-hero{grid-template-columns:82px minmax(0,1fr);gap:12px}#pgScanner .scan-product-thumb{width:82px}#pgScanner .scan-product-name{font-size:18px}#pgScanner .scan-product-facts{grid-template-columns:1fr}#pgScanner .scan-code-row{align-items:flex-start;flex-direction:column}#pgScanner .scan-code-row code{text-align:left}#pgScanner .scanner-mobile-toolbar-group button{font-size:10px;gap:3px}#pgScanner .scanner-mobile-toolbar-group button span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(prefers-reduced-motion:reduce){#pgScanner .scanner-mobile-toolbar-group button{transition:none}}
[data-theme="dark"] #pgScanner .scanner-mobile-toolbar::before{box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
[data-theme="dark"] #pgScanner .scan-product-card{background:#0f172a;box-shadow:none}


/* v2.6.93 — Historique et Attente séparés */
#pgScanner #btnScannerHistory.has-items {
    color: var(--blue, #2563eb);
}
#pgScanner #btnScannerQueue.has-items {
    color: var(--red, #dc2626);
}
#pgScanner #btnScannerHistory svg,
#pgScanner #btnScannerQueue svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@media (max-width: 420px) {
    #pgScanner .scanner-mobile-toolbar {
        left: max(6px, env(safe-area-inset-left));
        right: max(6px, env(safe-area-inset-right));
        gap: 3px;
        padding-inline: 5px;
    }
    #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle {
        width: 64px;
        min-width: 64px;
        height: 64px;
        min-height: 64px;
    }
}

/* v2.6.94 — durcissement final téléphone étroit */
@media (max-width: 360px) {
    #pgScanner .scanner-mobile-toolbar {
        left: max(4px, env(safe-area-inset-left));
        right: max(4px, env(safe-area-inset-right));
        grid-template-columns: minmax(0, 1fr) 60px minmax(0, 1fr);
        gap: 2px;
        padding: 5px 4px;
    }
    #pgScanner .scanner-mobile-toolbar-group { gap: 1px; }
    #pgScanner .scanner-mobile-toolbar-group button {
        padding-inline: 2px;
        font-size: 9px;
        line-height: 1.05;
    }
    #pgScanner .scanner-mobile-toolbar-group button span {
        overflow: visible;
        text-overflow: clip;
    }
    #pgScanner .scanner-mobile-toolbar .scanner-camera-toggle {
        width: 58px;
        min-width: 58px;
        height: 58px;
        min-height: 58px;
        border-width: 4px;
    }
    #pgScanner .scanner-mobile-toolbar .scanner-toolbar-badge {
        top: 0;
        right: 0;
        min-width: 18px;
        height: 18px;
        font-size: 10px;
    }
}


/* v2.6.95 — fiche résultat premium et stable */
.scanner-result-sheet.ms-panel {
    max-height: min(88dvh, 820px);
}
.scanner-result-sheet .ms-panel__header {
    padding-bottom: 8px;
}
.scanner-result-sheet .ms-panel__description {
    display: none;
}
.scanner-result-sheet .ms-panel__body {
    padding: 0 14px max(14px, env(safe-area-inset-bottom));
}
.scanner-result-sheet .scanner-result-card {
    min-width: 0;
}
.scanner-result-sheet .scan-result-actions {
    position: sticky;
    z-index: 3;
    bottom: calc(-1 * max(14px, env(safe-area-inset-bottom)));
    margin: 16px -14px 0;
    padding: 12px 14px max(14px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-card, #fff) 96%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: 0 -12px 28px rgba(15, 23, 42, .08);
}
#pgScanner .scan-product-sheet {
    display: grid;
    gap: 14px;
    color: var(--text-primary);
}
#pgScanner .scan-product-sheet__hero {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--green, #16a34a) 28%, var(--border));
    border-left: 4px solid var(--green, #16a34a);
    background: color-mix(in srgb, var(--green, #16a34a) 6%, var(--bg-card, #fff));
}
#pgScanner .scan-product-sheet__thumb {
    width: 82px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
}
#pgScanner .scan-product-sheet__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#pgScanner .scan-product-sheet__thumb svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 1.7;
}
#pgScanner .scan-product-sheet__identity {
    min-width: 0;
}
#pgScanner .scan-product-sheet__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
#pgScanner .scan-product-sheet__found,
#pgScanner .scan-product-sheet__alert {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid rgba(22, 163, 74, .28);
    background: rgba(22, 163, 74, .10);
    color: var(--green, #15803d);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}
#pgScanner .scan-product-sheet__alert {
    border-color: rgba(217, 119, 6, .32);
    background: rgba(245, 158, 11, .12);
    color: #b45309;
}
#pgScanner .scan-product-sheet__identity h3 {
    margin: 0;
    font-size: clamp(19px, 4.8vw, 24px);
    line-height: 1.18;
    overflow-wrap: anywhere;
}
#pgScanner .scan-product-sheet__identity p {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}
#pgScanner .scan-product-sheet__attrs {
    color: var(--text-secondary) !important;
}
#pgScanner .scan-product-sheet__summary {
    display: grid;
    grid-template-columns: minmax(118px, .72fr) minmax(0, 1.28fr);
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
}
#pgScanner .scan-product-sheet__stock,
#pgScanner .scan-product-sheet__location {
    min-width: 0;
    padding: 14px;
}
#pgScanner .scan-product-sheet__stock {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    column-gap: 6px;
    border-right: 1px solid var(--border);
}
#pgScanner .scan-product-sheet__stock > span {
    grid-column: 1 / -1;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
#pgScanner .scan-product-sheet__stock strong {
    margin-top: 3px;
    font-size: 28px;
    line-height: 1;
}
#pgScanner .scan-product-sheet__stock small {
    padding-bottom: 2px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}
#pgScanner .scan-product-sheet__location {
    display: flex;
    align-items: center;
    gap: 10px;
}
#pgScanner .scan-product-sheet__summary-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    background: rgba(37, 99, 235, .09);
    color: var(--blue, #2563eb);
}
#pgScanner .scan-product-sheet__summary-icon svg,
#pgScanner .scan-product-sheet__warehouse-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
#pgScanner .scan-product-sheet__location > span:last-child {
    min-width: 0;
    display: grid;
    gap: 3px;
}
#pgScanner .scan-product-sheet__location small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
#pgScanner .scan-product-sheet__location strong {
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.3;
}
#pgScanner .scan-product-sheet__details {
    border: 1px solid var(--border);
    background: var(--bg-card, #fff);
}
#pgScanner .scan-product-sheet__details summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 800;
}
#pgScanner .scan-product-sheet__details summary strong {
    color: var(--text-muted);
    font-size: 12px;
}
#pgScanner .scan-product-sheet__details[open] summary {
    border-bottom: 1px solid var(--border);
}
#pgScanner .scan-product-sheet__warehouses {
    display: grid;
}
#pgScanner .scan-product-sheet__warehouse {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
}
#pgScanner .scan-product-sheet__warehouse:last-child {
    border-bottom: 0;
}
#pgScanner .scan-product-sheet__warehouse-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--bg-elevated, #f8fafc);
    color: var(--text-secondary);
}
#pgScanner .scan-product-sheet__warehouse-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
#pgScanner .scan-product-sheet__warehouse-copy b,
#pgScanner .scan-product-sheet__warehouse-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#pgScanner .scan-product-sheet__warehouse-copy small {
    color: var(--text-muted);
    font-size: 11px;
}
#pgScanner .scan-product-sheet__warehouse > strong {
    white-space: nowrap;
    font-size: 15px;
}
#pgScanner .scan-product-sheet__warehouse > strong small {
    color: var(--text-muted);
    font-size: 11px;
}
#pgScanner .scan-product-sheet__variants p {
    margin: 12px 12px 0;
    color: var(--text-muted);
    font-size: 13px;
}
#pgScanner .scan-product-sheet__variants .scan-variant-list {
    padding: 12px;
}
#pgScanner .scan-product-sheet__empty {
    display: grid;
    gap: 3px;
    padding: 13px 14px;
    border: 1px dashed var(--border);
    color: var(--text-muted);
}
#pgScanner .scan-product-sheet__empty strong {
    color: var(--text-primary);
}
#pgScanner .scan-product-sheet__code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: var(--bg-elevated, #f8fafc);
    color: var(--text-muted);
    font-size: 12px;
}
#pgScanner .scan-product-sheet__code code {
    min-width: 0;
    color: var(--text-primary);
    font-weight: 800;
    overflow-wrap: anywhere;
    text-align: right;
}
@media (max-width: 560px) {
    #pgScanner .scan-product-sheet__hero {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 11px;
        padding: 12px;
    }
    #pgScanner .scan-product-sheet__thumb {
        width: 68px;
    }
    #pgScanner .scan-product-sheet__summary {
        grid-template-columns: 1fr;
    }
    #pgScanner .scan-product-sheet__stock {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    #pgScanner .scan-product-sheet__warehouse {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        padding-inline: 10px;
    }
}
[data-theme="dark"] #pgScanner .scan-product-sheet__hero,
.dark #pgScanner .scan-product-sheet__hero,
body.dark #pgScanner .scan-product-sheet__hero {
    background: rgba(22, 163, 74, .08);
}


/* ─────────────────────────────────────────────────────────────
   MageStock v2.6.96 — SCANNER RESULT FLOW FIX4
   Fiche compacte et surface résultat isolée pour les scans successifs.
   ───────────────────────────────────────────────────────────── */
.scanner-result-sheet--isolated .scanner-result-card--panel {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
.scanner-result-sheet--isolated .scan-result-heading,
.scanner-result-sheet--isolated .terrain-panel {
    display: none !important;
}
.scanner-result-sheet--isolated .scan-result-text {
    margin: 0;
}
#pgScanner .scan-product-sheet {
    gap: 10px;
}
#pgScanner .scan-product-sheet__hero {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--green, #16a34a);
    border-radius: 12px;
    background: var(--bg-card, #fff);
}
#pgScanner .scan-product-sheet__thumb {
    width: 56px;
    border-radius: 10px;
    background: var(--bg-elevated, #f8fafc);
}
#pgScanner .scan-product-sheet__thumb svg {
    width: 24px;
    height: 24px;
}
#pgScanner .scan-product-sheet__badges {
    margin-bottom: 4px;
}
#pgScanner .scan-product-sheet__found,
#pgScanner .scan-product-sheet__alert,
#pgScanner .scan-product-sheet__badges .scan-badge {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 9px;
    border-radius: 999px;
}
#pgScanner .scan-product-sheet__identity h3 {
    font-size: clamp(17px, 4.3vw, 20px);
    line-height: 1.18;
}
#pgScanner .scan-product-sheet__identity p {
    margin-top: 4px;
    font-size: 12px;
}
#pgScanner .scan-product-sheet__summary {
    grid-template-columns: minmax(108px, .72fr) minmax(0, 1.28fr);
    border-radius: 12px;
    overflow: hidden;
}
#pgScanner .scan-product-sheet__stock,
#pgScanner .scan-product-sheet__location {
    padding: 11px 12px;
}
#pgScanner .scan-product-sheet__stock strong {
    font-size: 24px;
}
#pgScanner .scan-product-sheet__summary-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 8px;
}
#pgScanner .scan-product-sheet__summary-icon svg {
    width: 17px;
    height: 17px;
}
#pgScanner .scan-product-sheet__details,
#pgScanner .scan-product-sheet__empty,
#pgScanner .scan-product-sheet__code {
    border-radius: 12px;
    overflow: hidden;
}
#pgScanner .scan-product-sheet__details summary {
    min-height: 44px;
    padding: 8px 11px;
}
.scanner-result-sheet--isolated .scan-result-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 12px -14px -14px;
    padding: 10px 14px max(10px, env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg-card, #fff) 96%, transparent);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(14px);
}
@media (max-width: 560px) {
    #pgScanner .scan-product-sheet__hero {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 10px;
    }
    #pgScanner .scan-product-sheet__thumb {
        width: 48px;
    }
    #pgScanner .scan-product-sheet__thumb svg {
        width: 21px;
        height: 21px;
    }
    #pgScanner .scan-product-sheet__summary {
        grid-template-columns: 1fr 1.45fr;
    }
    #pgScanner .scan-product-sheet__stock,
    #pgScanner .scan-product-sheet__location {
        padding: 10px;
    }
}
[data-theme="dark"] #pgScanner .scan-product-sheet__hero,
.dark #pgScanner .scan-product-sheet__hero,
body.dark #pgScanner .scan-product-sheet__hero {
    background: #0f172a;
}


/* La fiche mobile vit hors de #pgScanner dans le volet ActionSheet. */
.scanner-result-sheet--isolated .scan-product-sheet {
    display: grid;
    gap: 10px;
    color: var(--text-primary);
}
.scanner-result-sheet--isolated .scan-product-sheet__hero {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--green, #16a34a);
    border-radius: 12px;
    background: var(--bg-card, #fff);
}
.scanner-result-sheet--isolated .scan-product-sheet__thumb {
    width: 56px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-elevated, #f8fafc);
}
.scanner-result-sheet--isolated .scan-product-sheet__thumb img {
    width: 100%; height: 100%; object-fit: contain;
}
.scanner-result-sheet--isolated .scan-product-sheet__thumb svg {
    width: 24px; height: 24px; fill: none; stroke: var(--text-muted); stroke-width: 1.7;
}
.scanner-result-sheet--isolated .scan-product-sheet__identity { min-width: 0; }
.scanner-result-sheet--isolated .scan-product-sheet__badges { display:flex; flex-wrap:wrap; gap:5px; margin-bottom:4px; }
.scanner-result-sheet--isolated .scan-product-sheet__found,
.scanner-result-sheet--isolated .scan-product-sheet__alert,
.scanner-result-sheet--isolated .scan-product-sheet__badges .scan-badge {
    display:inline-flex; align-items:center; gap:4px; min-height:20px; padding:2px 6px;
    border-radius:999px; font-size:9px; font-weight:800; text-transform:uppercase; letter-spacing:.03em;
}
.scanner-result-sheet--isolated .scan-product-sheet__found {
    border:1px solid rgba(22,163,74,.28); background:rgba(22,163,74,.1); color:var(--green,#15803d);
}
.scanner-result-sheet--isolated .scan-product-sheet__alert {
    border:1px solid rgba(217,119,6,.32); background:rgba(245,158,11,.12); color:#b45309;
}
.scanner-result-sheet--isolated .scan-product-sheet__identity h3 {
    margin:0; font-size:clamp(17px,4.3vw,20px); line-height:1.18; overflow-wrap:anywhere;
}
.scanner-result-sheet--isolated .scan-product-sheet__identity p {
    display:flex; flex-wrap:wrap; gap:5px; margin:4px 0 0; color:var(--text-muted); font-size:12px; line-height:1.35;
}
.scanner-result-sheet--isolated .scan-product-sheet__summary {
    display:grid; grid-template-columns:minmax(108px,.72fr) minmax(0,1.28fr);
    border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--bg-card,#fff);
}
.scanner-result-sheet--isolated .scan-product-sheet__stock,
.scanner-result-sheet--isolated .scan-product-sheet__location { min-width:0; padding:11px 12px; }
.scanner-result-sheet--isolated .scan-product-sheet__stock {
    display:grid; grid-template-columns:auto 1fr; align-items:end; column-gap:6px; border-right:1px solid var(--border);
}
.scanner-result-sheet--isolated .scan-product-sheet__stock > span {
    grid-column:1/-1; color:var(--text-muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
}
.scanner-result-sheet--isolated .scan-product-sheet__stock strong { margin-top:3px; font-size:24px; line-height:1; }
.scanner-result-sheet--isolated .scan-product-sheet__stock small { padding-bottom:2px; color:var(--text-muted); font-size:12px; font-weight:700; }
.scanner-result-sheet--isolated .scan-product-sheet__location { display:flex; align-items:center; gap:9px; }
.scanner-result-sheet--isolated .scan-product-sheet__summary-icon {
    width:30px; height:30px; flex:0 0 30px; display:grid; place-items:center; border-radius:8px;
    background:rgba(37,99,235,.09); color:var(--blue,#2563eb);
}
.scanner-result-sheet--isolated .scan-product-sheet__summary-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; }
.scanner-result-sheet--isolated .scan-product-sheet__location > span:last-child { min-width:0; display:grid; gap:3px; }
.scanner-result-sheet--isolated .scan-product-sheet__location small {
    color:var(--text-muted); font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.04em;
}
.scanner-result-sheet--isolated .scan-product-sheet__location strong { overflow-wrap:anywhere; font-size:13px; line-height:1.3; }
.scanner-result-sheet--isolated .scan-product-sheet__details {
    border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--bg-card,#fff);
}
.scanner-result-sheet--isolated .scan-product-sheet__details summary {
    min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:8px 11px; cursor:pointer; font-weight:800;
}
.scanner-result-sheet--isolated .scan-product-sheet__details summary strong { color:var(--text-muted); font-size:12px; }
.scanner-result-sheet--isolated .scan-product-sheet__details[open] summary { border-bottom:1px solid var(--border); }
.scanner-result-sheet--isolated .scan-product-sheet__warehouses { display:grid; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse {
    display:grid; grid-template-columns:32px minmax(0,1fr) auto; align-items:center; gap:9px;
    min-height:52px; padding:8px 10px; border-bottom:1px solid var(--border);
}
.scanner-result-sheet--isolated .scan-product-sheet__warehouse:last-child { border-bottom:0; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse-icon {
    width:30px; height:30px; display:grid; place-items:center; border-radius:8px;
    background:var(--bg-elevated,#f8fafc); color:var(--text-secondary);
}
.scanner-result-sheet--isolated .scan-product-sheet__warehouse-icon svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse-copy { min-width:0; display:grid; gap:2px; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse-copy b,
.scanner-result-sheet--isolated .scan-product-sheet__warehouse-copy small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse-copy small { color:var(--text-muted); font-size:10px; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse > strong { white-space:nowrap; font-size:14px; }
.scanner-result-sheet--isolated .scan-product-sheet__warehouse > strong small { color:var(--text-muted); font-size:10px; }
.scanner-result-sheet--isolated .scan-product-sheet__variants p { margin:10px 10px 0; color:var(--text-muted); font-size:12px; }
.scanner-result-sheet--isolated .scan-product-sheet__variants .scan-variant-list { padding:10px; }
.scanner-result-sheet--isolated .scan-product-sheet__empty {
    display:grid; gap:3px; padding:11px 12px; border:1px dashed var(--border); border-radius:12px; color:var(--text-muted);
}
.scanner-result-sheet--isolated .scan-product-sheet__empty strong { color:var(--text-primary); }
.scanner-result-sheet--isolated .scan-product-sheet__code {
    display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 10px;
    border-radius:10px; background:var(--bg-elevated,#f8fafc); color:var(--text-muted); font-size:11px;
}
.scanner-result-sheet--isolated .scan-product-sheet__code code {
    min-width:0; color:var(--text-primary); font-weight:800; overflow-wrap:anywhere; text-align:right;
}
@media (max-width:560px) {
    .scanner-result-sheet--isolated .scan-product-sheet__hero { grid-template-columns:48px minmax(0,1fr); padding:10px; }
    .scanner-result-sheet--isolated .scan-product-sheet__thumb { width:48px; }
    .scanner-result-sheet--isolated .scan-product-sheet__thumb svg { width:21px; height:21px; }
    .scanner-result-sheet--isolated .scan-product-sheet__summary { grid-template-columns:1fr 1.45fr; }
    .scanner-result-sheet--isolated .scan-product-sheet__stock,
    .scanner-result-sheet--isolated .scan-product-sheet__location { padding:10px; }
}
[data-theme="dark"] .scanner-result-sheet--isolated .scan-product-sheet__hero,
.dark .scanner-result-sheet--isolated .scan-product-sheet__hero,
body.dark .scanner-result-sheet--isolated .scan-product-sheet__hero { background:#0f172a; }


/* ================================================================
   v2.6.97 — SCANNER OVERLAY CONSUMER FIX5
   La fiche source desktop reste dans le DOM mais ne doit jamais être
   visible derrière le volet tactile qui possède sa propre copie.
   ================================================================ */
#pgScanner .scanner-result-card--sheet-source-hidden,
#pgScanner .scanner-result-card[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* ================================================================
   v2.6.98 — SCANNER TERRAIN CONFIRMATION1
   Balayage principal actif uniquement pendant une session caméra.
   ================================================================ */
#pgScanner #scannerPreview .scanner-line {
  opacity: 0;
  animation: none;
  will-change: top, opacity;
}
#pgScanner #scannerPreview[data-scan-mode="barcode"] .scanner-line,
#pgScanner #scannerPreview[data-scan-mode="qr"] .scanner-line,
#pgScanner #scannerPreview[data-scan-mode="auto"] .scanner-line {
  opacity: 1;
  animation: smScannerTerrainSweep 1.55s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes smScannerTerrainSweep {
  0%,100% { top: 6px; opacity: .15; }
  50% { top: calc(100% - 8px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #pgScanner #scannerPreview[data-scan-mode] .scanner-line {
    animation: none !important;
    top: 50% !important;
    opacity: .9 !important;
  }
}
