:root {
  /* Palette par défaut : couleurs de l'image de référence (vert sapin et jaune). Les autres palettes sont plus bas. */
  --riviere: #205c47;
  --riviere-fonce: #174535;
  --berge: #2a6e52;
  --berge-clair: #e3efe7;
  --berge-texte: #1f5a40;
  --patte: #84a697;
  --paille: #f2b632;
  --paille-fonce: #dea020;
  --papier: #f5f7f2;
  --blanc: #ffffff;
  --encre: #1d2b23;
  --gris: #5a665f;
  --trait: #dbe2dc;
  --texte-clair: #eaefe8;

  --non: #b5452f;
  --non-clair: #f7e4df;
  --reserve: #6a4c93;
  --reserve-clair: #eee7f6;

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --texte: "Figtree", system-ui, sans-serif;
  --largeur: 1180px;
  --rayon: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--riviere-fonce); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--paille); outline-offset: 2px; border-radius: 6px; }
.conteneur { max-width: var(--largeur); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Autres palettes (choisies dans js/palette.js) ---------- */
:root[data-palette="foret"] {
  --riviere: #215c4a; --riviere-fonce: #174536; --berge: #2f7a55; --berge-clair: #e2efe6; --berge-texte: #1f5c3d;
  --patte: #8db89c; --paille: #f2b33d; --paille-fonce: #dea02b; --papier: #f2f4ef; --trait: #d9e0d8;
  --texte-clair: #d8eadf; --encre: #16261f;
}
:root[data-palette="cidre"] {
  --riviere: #7b2d26; --riviere-fonce: #5e211b; --berge: #5f8a3a; --berge-clair: #eaf1df; --berge-texte: #3f6324;
  --patte: #a9c08c; --paille: #f0b847; --paille-fonce: #dca332; --papier: #f5f2ee; --trait: #e2dbd3;
  --texte-clair: #f1dcd6; --encre: #2a1714;
}
:root[data-palette="marine"] {
  --riviere: #23305e; --riviere-fonce: #182246; --berge: #3b6fb6; --berge-clair: #e4ecf7; --berge-texte: #234a85;
  --patte: #9db3d6; --paille: #ff8a65; --paille-fonce: #f0744d; --papier: #f1f3f8; --trait: #d8dde8;
  --texte-clair: #d5dcf0; --encre: #151a2e;
}

:root[data-palette="sauge"] {
  /* Couleurs demandées : sauge #6A7657 et lin #D8D0C2 */
  --riviere: #6a7657; --riviere-fonce: #56603f; --berge: #56603f; --berge-clair: #e6e9de; --berge-texte: #3f4a2f;
  --patte: #a6ae93; --paille: #d8d0c2; --paille-fonce: #c9bfad; --papier: #f1ede6; --trait: #ddd6ca;
  --texte-clair: #f7f5f0; --encre: #23281c; --gris: #5f6457;
}

/* ---------- En-tête du site ---------- */
.site-haut { background: var(--riviere); color: var(--blanc); }
.site-haut .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.marque { display: flex; align-items: center; gap: 10px; color: var(--blanc); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.05rem; line-height: 1.15; }
.marque svg { flex: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--texte-clair); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.nav a:hover { color: var(--blanc); background: rgba(255, 255, 255, 0.08); }
.nav a[aria-current="page"] { background: var(--blanc); color: var(--riviere); }

/* ---------- Hero ---------- */
.hero { background: var(--riviere); color: var(--blanc); position: relative; padding: 40px 0 0; overflow: hidden; }
.hero .conteneur { position: relative; z-index: 1; padding-bottom: 72px; }
.hero h1 { font-size: clamp(2.4rem, 6.4vw, 5rem); font-weight: 800; max-width: 13ch; letter-spacing: -0.03em; }
.hero h1 span { display: block; color: var(--paille); }
.hero .intro { max-width: 62ch; color: var(--texte-clair); font-size: 1.05rem; margin: 20px 0 26px; }
.hero .intro p { margin: 0; }
.hero .intro p + p { margin-top: 0.8em; }
.compteurs { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.compteur { background: rgba(255, 255, 255, 0.09); border-radius: 12px; padding: 10px 18px; font-size: 1rem; }
.compteur strong { font-family: var(--display); color: var(--paille); font-size: 1.5rem; margin-right: 6px; }
.contact-rapide { display: flex; gap: 10px 26px; flex-wrap: wrap; align-items: center; font-weight: 600; }
.contact-rapide a { color: var(--blanc); text-decoration: none; }
.contact-rapide a:hover { text-decoration: underline; }
.bouton-copier { background: rgba(255, 255, 255, 0.14); border: 0; color: var(--blanc); border-radius: 6px; padding: 3px 9px; font-size: 0.8rem; font-weight: 700; cursor: pointer; margin-left: 6px; }
.bouton-copier:hover { background: rgba(255, 255, 255, 0.24); }
.vague { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 56px; display: block; }
.hero-patte { position: absolute; right: -40px; top: 30px; width: 300px; opacity: 0.08; }

/* ---------- Barre de filtres ---------- */
.filtres { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--papier) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait); }
.filtres .conteneur { display: flex; align-items: center; gap: 14px; padding-top: 12px; padding-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.filtres .conteneur::-webkit-scrollbar { display: none; }
.groupe { display: flex; gap: 6px; flex: none; }
.separateur { width: 1px; height: 28px; background: var(--trait); flex: none; }
.puce { border: 1.5px solid var(--trait); background: var(--blanc); border-radius: 999px; padding: 7px 16px; font-weight: 700; font-size: 0.95rem; cursor: pointer; white-space: nowrap; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.puce:hover { border-color: var(--riviere); }
.puce[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--blanc); }
.puce.bascule[aria-pressed="true"] { background: var(--berge); border-color: var(--berge); }
.puce.bascule[aria-pressed="true"]::before { content: "✓ "; }

/* ---------- Liste des animaux ---------- */
.section { padding: 44px 0; }
.section-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-titre h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); font-weight: 800; }
.resultats { color: var(--gris); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }

