/* Déjà : feuille de style. Inspiration : étiquette de rayon et tampon de date limite. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --fond: #FFFFFF;
  --encre: #000000;
  --encre-douce: #4A5662;
  --surface: #E9EDF1;
  --trait: #D2D9DF;
  --etiquette: #FFD400;
  --sur-etiquette: #000000;
  --peremption: #E0102B;
  --vert-stock: #1E8E3E;
  --champ-bord: #9AA6B1;
  --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #000000;
    --encre: #FFFFFF;
    --encre-douce: #A9B4BF;
    --surface: #1B2127;
    --trait: #2C343C;
    --peremption: #FF4A5E;
    --vert-stock: #4CC26E;
    --champ-bord: #56626E;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 400 16px/1.45 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--etiquette);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--encre);
}

.aller-contenu {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--etiquette); color: #000; padding: 10px 14px; border-radius: 6px; font-weight: 700;
}
.aller-contenu:focus { top: 8px; }

#hors-ligne {
  background: var(--encre); color: var(--fond);
  padding: 10px 16px; font-size: 14px;
  padding-top: calc(10px + var(--safe-area-inset-top, env(safe-area-inset-top)));
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(18px + var(--safe-area-inset-top, env(safe-area-inset-top))) 16px calc(var(--nav-h) + 40px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  outline: none;
}

/* ---------- Titres ---------- */

h1, h2 { margin: 0; font-stretch: 78%; letter-spacing: 0; }
h1 { font-size: 32px; line-height: 1.05; font-weight: 820; margin-bottom: 18px; }
h2 { font-size: 20px; line-height: 1.15; font-weight: 760; margin-bottom: 10px; }
.compte {
  display: inline-block; vertical-align: 0.15em;
  font-size: 13px; font-weight: 700; font-stretch: 100%;
  background: var(--surface); color: var(--encre-douce);
  border-radius: 999px; padding: 1px 8px; margin-left: 4px;
}
p { margin: 0 0 12px; }
.aide { color: var(--encre-douce); font-size: 14px; }
.discret { color: var(--encre-douce); font-size: 14px; margin-left: 6px; }
.vide { color: var(--encre-douce); padding: 24px 0; }
.chargement { color: var(--encre-douce); padding: 40px 0; }

.bloc { margin-top: 30px; }

/* ---------- Accueil ---------- */

.accueil h1 {
  font-size: clamp(38px, 11vw, 54px);
  font-stretch: 68%;
  font-weight: 880;
  line-height: 0.95;
  margin-bottom: 16px;
}
.recherche { display: flex; gap: 8px; }
.recherche input {
  flex: 1; min-width: 0;
  height: 58px; padding: 0 16px;
  font-size: 19px;
  border: 2.5px solid var(--encre); border-radius: 12px;
  background: var(--fond);
  -webkit-appearance: none; appearance: none;
}
.recherche input:focus { outline: none; box-shadow: 0 0 0 4px var(--etiquette); }
.bouton-scan {
  flex: none;
  display: grid; place-items: center; gap: 1px;
  width: 76px; height: 58px;
  background: var(--etiquette); color: #000;
  border: 2.5px solid var(--encre); border-radius: 12px;
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.bouton-scan svg { width: 30px; height: 22px; }

#resultats { margin-top: 8px; }
.verdict {
  font-size: 22px; font-weight: 800; font-stretch: 80%;
  margin: 18px 0 8px; padding-left: 12px;
  border-left: 6px solid var(--encre-douce);
}
.verdict.oui { border-color: var(--vert-stock); }
.verdict.non { border-color: var(--peremption); }
.ajout-direct { margin-top: 18px; width: 100%; }

.vide-accueil {
  margin-top: 28px; padding: 20px;
  border: 2px dashed var(--champ-bord); border-radius: 14px;
}
.vide-accueil p { color: var(--encre-douce); }

/* ---------- Lignes d'inventaire ---------- */

.liste { border-top: 1px solid var(--trait); }
.ligne {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0 11px 10px;
  border-bottom: 1px solid var(--trait);
  text-decoration: none;
  position: relative;
  min-height: 68px;
}
.ligne::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 4px; border-radius: 2px;
  background: var(--teinte, transparent);
}
.ligne-cadeau::before, .ligne-simple::before { display: none; }
.ligne-cadeau, .ligne-simple { padding-left: 0; }
.ligne:active { background: var(--surface); }
.vignette {
  flex: none; width: 46px; height: 46px; border-radius: 8px;
  object-fit: cover; background: var(--surface);
}
.vignette.vide { display: none; }
.ligne-simple .vignette { display: none; }
.ligne-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne-nom {
  font-weight: 720; font-stretch: 86%; font-size: 17px; line-height: 1.2;
  overflow-wrap: anywhere;
}
.ligne-infos { color: var(--encre-douce); font-size: 13.5px; line-height: 1.3; }
.ligne-infos span + span::before { content: ", "; }

