:root { --rouge: #b3141b; --fond: #fff; --texte: #111; --gris: #e9e9e9; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texte); overscroll-behavior: none; }
#carte { position: fixed; inset: 0; }
.bouton { font-size: 22px; border: 0; background: var(--fond); color: var(--texte); box-shadow: 0 2px 8px rgba(0,0,0,.35); cursor: pointer; }
.bouton.rond { width: 56px; height: 56px; border-radius: 50%; font-size: 26px; }
.bouton.actif { background: var(--rouge); color: #fff; }
.bouton.large { min-height: 56px; padding: 0 22px; border-radius: 28px; font-weight: 700; }
#barre { position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 10px; z-index: 5; }
#recherche { flex: 1; height: 56px; font-size: 20px; border: 0; border-radius: 28px; padding: 0 22px; box-shadow: 0 2px 8px rgba(0,0,0,.35); min-width: 0; }
#resultats { position: fixed; top: calc(76px + env(safe-area-inset-top)); left: 10px; right: 10px; max-height: 55vh; overflow: auto; background: #fff; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.4); z-index: 6; }
#resultats .res { display: block; width: 100%; text-align: left; padding: 14px 18px; min-height: 56px; border: 0; border-bottom: 1px solid var(--gris); background: #fff; font-size: 18px; }
#resultats .res small { display: block; color: #666; font-size: 14px; }
#boutons { position: fixed; right: 10px; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; z-index: 5; }
#fiche { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 20px 20px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(0,0,0,.4); z-index: 7; max-height: 60vh; overflow: auto; }
#fiche h2 { margin: 0 40px 4px 0; font-size: 22px; }
#fiche .sous { color: #555; margin-bottom: 10px; font-size: 16px; }
#fiche .fermer { position: absolute; top: 8px; right: 10px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--gris); font-size: 22px; }
#fiche .plan { display: block; width: 100%; margin: 8px 0; min-height: 60px; border: 0; border-radius: 14px; background: var(--rouge); color: #fff; font-size: 20px; font-weight: 700; }
#fiche .plan.second { background: #444; }
#fiche h3 { margin: 14px 0 6px; font-size: 16px; }
#fiche .pei { padding: 8px 0; border-top: 1px solid var(--gris); font-size: 17px; }
#visionneuse, #liste-plans { position: fixed; inset: 0; background: #222; z-index: 20; display: flex; flex-direction: column; }
#visionneuse[hidden], #liste-plans[hidden], #fiche[hidden], #resultats[hidden] { display: none; }
#vis-barre, #lp-barre { display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: #111; color: #fff; }
#vis-titre { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#vis-zone { flex: 1; overflow: hidden; touch-action: none; background: #555; position: relative; }
#vis-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; user-select: none; -webkit-user-drag: none; max-width: none; }
#vis-pages { display: flex; gap: 8px; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); background: #111; }
#vis-pages button { min-height: 44px; min-width: 56px; border-radius: 10px; border: 0; font-size: 18px; }
#lp-filtre { flex: 1; height: 52px; border-radius: 26px; border: 0; padding: 0 20px; font-size: 18px; min-width: 0; }
#lp-corps { flex: 1; overflow: auto; background: #fff; }
#lp-corps button { display: block; width: 100%; text-align: left; padding: 14px 18px; min-height: 56px; border: 0; border-bottom: 1px solid var(--gris); background: #fff; font-size: 18px; }
.marqueur { width: 30px; height: 30px; border-radius: 50%; background: #ffd400; border: 3px solid #b3141b; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.marqueur-pei { width: 22px; height: 22px; border-radius: 4px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); }

#verrou { position: fixed; inset: 0; z-index: 100; background: #b3141b; color: #fff; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; overflow: auto; }
#verrou[hidden] { display: none; }
.v-boite { max-width: 440px; width: 100%; }
.v-boite h1 { margin: 12px 0 0; font-size: 30px; } .v-sous { margin: 4px 0 28px; opacity: .85; font-size: 18px; }
.v-gros { width: 100%; min-height: 76px; font-size: 24px; border-radius: 38px; }
#v-msg { min-height: 48px; font-size: 18px; font-weight: 600; background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px; margin-top: 18px; } #v-msg:empty { background: none; }
#v-install { margin-top: 18px; text-align: left; background: rgba(0,0,0,.2); border-radius: 12px; padding: 12px 16px; font-size: 16px; } #v-install summary { font-weight: 700; cursor: pointer; min-height: 40px; }
#v-cam { position: fixed; inset: 0; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 101; }
#v-cam[hidden] { display: none; } #v-video { width: 100%; max-height: 75vh; object-fit: cover; }
.v-cadre { position: absolute; width: 62vmin; height: 62vmin; border: 4px solid #ffd400; border-radius: 18px; pointer-events: none; }

.v-sec { width: 100%; min-height: 60px; margin-top: 14px; font-size: 20px; background: rgba(255,255,255,.18); color: #fff; box-shadow: none; border: 2px solid #fff; }
#bandeau-demo { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: #ffd400; color: #111; font-weight: 700; font-size: 15px; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#bandeau-demo button { min-height: 40px; border: 0; border-radius: 20px; padding: 0 14px; font-weight: 700; background: #111; color: #fff; }
#bandeau-demo ~ #fiche, body:has(#bandeau-demo) #fiche { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
body:has(#bandeau-demo) #boutons { bottom: calc(70px + env(safe-area-inset-bottom)); }
