:root { --bordeaux: #6B1A26; --bordeaux-dark: #4E111B; --gold: #D9B56A; --cream: #FBF7F0; --ink: #2A1E1A; --muted: #6E625A; --line: #E3D3B4;
  --vert: #1E8E4E; --rouge: #C0303C; --orange: #D9822B; color-scheme: light; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 17px; line-height: 1.45; color: var(--ink); background: var(--cream); }
[hidden] { display: none !important; }
code { background: #F0E6D6; padding: 1px 5px; border-radius: 4px; font-size: 14px; word-break: break-all; }
.ecran { min-height: 100%; display: flex; flex-direction: column; }
.ecran--noir { background: #000; color: #fff; position: fixed; inset: 0; }
.entete { background: var(--bordeaux); color: #fff; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 12px; border-bottom: 3px solid var(--gold); }
.marque { margin: 0; font-family: Georgia, serif; letter-spacing: .25em; color: var(--gold); font-size: 17px; flex: 1; }
.marque span { color: #fff; letter-spacing: .05em; font-style: italic; }
.badge { background: var(--gold); color: var(--bordeaux-dark); font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; letter-spacing: .08em; }
.contenu { padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; max-width: 560px; width: 100%; margin: 0 auto; }
h1 { margin: 4px 0 0; color: var(--bordeaux); font-family: Georgia, serif; font-size: 26px; line-height: 1.2; }
.sous { margin: 0; color: var(--muted); }
.note { color: var(--muted); font-size: 14px; margin: 0; }
.erreur { background: #FBEAEA; color: #7A1E27; border-left: 4px solid var(--rouge); padding: 10px 12px; margin: 0; }
.bouton { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 18px; border-radius: 10px; border: 2px solid var(--bordeaux); background: var(--bordeaux); color: #fff; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.bouton--grand { min-height: 64px; font-size: 19px; }
.bouton--clair { background: #fff; color: var(--bordeaux); }
.bouton--blanc { background: #fff; color: var(--ink); border-color: #fff; min-width: 220px; }
.lien { background: none; border: 0; color: var(--bordeaux); text-decoration: underline; font: inherit; padding: 10px; cursor: pointer; }
.lien--clair { color: #fff; padding: 0; }
.lien--danger { color: var(--rouge); margin-top: 18px; font-size: 14px; }
.compteur { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.compteur strong { font-size: 48px; color: var(--bordeaux); line-height: 1; font-variant-numeric: tabular-nums; }
.compteur span { color: var(--muted); }
.barre { height: 10px; background: #EDE3D2; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.barre div { height: 100%; width: 0; background: var(--vert); transition: width .3s; }
/* Caméra */
.camera { position: relative; flex: 1; overflow: hidden; }
.camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viseur { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.viseur span { width: min(70vw, 70vh, 320px); aspect-ratio: 1; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(0,0,0,.45); border: 3px solid var(--gold); }
.camera__aide { position: absolute; left: 0; right: 0; top: calc(16px + env(safe-area-inset-top)); text-align: center; margin: 0; font-weight: 600; text-shadow: 0 1px 4px #000; padding: 0 16px; }
.scan-bas { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); background: #000; }
.scan-bas .bouton { min-height: 46px; padding: 8px 14px; }
.scan-cpt { font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
/* Résultat */
.resultat { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; color: #fff; z-index: 5; }
.resultat.ok { background: var(--vert); } .resultat.deja { background: var(--orange); } .resultat.non { background: var(--rouge); }
.resultat__icone { font-size: 84px; line-height: 1; }
.resultat__titre { font-size: 26px; font-weight: 800; margin: 6px 0 0; letter-spacing: .02em; }
.resultat__nom { font-size: 30px; font-weight: 700; margin: 10px 0 0; font-family: Georgia, serif; }
.resultat__table { font-size: 46px; font-weight: 800; margin: 4px 0; background: rgba(255,255,255,.18); padding: 4px 26px; border-radius: 14px; }
.resultat__table:empty { display: none; }
.resultat__detail { margin: 6px 0 22px; font-size: 17px; opacity: .95; max-width: 420px; }
/* Listes */
input[type=search] { font: inherit; padding: 14px; border: 2px solid var(--line); border-radius: 10px; width: 100%; }
input[type=search]:focus { outline: none; border-color: var(--bordeaux); }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.liste .infos { flex: 1; min-width: 0; }
.liste .nom { font-weight: 600; }
.liste .meta { font-size: 14px; color: var(--muted); }
.liste .ok { color: var(--vert); font-weight: 700; font-size: 14px; white-space: nowrap; }
.liste button { min-height: 42px; padding: 6px 12px; font-size: 15px; }
.boutons-ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.boutons-ligne .bouton { min-height: 48px; font-size: 15px; }