.prix {
  flex: none;
  min-width: 58px; padding: 4px 8px 5px;
  background: var(--etiquette); color: var(--sur-etiquette);
  border-radius: 4px;
  text-align: right; line-height: 1;
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
}
.prix b { font-size: 26px; font-weight: 860; font-stretch: 66%; }
.prix small { font-size: 11.5px; font-weight: 600; }
.prix.epuise { background: var(--surface); color: var(--encre-douce); }

.dlc {
  align-self: flex-start;
  font-size: 12.5px; font-weight: 700;
  margin-top: 3px; padding: 1px 6px;
  border: 1.5px solid var(--encre-douce); border-radius: 3px;
  color: var(--encre-douce);
}
.dlc.proche { border-color: var(--peremption); color: var(--peremption); }
.dlc.passee { background: var(--peremption); border-color: var(--peremption); color: #fff; }

.statut {
  flex: none; font-size: 12.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; background: var(--surface);
}
.statut-achete { background: var(--etiquette); color: #000; }
.statut-offert { background: var(--encre); color: var(--fond); }

.ligne-avec-action { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--trait); }
.ligne-avec-action .ligne { flex: 1; min-width: 0; border-bottom: 0; }
.ligne-avec-action .statut { display: none; }
.passer {
  flex: none; height: 38px; padding: 0 12px;
  border: 2px solid var(--encre); border-radius: 8px; background: var(--fond);
  font-weight: 700; font-size: 14px; cursor: pointer;
}

.lien-suite { display: inline-block; margin-top: 10px; font-weight: 600; }

/* ---------- Puces et filtres ---------- */

/* Les puces passent à la ligne : un défilement horizontal masque des catégories et ne se fait pas à la souris. */
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.puces-retour { margin: 0; }
.puce {
  flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px;
  border: 1.5px solid var(--champ-bord); border-radius: 999px;
  background: var(--fond);
  font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.puce i { width: 10px; height: 10px; border-radius: 50%; background: var(--teinte, var(--encre-douce)); }
.puce span { font-weight: 500; color: var(--encre-douce); font-size: 13px; }
.puce[aria-pressed="true"], .puce:has(input:checked) {
  background: var(--encre); color: var(--fond); border-color: var(--encre);
}
.puce[aria-pressed="true"] span { color: inherit; opacity: .75; }
.puce input { position: absolute; opacity: 0; pointer-events: none; }
.puce:has(input:focus-visible) { outline: 3px solid var(--etiquette); outline-offset: 2px; }

/* Grille régulière : deux colonnes sur téléphone, trois au-delà. */
.filtres {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 12px; margin-bottom: 16px; align-items: end;
}
.filtres label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--encre-douce); min-width: 0; }
.filtres select { height: 42px; width: 100%; }
.case { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; font-size: 15px !important; color: var(--encre) !important; min-height: 40px; }
.case input { width: 22px; height: 22px; accent-color: var(--encre); }

.segments {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border-radius: 12px; padding: 4px; gap: 4px;
  margin-bottom: 14px;
}
.segments button, .segments label {
  height: 44px; border: 0; border-radius: 9px; background: transparent;
  font-size: 14px; font-weight: 650; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; line-height: 1.1;
  padding: 0 4px;
}
.segments button[role="tab"] { flex-direction: column; gap: 0; height: 50px; white-space: nowrap; }
.segments button span { font-size: 12px; font-weight: 600; color: var(--encre-douce); }
.segments [aria-selected="true"], .segments label:has(input:checked) {
  background: var(--fond); box-shadow: 0 0 0 2px var(--encre);
}
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments label:has(input:focus-visible) { outline: 3px solid var(--etiquette); }

.tailles { background: var(--surface); padding: 10px 12px; border-radius: 6px; font-size: 15px; }

/* ---------- Formulaires ---------- */

select, input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), textarea {
  width: 100%;
  border: 1.5px solid var(--champ-bord); border-radius: 9px;
  background: var(--fond);
  padding: 10px 12px; font-size: 16px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select { height: 48px; }
select { appearance: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--encre); box-shadow: 0 0 0 3px var(--etiquette); }