.carte { background: var(--blanc); border-radius: var(--rayon); overflow: hidden; border: 1px solid var(--trait); display: flex; flex-direction: column; text-align: left; padding: 0; cursor: pointer; width: 100%; }
.carte:hover .carte-photo img { transform: scale(1.04); }
.carte:hover h3 { color: var(--riviere); }
.carte-photo { position: relative; aspect-ratio: 4 / 3; background: var(--berge-clair); display: grid; place-items: center; overflow: hidden; }
.carte-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.carte-photo .vide { width: 64px; color: var(--patte); }
.badges { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; }
.badge { font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 4px 11px; }
.badge.reserve { background: var(--reserve-clair); color: var(--reserve); }
.badge.exemple { background: var(--encre); color: var(--blanc); margin-left: auto; }
.badge.nouveau { background: var(--paille); color: var(--encre); }
.badges-gauche { display: flex; flex-wrap: wrap; gap: 6px; }
.badge.doyen { background: var(--riviere); color: var(--blanc); }
.puce.bascule.doyen[aria-pressed="true"] { background: var(--riviere); border-color: var(--riviere); }
.carte-corps { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.carte h3 { font-size: 1.45rem; font-weight: 800; transition: color 0.15s; }
.carte .infos { color: var(--gris); margin: 0; font-size: 0.98rem; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.etiquette { font-size: 0.82rem; font-weight: 700; border-radius: 6px; padding: 3px 9px; background: var(--berge-clair); color: var(--berge-texte); }
.etiquette.non { background: var(--non-clair); color: var(--non); }
.etiquette.inconnu { background: #edf0ef; color: var(--gris); }

.vide-etat { text-align: center; padding: 60px 20px; background: var(--blanc); border-radius: var(--rayon); border: 1.5px dashed var(--trait); }
.vide-etat h3 { font-size: 1.4rem; margin-bottom: 8px; }
.vide-etat p { color: var(--gris); margin: 0 0 18px; }

/* ---------- Boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; cursor: pointer; text-decoration: none; background: var(--riviere); color: var(--blanc); transition: background 0.15s; }
.bouton:hover { background: var(--riviere-fonce); }
.bouton.secondaire { background: var(--blanc); color: var(--encre); border: 1.5px solid var(--trait); }
.bouton.secondaire:hover { border-color: var(--riviere); }
.bouton.paille { background: var(--paille); color: var(--encre); }
.bouton.paille:hover { background: var(--paille-fonce); }
.bouton.danger { background: var(--blanc); color: var(--non); border: 1.5px solid var(--non-clair); }
.bouton.danger:hover { background: var(--non-clair); }
.bouton.petit { padding: 7px 14px; font-size: 0.9rem; }

/* ---------- Fiche (dialog) ---------- */
dialog.fiche { border: 0; padding: 0; border-radius: 18px; width: min(860px, calc(100% - 32px)); max-height: calc(100% - 32px); background: var(--blanc); color: var(--encre); box-shadow: 0 30px 80px rgba(20, 38, 43, 0.35); }
dialog.fiche::backdrop { background: rgba(20, 38, 43, 0.55); }
dialog.fiche[open] { animation: ouvrir 0.22s ease-out; }
@keyframes ouvrir { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.fiche-grille { display: grid; grid-template-columns: 1fr 1fr; }
.fiche-photo { background: var(--berge-clair); min-height: 320px; display: grid; place-items: center; }
.fiche-photo img { width: 100%; height: 100%; object-fit: cover; }
.fiche-photo .vide { width: 90px; color: var(--patte); }
.fiche-texte { padding: 30px; display: flex; flex-direction: column; gap: 14px; }
.fiche-texte h2 { font-size: 2.2rem; font-weight: 800; }
.fiche-texte dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.fiche-texte dt { color: var(--gris); }
.fiche-texte dd { margin: 0; font-weight: 600; }
.fiche-texte .description { white-space: pre-line; margin: 0; }
.fermer { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--blanc); font-size: 1.4rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15); z-index: 2; }

/* ---------- Pied de page ---------- */
.site-bas { background: var(--encre); color: #b8c6c9; padding: 36px 0; margin-top: 30px; font-size: 0.95rem; }
.site-bas .conteneur { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-bas strong { color: var(--blanc); font-family: var(--display); font-size: 1.1rem; display: block; margin-bottom: 4px; }
.site-bas a { color: var(--texte-clair); }

/* ---------- Page infos ---------- */
.page-titre { background: var(--riviere); color: var(--blanc); position: relative; padding: 40px 0 0; }
.page-titre .conteneur { padding-bottom: 70px; }
.page-titre h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
.page-titre p { color: var(--texte-clair); max-width: 60ch; margin: 12px 0 0; font-size: 1.08rem; }
.infos-grille { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.bloc { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 26px; }
.bloc + .bloc { margin-top: 18px; }
.bloc h2 { font-size: 1.35rem; margin-bottom: 14px; }
.bloc .aide-bloc { color: var(--gris); font-size: 0.92rem; margin: -6px 0 14px; }
.ligne-contact { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--trait); }
.ligne-contact:first-of-type { border-top: 0; padding-top: 0; }
.ligne-contact svg { flex: none; width: 22px; height: 22px; color: var(--berge); margin-top: 3px; }
.ligne-contact .label { color: var(--gris); font-size: 0.88rem; }
.ligne-contact .valeur { font-weight: 700; font-size: 1.08rem; }
.ligne-contact a.valeur { text-decoration: none; color: var(--encre); }
.ligne-contact a.valeur:hover { color: var(--riviere); text-decoration: underline; }
.carte-map { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.carte-map iframe { width: 100%; height: 460px; border: 0; display: block; }
.carte-map .actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px; border-top: 1px solid var(--trait); }
.etapes { margin: 0; padding-left: 1.3em; }
.etapes li { margin-bottom: 10px; }
.etapes li::marker { font-family: var(--display); font-weight: 800; color: var(--berge); }

/* ---------- Page gestion ---------- */
.gestion-grille { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.formulaire { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.formulaire .plein { grid-column: 1 / -1; }
.champ label, .champ legend { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.champ input[type="text"], .champ input[type="number"], .champ input[type="url"], .champ select, .champ textarea {
  width: 100%; border: 1.5px solid var(--trait); border-radius: 10px; padding: 10px 12px; background: var(--blanc);
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: none; border-color: var(--riviere); box-shadow: 0 0 0 3px color-mix(in srgb, var(--riviere) 18%, transparent); }
.champ textarea { min-height: 110px; resize: vertical; }
.champ .aide { color: var(--gris); font-size: 0.85rem; margin-top: 4px; }
.age-ligne { display: flex; gap: 8px; }
.age-ligne input { flex: 1; }
.age-ligne select { width: auto !important; }
fieldset.champ { border: 0; padding: 0; margin: 0; min-width: 0; }
.choix { display: flex; gap: 6px; flex-wrap: wrap; }
.choix label { margin: 0; font-weight: 600; font-size: 0.92rem; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix span { display: inline-block; border: 1.5px solid var(--trait); border-radius: 999px; padding: 6px 14px; cursor: pointer; background: var(--blanc); }
.choix input:checked + span { background: var(--encre); border-color: var(--encre); color: var(--blanc); }
.choix input:focus-visible + span { outline: 3px solid var(--paille); outline-offset: 2px; }
.zone-photo { display: flex; gap: 14px; align-items: center; }
.apercu { width: 110px; height: 82px; border-radius: 10px; background: var(--berge-clair); flex: none; overflow: hidden; display: grid; place-items: center; color: var(--patte); }
.apercu img { width: 100%; height: 100%; object-fit: cover; }
.actions-form { display: flex; gap: 10px; flex-wrap: wrap; }
.liste-gestion { list-style: none; margin: 0; padding: 0; }
.liste-gestion li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--trait); }
.liste-gestion li:first-child { border-top: 0; }
.liste-gestion .mini { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--berge-clair); flex: none; display: grid; place-items: center; color: var(--patte); }
.liste-gestion .mini img { width: 100%; height: 100%; object-fit: cover; }
.liste-gestion .nom { font-weight: 700; }
.liste-gestion .sous { color: var(--gris); font-size: 0.88rem; }
.liste-gestion .boutons { margin-left: auto; display: flex; gap: 6px; }
.note { background: #fff7e3; border: 1px solid #f1dca6; border-radius: 12px; padding: 14px 16px; font-size: 0.93rem; }
.note p { margin: 0 0 8px; }
.note p:last-child { margin: 0; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--encre); color: var(--blanc); padding: 12px 20px; border-radius: 999px; font-weight: 600; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; z-index: 100; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .infos-grille, .gestion-grille { grid-template-columns: minmax(0, 1fr); }
  .fiche-grille { grid-template-columns: 1fr; }
  .fiche-photo { min-height: 240px; max-height: 320px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .conteneur { padding: 0 16px; }
  .site-haut .conteneur { padding-top: 10px; padding-bottom: 10px; }
  .nav a { padding: 6px 10px; }
  .formulaire { grid-template-columns: minmax(0, 1fr); }
  .fiche-texte { padding: 22px; }
  .carte-map iframe { height: 340px; }
  .hero-patte { display: none; }
  .liste-gestion li { flex-wrap: wrap; }
  .liste-gestion .boutons { margin-left: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }
@media (min-width: 1000px) {
  .filtres .conteneur { flex-wrap: wrap; overflow: visible; }
}
.carte .identification { color: var(--gris); font-size: 0.82rem; margin: 0; }
.connexion { max-width: 420px; margin: 0 auto; display: grid; gap: 16px; }
.connexion input { width: 100%; border: 1.5px solid var(--trait); border-radius: 10px; padding: 10px 12px; background: var(--blanc); }
.erreur { color: var(--non); background: var(--non-clair); border-radius: 10px; padding: 10px 12px; margin: 0; font-weight: 600; }
.bouton[disabled] { opacity: 0.6; cursor: wait; }
.map-zone { height: 460px; background: var(--berge-clair); display: grid; place-items: center; }
.map-zone iframe { width: 100%; height: 100%; border: 0; display: block; }
.map-accord { max-width: 420px; padding: 24px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.map-accord p { margin: 0; }
.memoriser { font-size: 0.9rem; color: var(--gris); display: flex; gap: 8px; align-items: center; cursor: pointer; }
@media (max-width: 600px) { .map-zone { height: 340px; } }

/* Mentions légales */
.texte-legal { max-width: 760px; }
.texte-legal h2 { font-size: 1.5rem; margin: 36px 0 12px; }
.texte-legal h2:first-child { margin-top: 0; }
.texte-legal p, .texte-legal ul { margin: 0 0 12px; }
.a-completer { background: #fff1c9; border-radius: 4px; padding: 0 4px; font-weight: 600; }

/* Bouton don */
.nav a.don { background: var(--paille); color: var(--encre); margin-left: 6px; }
.nav a.don:hover { background: var(--paille-fonce); color: var(--encre); }
.hero .actions-don { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .actions-don p { margin: 0; color: var(--texte-clair); font-size: 0.95rem; max-width: 40ch; }

/* Page palettes */
.palettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.palette { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.palette .apercu-palette { padding: 22px 20px 18px; color: #fff; }
.palette .apercu-palette strong { font-family: var(--display); font-size: 1.5rem; display: block; line-height: 1.1; }
.palette .nuancier { display: flex; height: 34px; }
.palette .nuancier span { flex: 1; }
.palette .corps { padding: 16px 20px 20px; display: grid; gap: 12px; }
.palette .corps p { margin: 0; color: var(--gris); font-size: 0.95rem; }

/* Bandeau cookies */
.bandeau-cookies { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 980px; margin: 0 auto; background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: 0 18px 50px rgba(20, 30, 25, 0.25); padding: 20px 22px; display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; animation: ouvrir 0.25s ease-out; }
.bandeau-texte { flex: 1 1 420px; }
.bandeau-texte h2 { font-size: 1.2rem; margin-bottom: 6px; }
.bandeau-texte p { margin: 0; font-size: 0.95rem; color: var(--gris); }
.bandeau-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bandeau-actions .bouton { padding: 10px 18px; }
.cookies-choix { display: grid; gap: 10px; margin-top: 14px; }
.cookies-ligne { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; cursor: pointer; }
.cookies-ligne input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--riviere); }
@media (max-width: 600px) {
  .bandeau-cookies { left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .bandeau-actions { width: 100%; }
  .bandeau-actions .bouton { flex: 1; }
}
a[href^="tel:"] { white-space: nowrap; }

/* Cadrage des photos (Espace refuge) */
.cadrage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.cadrage-titre { margin: 0 0 6px; font-size: 0.85rem; font-weight: 600; color: var(--gris); }
.photo-entiere, .cadrage .apercu { aspect-ratio: 4 / 3; width: 100%; height: auto; border-radius: 10px; overflow: hidden; position: relative; }
.photo-entiere { background: var(--encre); cursor: crosshair; }
.photo-entiere img { width: 100%; height: 100%; object-fit: contain; display: block; }
.photo-entiere .point { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; background: var(--paille); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); pointer-events: none; }
.photo-entiere:focus-visible { outline: 3px solid var(--paille); outline-offset: 2px; }
@media (max-width: 600px) { .cadrage { grid-template-columns: 1fr; } }
.cadrage .apercu { display: block; }
.cadrage .apercu img, .photo-entiere img { position: absolute; inset: 0; }

/* Recadreur de photo (Espace refuge) */
.recadrage { margin-top: 12px; max-width: 520px; }
.recadreur { position: relative; aspect-ratio: 4 / 3; width: 100%; overflow: hidden; border-radius: var(--rayon); background: var(--encre); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.recadreur.en-deplacement { cursor: grabbing; }
.recadreur:focus-visible { outline: 3px solid var(--paille); outline-offset: 3px; }
.recadreur img { position: absolute; max-width: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.recadreur .tiers { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    linear-gradient(to right, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% - 0.5px), rgba(255, 255, 255, 0.45) calc(33.33% + 0.5px), transparent calc(33.33% + 0.5px), transparent calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% - 0.5px), rgba(255, 255, 255, 0.45) calc(66.66% + 0.5px), transparent calc(66.66% + 0.5px)); }
.zoom { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.zoom input[type="range"] { flex: 1; min-width: 0; accent-color: var(--riviere); height: 32px; }
.zoom .bouton.petit { min-width: 40px; min-height: 40px; }
.fiche-photo { aspect-ratio: 4 / 3; min-height: 0; align-self: start; }
@media (max-width: 900px) { .fiche-photo { max-height: none; } }

/* Rien ne doit dépasser la largeur de l'écran (sinon le téléphone dézoome la page). */
.bloc, .champ, .gestion-grille > * { min-width: 0; }
input[type="file"] { max-width: 100%; }
