/* ============ Parcours mobile « Fabriquer » — ergonomie labo ============ */
.mobile { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.m-stage { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* tab bar bas */
.m-tabbar { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); background: var(--surface); padding-bottom: env(safe-area-inset-bottom, 0); }
.m-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 0 13px; color: var(--text-faint); font-size: 11px; font-weight: 600; }
.m-tab svg { width: 23px; height: 23px; }
.m-tab.on { color: var(--accent); }

/* accueil */
.m-home { padding: 26px 20px; display: flex; flex-direction: column; gap: 20px; min-height: 100%; }
.m-home-brand { display: flex; align-items: center; gap: 13px; }
.m-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 22px; }
.m-home-title { font-size: 18px; font-weight: 700; }
.m-home-sub { font-size: 13px; color: var(--text-muted); }
.m-bigstart { margin-top: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 200px; background: var(--accent); color: #fff; border-radius: 24px; font-size: 22px; font-weight: 700; box-shadow: var(--shadow-md); }
.m-bigstart-plus { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,0.2); display: grid; place-items: center; }
.m-bigstart-plus svg { width: 36px; height: 36px; }
.m-resume { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 56px; border-radius: 16px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 15px; font-weight: 600; color: var(--text); }

/* flow */
.m-flow { display: flex; flex-direction: column; height: 100%; }
.m-flow-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.m-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.m-icon svg { width: 22px; height: 22px; }
.m-stephead { flex: 1; }
.m-stepdots { display: flex; gap: 5px; margin-bottom: 4px; }
.m-dot { height: 5px; flex: 1; border-radius: 3px; background: var(--surface-3); }
.m-dot.on { background: var(--accent); }
.m-steplabel { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.m-flow-body { flex: 1; overflow-y: auto; padding: 18px 16px; }
.m-foot { flex-shrink: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0)); border-top: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.m-foot-row { display: flex; gap: 10px; }
.m-foot-row .m-btn { flex: 1; }
.m-btn { min-height: 56px; border-radius: 16px; font-size: 16px; font-weight: 650; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 0 18px; }
.m-btn svg { width: 20px; height: 20px; }
.m-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.m-btn-primary:disabled { opacity: 0.4; }
.m-btn-ghost { border-color: transparent; background: var(--surface-3); }
.m-btn-xl { min-height: 62px; font-size: 17px; }