.champ { display: block; margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
.champ > span, .champ > legend, .etiquette-champ {
  display: block; font-size: 14px; font-weight: 650; margin-bottom: 5px; padding: 0;
}
.champ-ligne { display: flex; gap: 8px; }
.champ-ligne .bouton { flex: none; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.trois { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; }
@media (max-width: 360px) { .deux, .trois { grid-template-columns: 1fr; } }

.fiche-tete { margin-bottom: 14px; }
.fiche-tete h1 { margin: 6px 0 0; }
.retour { font-weight: 650; text-decoration: none; display: inline-flex; align-items: center; min-height: 40px; }
.retour::before { content: ""; width: 9px; height: 9px; border-left: 2.5px solid; border-bottom: 2.5px solid; transform: rotate(45deg); margin-right: 8px; }

.fiche-photo { display: grid; grid-template-columns: 112px 1fr; gap: 14px; margin-bottom: 18px; align-items: start; }
.fiche-photo.seule { grid-template-columns: 112px; }
.photo-bouton {
  width: 112px; height: 112px; padding: 0;
  border: 2px dashed var(--champ-bord); border-radius: 12px; background: var(--surface);
  display: grid; place-content: center; justify-items: center; gap: 4px;
  font-size: 13px; font-weight: 600; color: var(--encre-douce); cursor: pointer; overflow: hidden;
}
.photo-bouton svg { width: 30px; height: 30px; }
.photo-bouton img { width: 112px; height: 112px; object-fit: cover; }
.photo-bouton:has(img) { border-style: solid; border-color: var(--trait); }
.photo-bouton.envoi { opacity: .5; }

.pas { display: flex; align-items: stretch; height: 56px; margin-bottom: 8px; }
.pas button {
  width: 56px; border: 2.5px solid var(--encre); background: var(--fond);
  font-size: 28px; font-weight: 500; line-height: 1; cursor: pointer;
}
.pas button:first-child { border-radius: 10px 0 0 10px; }
.pas button:last-child { border-radius: 0 10px 10px 0; }
.pas input {
  flex: 1; min-width: 0; height: auto !important;
  border-radius: 0 !important; border: 2.5px solid var(--encre) !important; border-left: 0 !important; border-right: 0 !important;
  background: var(--etiquette) !important; color: #000;
  text-align: center; font-size: 28px !important; font-weight: 860; font-stretch: 66%;
}
.unite { height: 40px !important; font-size: 15px !important; }

.plus { border-top: 1px solid var(--trait); border-bottom: 1px solid var(--trait); margin: 6px 0 20px; }
.plus summary { padding: 14px 0; font-weight: 700; cursor: pointer; list-style-position: inside; }
.plus[open] summary { margin-bottom: 4px; }

.alerte-deja, .alerte-doublon, .info-code {
  border-radius: 6px; padding: 12px 14px; margin: -4px 0 16px;
}
.alerte-deja { background: var(--etiquette); color: #000; font-weight: 750; font-size: 18px; }
.alerte-doublon { background: var(--etiquette); color: #000; }
.alerte-doublon p { font-weight: 750; margin-bottom: 6px; }
.alerte-doublon ul { margin: 0; padding-left: 18px; }
.alerte-doublon li { margin: 3px 0; }
.alerte-doublon a { font-weight: 700; }
.alerte-doublon span { font-size: 14px; }
.info-code { background: var(--surface); font-size: 15px; }

.fiche-actions { display: flex; flex-direction: column; gap: 14px; align-items: center; margin-top: 8px; }
.trace { text-align: center; color: var(--encre-douce); font-size: 13.5px; margin-top: 16px; }

.erreur-form { color: var(--peremption); font-weight: 650; min-height: 1.4em; }
.pile { display: flex; flex-direction: column; }
.pile > .bouton { align-self: stretch; }

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  background: var(--encre); color: var(--fond);
  border: 2px solid var(--encre); border-radius: 10px;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer;
}
.bouton svg { width: 24px; height: 18px; }
.bouton-clair { background: var(--fond); color: var(--encre); }
.bouton-large { width: 100%; min-height: 54px; font-size: 17px; }
.bouton:disabled { opacity: .5; }
.bouton-danger {
  background: none; border: 0; color: var(--peremption);
  font-weight: 650; font-size: 15px; padding: 10px; cursor: pointer; text-decoration: underline;
}
#deconnexion { display: block; margin: 34px auto 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Foyer ---------- */

.code-invitation {
  display: inline-block;
  background: var(--etiquette); color: #000;
  font-size: 34px; font-weight: 860; font-stretch: 70%; letter-spacing: .06em;
  padding: 6px 14px; border-radius: 6px; margin: 4px 0 14px;
  user-select: all;
}
.simple { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--trait); }
.simple li { padding: 12px 0; border-bottom: 1px solid var(--trait); font-weight: 600; }

.editable { list-style: none; margin: 0 0 12px; padding: 0; }
.editable li { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--trait); flex-wrap: wrap; }
.editable li > input:not([type="color"]) { flex: 1 1 140px; height: 42px; }
.editable select { flex: 0 1 170px; height: 42px; width: auto; }
.editable input[type="color"] { width: 42px; height: 42px; border: 1.5px solid var(--champ-bord); border-radius: 9px; padding: 3px; background: var(--fond); }
.effacer {
  flex: none; height: 42px; padding: 0 10px;
  background: none; border: 0; color: var(--peremption); font-size: 14px; font-weight: 600; cursor: pointer;
}
.ajout-ligne { display: flex; gap: 8px; }
.ajout-ligne .bouton { flex: none; }

/* ---------- Entrée ---------- */

.entree { padding-top: 6vh; }
.entree .marque {
  display: inline-block; margin: 0 0 18px;
  background: var(--etiquette); color: #000;
  font-size: 64px; line-height: 1; font-weight: 880; font-stretch: 64%;
  padding: 8px 16px 10px; border-radius: 6px;
}
.entree h1 { font-size: 24px; font-stretch: 85%; font-weight: 700; margin-bottom: 24px; max-width: 22ch; }

/* ---------- Barre d'onglets ---------- */

#onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  height: calc(var(--nav-h) + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  padding: 0 4px var(--safe-area-inset-bottom, env(safe-area-inset-bottom));
  background: var(--fond);
  border-top: 1px solid var(--trait);
}
#onglets a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  height: var(--nav-h); text-decoration: none;
  font-size: 12px; font-weight: 600; color: var(--encre-douce);
}
#onglets svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#onglets a[aria-current] { color: var(--encre); font-weight: 800; }
#onglets a[aria-current]::after {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--encre);
}
#onglets .onglet-ajout { color: var(--encre); }
#onglets .onglet-ajout svg {
  width: 46px; height: 38px; padding: 6px 10px;
  background: var(--etiquette); color: #000; stroke: #000; stroke-width: 2.6;
  border: 2px solid var(--encre); border-radius: 10px;
}
#onglets .onglet-ajout[aria-current]::after { display: none; }
.pastille {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--peremption); color: #fff;
  font-size: 11.5px; font-weight: 800; line-height: 19px; text-align: center;
}

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

