:root {
  --navy: #0D2C4A; --navy-2: #123B63; --petrole: #007C91; --orange: #F47A38;
  --ok: #138A4B; --ko: #C0392B; --att: #C77700; --info: #2563A8;
  --texte: #263445; --gris: #5B6B7D; --fond: #F5F7FA; --blanc: #FFFFFF;
  --police: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--navy); color: var(--blanc); font-family: var(--police); -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
button, input, select { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ecran { min-height: 100%; }
.ecran--centre { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 20px; gap: 6px; }
.ecran--centre h1 { font-size: 22px; margin: 14px 0 4px; }
.ecran--centre p { color: #C9D6E3; max-width: 420px; line-height: 1.5; margin: 0; }
.roue { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--orange); animation: tour .9s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }

.ecran--scan { display: flex; flex-direction: column; height: 100%; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.barre { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.barre__titre { display: flex; flex-direction: column; min-width: 0; }
.barre__titre b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre__titre span { font-size: 12.5px; color: #9FB3C8; }
.reseau { flex: none; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(19,138,75,.25); color: #8FE3B5; }
.reseau--hors { background: rgba(199,119,0,.3); color: #FFD08A; }

.reglages { display: flex; gap: 8px; padding: 0 16px 10px; }
.reglages select { flex: 1; min-width: 0; min-height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: var(--navy-2); color: var(--blanc); padding: 0 10px; font-size: 15px; }
.sens { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); flex: none; }
.sens button { border: 0; background: transparent; color: #C9D6E3; padding: 0 14px; min-height: 44px; font-weight: 600; }
.sens button[aria-pressed="true"] { background: var(--orange); color: var(--navy); }

.camera { position: relative; flex: 1; min-height: 240px; margin: 0 16px; border-radius: 16px; overflow: hidden; background: #000; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.viseur { position: absolute; inset: 50% auto auto 50%; width: min(64vw, 260px); aspect-ratio: 1; transform: translate(-50%, -50%); }
.viseur i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--orange); }
.viseur i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.viseur i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.viseur i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.viseur i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.camera__msg { position: absolute; inset: auto 12px 12px; margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(13,44,74,.88); font-size: 14px; line-height: 1.4; text-align: center; }

.compteurs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 6px; }
.compteurs div { background: rgba(255,255,255,.07); border-radius: 12px; padding: 8px; text-align: center; }
.compteurs b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.compteurs span { font-size: 12px; color: #9FB3C8; }

.manuel { padding: 6px 16px 14px; }
.manuel label { display: block; font-size: 12.5px; color: #9FB3C8; margin-bottom: 6px; }
.manuel__ligne { display: flex; gap: 8px; }
.manuel input { flex: 1; min-width: 0; min-height: 46px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: var(--navy-2); color: var(--blanc); padding: 0 12px; letter-spacing: .08em; text-transform: uppercase; font-size: 16px; }
.manuel button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--blanc); color: var(--navy); font-weight: 700; }

.resultat { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px 16px; background: var(--ok); animation: apparait .12s ease-out; }
.resultat--ko { background: var(--ko); }
.resultat--att { background: var(--att); }
.resultat--info { background: var(--info); }
@keyframes apparait { from { opacity: .4; transform: scale(.98); } }
.resultat__carte { width: min(460px, 100%); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.resultat__icone { width: 92px; height: 92px; border-radius: 50%; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; }
.resultat__icone svg { width: 56px; height: 56px; }
.resultat h2 { margin: 4px 0 0; font-size: 34px; letter-spacing: .01em; }
.resultat__motif { margin: 0; font-size: 18px; font-weight: 600; }
.personne { display: flex; gap: 14px; align-items: center; width: 100%; background: var(--blanc); color: var(--texte); border-radius: 16px; padding: 14px; text-align: left; margin-top: 6px; }
.personne img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; background: #E6EBF1; }
.personne div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.personne b { font-size: 21px; line-height: 1.15; color: var(--navy); }
.personne span { font-size: 14px; color: var(--gris); }
.categorie { align-self: flex-start; margin-top: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12.5px !important; letter-spacing: .06em; }
.resultat__info { margin: 0; font-size: 14px; opacity: .9; }
.resultat__boutons { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 10px; }
.bouton { min-height: 54px; border: 0; border-radius: 14px; background: var(--blanc); color: var(--navy); font-weight: 700; font-size: 17px; }
.bouton--clair { background: rgba(255,255,255,.18); color: var(--blanc); border: 2px solid rgba(255,255,255,.6); }