/* étape fiche */
.m-fiches { display: flex; flex-direction: column; gap: 12px; }
.m-fiche { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 16px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); text-align: left; }
.m-fiche.on { border-color: var(--accent); background: var(--accent-soft); }
.m-fiche-ico { width: 48px; height: 48px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; background: var(--bordeaux-soft); color: var(--bordeaux); }
.m-fiche-ico.semi { background: rgba(120,90,160,0.13); color: #7d5aa0; }
.m-fiche-ico svg { width: 24px; height: 24px; }
.m-fiche-txt { flex: 1; min-width: 0; }
.m-fiche-name { font-size: 16.5px; font-weight: 650; }
.m-fiche-meta { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.m-fiche-check { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.m-fiche-check svg { width: 18px; height: 18px; }

/* étape quantité / pavé numérique */
.m-qte { display: flex; flex-direction: column; align-items: center; }
.m-field-label { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.m-qte-big { font-size: 64px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; display: flex; align-items: baseline; gap: 8px; }
.m-qte-unit { font-size: 24px; font-weight: 600; color: var(--text-muted); }
.m-qte-hint { font-size: 13.5px; color: var(--text-muted); margin: 8px 0 16px; }
.m-steppers { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; justify-content: center; }
.m-step-chip { min-height: 44px; min-width: 56px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 15px; font-weight: 650; color: var(--text); padding: 0 14px; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 340px; }
.np-key { min-height: 60px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--border); font-size: 26px; font-weight: 600; color: var(--text); }
.np-key:active { background: var(--surface-3); }

/* étape lots */
.m-lots { display: flex; flex-direction: column; gap: 12px; }
.m-lotcard { border-radius: 18px; border: 2px solid var(--border); background: var(--surface); padding: 14px 15px; }
.m-lotcard.done { border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.m-lotcard-h { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; }
.m-lot-name { flex: 1; font-size: 15.5px; font-weight: 650; }
.m-lot-need { font-size: 14px; font-weight: 700; color: var(--accent); }
.m-lot-body { display: flex; flex-direction: column; gap: 9px; }
.m-lot-actif { display: flex; align-items: center; gap: 12px; }
.m-lot-actif > div:first-child { flex: 1; }
.m-lot-actif-k { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.m-lot-actif-v { font-size: 17px; font-weight: 700; }
.m-lot-actif-s { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.m-ok-btn { min-width: 64px; min-height: 48px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; }
.m-ok-pill { width: 40px; height: 40px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.m-ok-pill svg { width: 20px; height: 20px; }
.m-correct { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--accent); padding: 6px 2px; }
.m-correct-input { min-height: 50px; border-radius: 13px; border: 1.5px solid var(--accent-line); background: var(--surface-2); padding: 0 14px; font-size: 16px; }
.m-lot-opt { display: flex; align-items: center; gap: 9px; min-height: 54px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface-2); padding: 0 15px; font-size: 15px; font-weight: 600; color: var(--text); text-align: left; }
.m-lot-opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.m-lot-opt-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.m-lot-daterow { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); padding: 4px 0; }
.m-readonly { font-size: 11px; background: var(--surface-3); padding: 2px 8px; border-radius: 6px; }

/* étape production */
.m-op-list { display: flex; flex-direction: column; gap: 9px; width: 100%; }
.m-op { min-height: 54px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 16px; font-weight: 600; color: var(--text); }
.m-op.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.m-date { min-height: 54px; width: 100%; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface-2); padding: 0 14px; font-size: 16px; font-variant-numeric: tabular-nums; }

/* récap */
.m-recap-prod { font-size: 22px; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 16px; }
.m-recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-recap-grid > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 13px 14px; }
.m-recap-grid span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.m-recap-grid b { font-size: 17px; font-weight: 700; }
.m-recap-num { margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.m-recap-num b { color: var(--text); }

/* succès */
.m-success { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 22px; }
.m-success-check { width: 84px; height: 84px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; margin-bottom: 16px; }
.m-success-check svg { width: 44px; height: 44px; }
.m-success-sub { font-size: 14px; color: var(--text-muted); }
.m-success-num { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin: 6px 0; }
.m-success-prod { font-size: 17px; font-weight: 600; }
.m-success-meta { display: flex; gap: 16px; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.m-success-meta span { display: inline-flex; align-items: center; gap: 5px; }
.m-print-opts { width: 100%; max-width: 360px; margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.m-opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.m-opt-row > span { font-size: 14px; font-weight: 600; }
.m-seg { display: flex; gap: 6px; }
.m-seg-b { min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.m-seg-b.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.m-stepper { display: flex; align-items: center; gap: 14px; }
.m-stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 22px; font-weight: 600; }
.m-stepper b { font-size: 19px; min-width: 24px; text-align: center; }

/* listes registre / trace */
.m-list { padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.m-list-title { font-size: 20px; font-weight: 750; margin-bottom: 4px; }
.m-search { min-height: 52px; border-radius: 14px; border: 1.5px solid var(--border-strong); background: var(--surface); padding: 0 15px; font-size: 16px; }
.m-lotline { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 15px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-align: left; }
.m-lotline-num { font-size: 14px; font-weight: 700; }
.m-lotline-prod { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.m-lotline-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

/* ============ Réception mobile (facture / BL) ============ */
.mr-home .m-bigstart.mr-photo { min-height: 168px; }
.mr-resume { border-color: var(--accent-line); color: var(--accent); }
.mr-tip { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 12px 14px; margin-top: auto; }
.mr-tip svg { color: var(--accent); flex-shrink: 0; margin-top: 1px; }

/* étape document */
.mr-doc { display: flex; flex-direction: column; gap: 14px; }
.mr-cam-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.mr-cam-hint svg { color: var(--accent); }
.mr-pages { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mr-thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; border: 1.5px solid var(--border-strong); background: var(--surface-2); padding: 0; }
.mr-thumb .doc-preview { width: 100%; height: 100%; border: none; border-radius: 0; padding: 0; }
.mr-thumb .doc-preview img, .mr-thumb .doc-canvas { width: 100%; height: 100%; object-fit: cover; }
.mr-thumb-n { position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.mr-thumb-del { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; display: grid; place-items: center; }
.mr-addpage { aspect-ratio: 3 / 4; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: var(--surface-2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; }
.mr-addpage svg { width: 26px; height: 26px; }
.mr-doc-imp .m-btn { min-height: 50px; }
.mr-soon { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--text-muted); background: var(--accent-soft); border-radius: 12px; padding: 11px 13px; }
.mr-soon svg { color: var(--accent); flex-shrink: 0; }

/* étape vérifier */
.mr-verify { display: flex; flex-direction: column; }
.mr-verify .fsel-trigger { min-height: 54px; font-size: 16px; border-radius: 14px; }
.mr-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mr-seedoc { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 11px; padding: 9px 14px; }
.mr-line { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 13px; margin-bottom: 10px; }
.mr-line-h { display: flex; align-items: center; gap: 8px; }
.mr-inp { width: 100%; min-height: 50px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface-2); padding: 0 13px; font-size: 16px; }
.mr-inp:focus { outline: none; border-color: var(--accent-line); background: var(--surface); }
.mr-art { font-weight: 600; }
.mr-line-del { width: 46px; height: 50px; flex-shrink: 0; display: grid; place-items: center; color: var(--text-faint); background: var(--surface-3); border-radius: 12px; }
.mr-line-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.mr-line-nums label { display: flex; flex-direction: column; gap: 5px; }
.mr-line-nums span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.mr-money { position: relative; }
.mr-money input { padding-right: 32px; }
.mr-money > span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-weight: 600; pointer-events: none; }
.mr-money-big { margin-top: 4px; }
.mr-money-big input { font-size: 26px; font-weight: 800; padding: 16px 40px 16px 16px; letter-spacing: -0.02em; }
.mr-money-big > span { right: 16px; font-size: 18px; }
.mr-lines-wrap { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.mr-lot { margin-top: 10px; }
.mr-majlot { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--accent); }
.mr-majlot input { width: 22px; height: 22px; accent-color: var(--accent); }
.mr-lotna { margin-top: 8px; font-size: 12px; color: var(--text-faint); }
.mr-addline { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 50px; border-radius: 14px; border: 1.5px dashed var(--border-strong); background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--text-muted); }
.mr-rare { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin-top: 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.mr-total { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; padding: 16px 18px; border-radius: 16px; background: var(--accent-soft); }
.mr-total span { font-size: 14px; font-weight: 600; color: var(--accent); }
.mr-total b { font-size: 24px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }

/* étape valider */
.mr-recap-card { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); padding: 6px 18px; }
.mr-recap-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.mr-recap-row span { color: var(--text-muted); }
.mr-recap-total { display: flex; align-items: center; justify-content: space-between; padding: 16px 0 13px; font-size: 16px; }
.mr-recap-total b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }

/* aperçu plein écran d'une page */
.mr-viewer { position: absolute; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.mr-viewer-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.mr-viewer-body { flex: 1; overflow: auto; padding: 16px; display: grid; place-items: center; }
.mr-viewer-body .doc-preview { max-width: 100%; }
.mr-viewer-foot { display: flex; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0)); border-top: 1px solid var(--border); }
.mr-viewer-foot .m-btn { flex: 1; min-height: 50px; }
.m-step-title { font-size: 15px; font-weight: 700; color: var(--text); }
.mr-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.mr-thumb .rcp-thumb-pdf { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-muted); position: relative; }
.mr-viewer-body .pv-pdf { width: 100%; height: 100%; border: none; }

/* l'étiquette en plein écran sur mobile */
@media (max-width: 640px) {
  .etiquette-modal, .modal.reception, .modal.wizard, .recall-modal { max-width: 100%; max-height: 100%; height: 100%; border-radius: 0; }
  .modal-overlay { padding: 0; }
}