/* ---------- Message éphémère ---------- */

#message {
  position: fixed; left: 50%; z-index: 40;
  bottom: calc(var(--nav-h) + 14px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  background: var(--encre); color: var(--fond);
  padding: 12px 18px; border-radius: 8px; font-weight: 650;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
}
#message.visible { opacity: 1; transform: translate(-50%, 0); }
#message.erreur { background: var(--peremption); color: #fff; }

/* ---------- Lecteur de code-barres ---------- */

#scanner {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #000; color: #fff;
}
#scanner::backdrop { background: #000; }
#scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viseur {
  position: absolute; left: 50%; top: 38%;
  width: min(78vw, 360px); height: min(40vw, 190px);
  transform: translate(-50%, -50%);
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
  outline: 4px solid var(--etiquette);
}
.scanner-fermer {
  position: absolute; top: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top))); right: 14px;
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; color: #000; border: 0; display: grid; place-items: center; cursor: pointer;
}
.scanner-fermer svg { width: 24px; height: 24px; stroke-width: 2.6; }
.scanner-bas {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 16px calc(22px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  background: #000;
}
.scanner-info { font-weight: 700; font-size: 17px; }
.scanner-saisie label { display: block; font-size: 14px; color: #C5CDD5; margin-bottom: 6px; }
.scanner-saisie input { background: #fff; color: #000; border-color: #fff; }
.scanner-saisie .bouton { background: var(--etiquette); color: #000; border-color: var(--etiquette); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- V2 : IA, inventaire rapide, courses ---------- */

.raccourcis { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: 15px; font-weight: 650; }
.raccourcis a { text-underline-offset: 3px; }
.lien-rapide { display: inline-block; margin-top: 6px; font-weight: 600; font-size: 15px; }

.bandeau-ia { display: block; margin: 18px 0 0; padding: 12px 14px; border-radius: 8px; text-decoration: none; font-weight: 650; }
.bandeau-ia.a-valider { background: var(--etiquette); color: #000; }
.bandeau-ia.a-valider b { font-size: 20px; font-stretch: 70%; font-weight: 860; margin-right: 2px; }
.bandeau-ia.en-cours { background: var(--surface); font-weight: 600; }
.bandeau-ia.erreur { border: 2px solid var(--peremption); color: var(--peremption); }
.pastille-jaune { background: var(--etiquette); color: #000; }

.propositions { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.proposition { border: 2px solid var(--encre); border-radius: 12px; padding: 14px; }
.proposition-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.vignette.grande { width: 84px; height: 84px; border-radius: 8px; }
.proposition-source { font-weight: 700; margin: 0 0 4px; }
.confiance { display: inline-block; margin: 0; font-size: 13px; font-weight: 750; padding: 2px 8px; border-radius: 4px; }
.confiance.haute { background: var(--etiquette); color: #000; }
.confiance.moyenne { background: var(--surface); }
.confiance.basse { background: var(--peremption); color: #fff; }
.proposition-doute { background: var(--surface); padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.proposition-cible { margin-bottom: 12px; }
.proposition-actions { display: flex; align-items: center; gap: 12px; }
.proposition-actions .bouton { flex: 1; }
.proposition .champ { margin-bottom: 12px; }

.erreur-tache, .jeton { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 500 !important; }
.rouge { color: var(--peremption); }
.etat-moteurs li { font-weight: 500; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jeton-affiche { background: var(--etiquette); color: #000; padding: 14px; border-radius: 8px; margin-top: 12px; }
.jeton-affiche code { display: block; word-break: break-all; font-size: 15px; font-weight: 700; margin: 6px 0 10px; }
code { font-size: 14px; word-break: break-all; }
input[type="range"] { width: 100%; height: 36px; accent-color: var(--encre); padding: 0; border: 0; }

details.commande > summary { list-style: none; cursor: pointer; }
details.commande > summary::-webkit-details-marker { display: none; }
details.commande[open] > summary { background: var(--surface); }
details.commande .simple { padding-left: 12px; border-top: 0; }
details.commande .simple li { font-weight: 500; }

/* Rafale photo */
#rafale {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #000; color: #fff;
}
#rafale::backdrop { background: #000; }
#rafale video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#rafale.flash::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: .7; }
.rafale-haut {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(14px + var(--safe-area-inset-top, env(safe-area-inset-top))) 16px 10px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: linear-gradient(#000c, #0000);
}
.rafale-compteur { margin: 0; font-weight: 750; font-size: 17px; }
.rafale-lu { margin: 0; background: var(--etiquette); color: #000; font-weight: 750; font-size: 13px; padding: 4px 8px; border-radius: 4px; }
.rafale-pellicule { position: absolute; right: 12px; bottom: calc(132px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); display: flex; flex-direction: column; gap: 6px; }
.rafale-pellicule img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; border: 2px solid #fff; }
.rafale-pellicule img.code { border-color: var(--etiquette); }
.rafale-bas {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 16px calc(24px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom)));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  background: #000;
}
.rafale-code, .rafale-fin {
  height: 48px; border-radius: 10px; font-weight: 750; font-size: 15px; cursor: pointer;
  border: 2px solid #fff; background: transparent; color: #fff;
}
.rafale-code[aria-pressed="true"] { background: var(--etiquette); border-color: var(--etiquette); color: #000; }
.rafale-fin { background: #fff; color: #000; }
.rafale-declencheur {
  width: 78px; height: 78px; border-radius: 50%; cursor: pointer;
  background: var(--etiquette); border: 6px solid #fff; box-shadow: 0 0 0 2px #000;
}
.rafale-declencheur:active { transform: scale(.94); }

/* ---------- App Android ---------- */

.reglage { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 500 !important; }
.reglage b { font-weight: 700; }
.passer.a-faire { background: var(--etiquette); color: #000; }
.actions-ligne { display: flex; align-items: center; gap: 4px; flex: none; }
.rafale-lampe {
  height: 36px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 2px solid #fff; background: transparent; color: #fff; font-weight: 700; font-size: 14px;
}
.rafale-lampe[aria-pressed="true"] { background: var(--etiquette); border-color: var(--etiquette); color: #000; }
.reglage .discret { margin-left: 0; }
#ici { margin-bottom: 16px; }
