:root{
  --nuit:#1C2230; --orange:#C2410C; --orange-fonce:#9A3412; --orange-clair:#FFF7ED;
  --fond:#F3F4F6; --carte:#FFFFFF; --texte:#111827; --doux:#4B5563; --trait:#E5E7EB; --bord:#D1D5DB;
  --vert:#15803D; --bleu-fond:#DBEAFE; --bleu:#1E40AF; --bleu-vif:#1D4ED8; --rouge:#B91C1C;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--fond);color:var(--texte);font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
#app{max-width:640px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.55}
a{color:var(--orange)}

.entete{background:var(--nuit);color:#fff;padding:16px 16px 20px;display:flex;flex-direction:column;gap:14px;position:sticky;top:0;z-index:5}
.entete-ligne{display:flex;align-items:center;gap:8px}
.entete h1{margin:0;font-size:21px;font-weight:800}
.entete .sous{font-size:13px;color:#CBD5E1}
.entete .titre{display:flex;flex-direction:column;flex:1;min-width:0}
.entete .titre strong{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.icone-btn{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:none;border:none;color:#fff;border-radius:10px}
.pastille{font-size:12px;font-weight:700;padding:4px 10px;border-radius:999px;background:var(--bleu-fond);color:var(--bleu);white-space:nowrap}
.pastille.gris{background:var(--fond);color:#374151}
.onglets{display:flex;margin:0 -16px -20px}
.onglets button{flex:1;height:48px;background:none;border:none;border-bottom:3px solid transparent;color:#CBD5E1;font-size:15px;font-weight:600}
.onglets button[aria-selected="true"]{color:#fff;font-weight:700;border-bottom-color:#F97316}

.contenu{padding:18px 16px 24px;display:flex;flex-direction:column;gap:14px;flex:1}
.gros-btn{display:flex;align-items:center;justify-content:center;gap:10px;min-height:58px;border-radius:14px;border:none;background:var(--orange);color:#fff;font-size:18px;font-weight:700;width:100%;padding:0 16px}
.gros-btn.sombre{background:var(--nuit)}
.gros-btn.contour{background:#fff;color:var(--nuit);border:2px solid var(--nuit)}
.gros-btn.gris{background:var(--trait);color:var(--doux)}
.btn{min-height:44px;padding:0 14px;border-radius:10px;border:1px solid var(--bord);background:#fff;font-size:15px;font-weight:600;color:#374151}
.btn.plein{background:var(--nuit);border-color:var(--nuit);color:#fff}
.btn.pointille{border-style:dashed;border-color:#9CA3AF;background:transparent;width:100%}
.segment{display:flex;gap:8px}
.segment button{flex:1;min-height:46px;border-radius:12px;border:1px solid var(--bord);background:#fff;font-weight:600;font-size:15px;color:#374151}
.segment button[aria-pressed="true"]{background:var(--nuit);border-color:var(--nuit);color:#fff;font-weight:700}

.carte{background:var(--carte);border-radius:14px;padding:16px;box-shadow:0 1px 2px rgba(0,0,0,.06);display:flex;flex-direction:column;gap:8px}
button.carte{border:none;text-align:left;width:100%}
.carte-haut{display:flex;justify-content:space-between;align-items:center;gap:8px}
.carte .ref{font-size:13px;font-weight:600;color:var(--doux)}
.carte .vehicule{font-size:18px;font-weight:700}
.carte .desc{font-size:14px;color:var(--doux)}
.carte-bas{display:flex;justify-content:space-between;align-items:center;padding-top:10px;border-top:1px solid var(--trait);font-size:14px;font-weight:600;color:#374151}
.vert{color:var(--vert)}
.vide{text-align:center;color:var(--doux);padding:32px 8px}

.champ{display:flex;flex-direction:column;gap:6px}
.champ label,.libelle{font-size:14px;font-weight:600;color:#374151}
.oblig{color:var(--rouge)}
.aide{font-size:12px;color:var(--doux)}
.saisie{height:52px;width:100%;min-width:0;padding:0 14px;border-radius:12px;border:1px solid var(--bord);background:#fff;font-size:17px;font-weight:600}
.saisie:focus,textarea:focus{outline:3px solid #FDBA74;outline-offset:1px}
.saisie.forte{border:2px solid var(--nuit)}
.saisie.immat{font-size:21px;font-weight:800;letter-spacing:1px;text-transform:uppercase}
textarea.saisie{height:88px;padding:12px 14px;font-weight:400;font-size:16px;resize:vertical}
.rangee{display:flex;gap:8px}
.grille2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.info{padding:14px;border-radius:12px;background:#fff;border:1px solid var(--trait);display:flex;flex-direction:column;gap:4px}
.verrou{display:flex;align-items:center;gap:10px;height:52px;padding:0 14px;border-radius:12px;background:var(--trait);font-weight:700;font-size:17px}
.bandeau-garantie{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px;border-radius:12px;background:var(--bleu-fond);color:#1E3A8A}
.bandeau-garantie strong{display:block;font-size:16px}
.bandeau-garantie span{font-size:13px;color:var(--bleu)}
.bandeau-neutre{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px;border-radius:12px;background:#fff;border:1px solid var(--trait)}
.interrupteur{width:56px;height:32px;border-radius:16px;border:none;background:#9CA3AF;padding:3px;display:flex;flex-shrink:0}
.interrupteur::after{content:"";width:26px;height:26px;border-radius:13px;background:#fff}
.interrupteur[aria-checked="true"]{background:var(--bleu-vif);justify-content:flex-end}
.resultats{display:flex;flex-direction:column;background:#fff;border-radius:12px;border:1px solid var(--trait);overflow:hidden}
.resultats button{min-height:48px;padding:10px 14px;border:none;border-bottom:1px solid var(--trait);background:#fff;text-align:left;display:flex;justify-content:space-between;gap:8px;font-size:15px}
.resultats button:last-child{border-bottom:none}
.resultats small{color:var(--doux)}
.pied{position:sticky;bottom:0;padding:14px 16px calc(18px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--trait)}

.chrono{display:flex;flex-direction:column;align-items:center;gap:14px;padding:22px 18px;border-radius:16px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.06)}
.chrono .heure{font-size:54px;font-weight:800;letter-spacing:-1px;font-variant-numeric:tabular-nums}
.chrono .etat{font-size:14px;font-weight:600}
.chrono .rangee{width:100%}
.liste{display:flex;flex-direction:column;background:#fff;border-radius:14px;overflow:hidden}
.liste .ligne{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 16px;border-bottom:1px solid var(--trait)}
.liste .ligne:last-child{border-bottom:none}
.liste .ligne .gauche{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.liste .ligne .gauche strong{font-size:15px}
.liste .ligne .gauche small{font-size:13px;color:var(--doux)}
.total{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-radius:12px;background:var(--trait);font-weight:600;color:#374151}
.total strong{font-size:18px;color:var(--texte)}
.qte{display:flex;align-items:center;gap:4px}
.qte button{width:44px;height:44px;border-radius:10px;border:1px solid var(--bord);background:#fff;font-size:20px;font-weight:700}
.qte button.plus{background:var(--nuit);border-color:var(--nuit);color:#fff}
.qte span{width:36px;text-align:center;font-size:17px;font-weight:700}

.photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.photo-tuile{min-height:100px;border-radius:12px;border:2px dashed var(--orange);background:var(--orange-clair);color:var(--orange-fonce);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font-size:13px;font-weight:700;padding:8px;text-align:center}
.photo-tuile.ok{border:2px solid var(--vert);background:#F0FDF4;color:var(--vert)}
.controle{display:flex;flex-direction:column;gap:4px;padding:14px 16px;border-radius:12px;background:#fff;border:1px solid var(--trait);font-size:14px}
.manque{color:var(--orange-fonce);font-weight:600}

.pin-ecran{display:flex;flex-direction:column;align-items:center;gap:18px;padding:28px 16px}
.pin-points{display:flex;gap:14px;height:20px}
.pin-points span{width:16px;height:16px;border-radius:8px;border:2px solid var(--nuit)}
.pin-points span.plein{background:var(--nuit)}
.clavier{display:grid;grid-template-columns:repeat(3,76px);gap:14px}
.clavier button{height:76px;border-radius:38px;border:none;background:#fff;font-size:26px;font-weight:700;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.employes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.employes button{min-height:64px;border-radius:14px;border:none;background:#fff;font-size:16px;font-weight:700;box-shadow:0 1px 2px rgba(0,0,0,.06);padding:8px}

#toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);max-width:92vw;background:var(--nuit);color:#fff;padding:14px 18px;border-radius:12px;font-size:15px;font-weight:600;z-index:50;box-shadow:0 6px 20px rgba(0,0,0,.25)}
#toast.erreur{background:var(--rouge)}
.scan{position:fixed;inset:0;background:#000;z-index:40;display:flex;flex-direction:column}
.scan video{flex:1;width:100%;object-fit:cover}
.scan .pied{position:static}
.charge{opacity:.6;pointer-events:none}
.visuellement-cache{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
[hidden]{display:none!important}
.logo{display:flex;align-items:center;justify-content:center;background:#fff;border-radius:12px;flex-shrink:0}
.logo img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.logo-grand{height:72px;padding:8px 14px;align-self:flex-start}
.logo-petit{height:44px;width:auto;padding:5px 8px}
.logo-grand img{max-height:56px;max-width:220px}
.logo-petit img{max-height:34px;max-width:90px}
