/* =========================================================
   Espace locataires — styles
   Couleurs : modifiez les variables ci-dessous (clair / sombre).
   ========================================================= */

:root {
  --fond: #F7F6F2;
  --carte: #FFFFFF;
  --bord: #E6E3DA;
  --encre: #1A1814;
  --texte: #3D3830;
  --doux: #6B665C;
  --label: #736D62;
  --chevron: #A8A294;
  --beige: #E7E4D9;
  --beige-texte: #5F5A50;
  --neutre: #F1EFE8;
  --neutre-survol: #E8E5DC;
  --sombre: #1F1B18;
  --sombre-bord: transparent;
  --accent: #2563EB;
  --accent-survol: #1D4ED8;
  --bleu-doux: #EAF0FD;
  --bleu: #1D4ED8;
  --rouge-doux: #FCE9E7;
  --rouge-bord: #F2C4BE;
  --rouge: #B42318;
  --rouge-titre: #9F2A1F;
  --rouge-texte: #7A1F16;
  --vert-doux: #E5F3EA;
  --vert: #1F7A45;
  --vig-fond: #EEEBE4;
  --vig-bord: #E2DDD2;
  --vig-accent: #A4502F;
  --vig-doux: #F5E9E2;
  --vig-geste: #F6F4EF;
  --plan-verre: rgba(255, 255, 255, .92);
  --plan-verre-bord: rgba(26, 24, 20, .08);
  --urgent-fond: #FDF1EE;
  --urgent-bord: #F3D3CB;
  --urgent-doux: #F9DDD5;
  --urgent-texte: #A63A24;
  --vide: #CBC4B5;
  --vide-icone: #8F8778;
  --plan-sol: #ECE8DF;
  --plan-parc: #D8E3CC;
  --plan-eau: #C5DAE8;
  --plan-rue: #FFFFFF;
  --teinte-0: #DCE5D3;
  --teinte-1: #E9E1D2;
  --teinte-2: #E4DED4;
  --teinte-3: #DDE3EA;
  --teinte-4: #E8DEDA;
  --ombre: 0 10px 30px -12px rgba(31, 27, 24, .25);
  --rayon: 28px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --fond: #14120F;
  --carte: #1E1B17;
  --bord: #2F2B25;
  --encre: #F3F1EC;
  --texte: #D6D1C7;
  --doux: #A8A194;
  --label: #A39C8F;
  --chevron: #6E675C;
  --beige: #2A2620;
  --beige-texte: #BDB6A8;
  --neutre: #2A2621;
  --neutre-survol: #35302A;
  --sombre: #0C0B09;
  --sombre-bord: #2F2B25;
  --accent: #2563EB;
  --accent-survol: #3B74F0;
  --bleu-doux: rgba(59, 130, 246, .16);
  --bleu: #93B4F8;
  --rouge-doux: rgba(217, 45, 32, .14);
  --rouge-bord: rgba(242, 160, 150, .28);
  --rouge: #C8281C;
  --rouge-titre: #FCA19B;
  --rouge-texte: #F6C9C4;
  --vert-doux: rgba(31, 122, 69, .22);
  --vert: #6FCF97;
  --vig-fond: #1A1814;
  --vig-bord: #2C2822;
  --vig-accent: #E39A78;
  --vig-doux: rgba(227, 154, 120, .14);
  --vig-geste: #25211C;
  --plan-verre: rgba(30, 27, 23, .88);
  --plan-verre-bord: rgba(255, 255, 255, .08);
  --urgent-fond: #2A1B17;
  --urgent-bord: #4A2C24;
  --urgent-doux: rgba(232, 128, 104, .16);
  --urgent-texte: #F2A493;
  --vide: #2E2A24;
  --vide-icone: #6E675C;
  --plan-sol: #23201B;
  --plan-parc: #27301F;
  --plan-eau: #1D2A33;
  --plan-rue: #34302A;
  --teinte-0: #263022;
  --teinte-1: #2E2921;
  --teinte-2: #2B2722;
  --teinte-3: #232A31;
  --teinte-4: #2F2624;
  --ombre: 0 10px 30px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p, ol { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.ico { flex: none; }
.attenue { color: var(--chevron); }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---------- En-tête ---------- */
.entete { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.entete-texte { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--beige); color: var(--encre);
  display: grid; place-items: center; margin-bottom: 12px;
}
.titre { font-size: 44px; line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; }
.sous-titre { font-size: 17px; color: var(--doux); }
.btn-rond {
  flex: none; width: 48px; height: 48px; border-radius: 999px;
  border: 1px solid var(--bord); background: var(--carte); color: var(--encre);
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s ease;
}
.btn-rond:hover { background: var(--neutre); }
.entete-actions { flex: none; display: flex; gap: 8px; }
.btn-langue { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-decoration: none; }
.connexion-langue {
  align-self: center; margin-top: -6px; font-size: 14px; font-weight: 600;
  color: var(--doux); text-decoration: none;
}
.connexion-langue:hover { color: var(--encre); text-decoration: underline; }
.ico-soleil { display: none; }
[data-theme="dark"] .ico-soleil { display: block; }
[data-theme="dark"] .ico-lune { display: none; }

/* ---------- Grille bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(250px, auto);
  gap: 20px;
}
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span4 { grid-column: 1 / -1; }

.carte {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
  min-width: 0;
}
.lift { transition: transform .2s ease, box-shadow .2s ease; }
@media (hover: hover) {
  .lift:hover { transform: translateY(-2px); box-shadow: var(--ombre); }
}
.label {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--label);
}
.label-clair { color: #FFFFFF; }
.pile { display: flex; flex-direction: column; gap: 18px; }
.pile-serree { display: flex; flex-direction: column; gap: 6px; }
.carte-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.carte-titre { margin-top: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.vide { color: var(--doux); font-size: 15px; }
.vide-grand { padding: 48px 0; text-align: center; font-size: 17px; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: 16px;
  font-size: 15px; font-weight: 700; border: 0; cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.bouton-petit { min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 14px; gap: 6px; }
.bouton-neutre { background: var(--neutre); color: var(--encre); }
.bouton-neutre:hover { background: var(--neutre-survol); }
.bouton-contour { background: var(--carte); border: 1px solid var(--bord); border-radius: 999px; min-height: 44px; padding: 0 16px 0 12px; font-size: 14px; font-weight: 600; }
.bouton-contour:hover { background: var(--neutre); }
.bouton-retour { margin-bottom: 14px; }
.bouton-blanc { align-self: flex-start; background: #FFFFFF; color: var(--accent); min-height: 44px; border-radius: 14px; font-size: 14px; }
.bouton-urgent { background: var(--rouge); color: #FFFFFF; min-height: 44px; border-radius: 12px; font-size: 14px; padding: 0 16px; }
.bouton-urgent:hover { filter: brightness(1.08); }

/* ---------- Photo (hero) ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--rayon);
  background: var(--vide);
  min-height: 380px;
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
@media (hover: hover) { .hero:hover .hero-img { transform: scale(1.03); } }
.hero-vide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: var(--vide-icone); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.hero-texte {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 72px 32px 32px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  background: linear-gradient(to top, rgba(20, 17, 14, .72), rgba(20, 17, 14, 0));
}
.hero-texte h2 { color: #FFFFFF; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.pastille {
  background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #FFFFFF; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Contact ---------- */
.carte-contact { justify-content: space-between; gap: 20px; }
.contact-nom { display: flex; flex-direction: column; gap: 2px; }
.contact-nom strong { font-size: 18px; font-weight: 700; }
.contact-nom span { font-size: 14px; color: var(--doux); }
.contact-liens { display: flex; flex-direction: column; gap: 6px; }
.ligne { display: flex; align-items: center; gap: 12px; min-height: 48px; border-radius: 14px; }
.ligne:hover .ligne-texte { color: var(--accent); }
.ligne-texte { font-size: 15px; font-weight: 600; min-width: 0; transition: color .2s ease; }
.coupe { overflow-wrap: break-word; min-width: 0; }

.pastille-ico {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
}
.pastille-ico.bleu { background: var(--bleu-doux); color: var(--bleu); }
.pastille-ico.rouge { background: var(--rouge-doux); color: var(--rouge-titre); }
.pastille-ico.vert { background: var(--vert-doux); color: var(--vert); }

/* ---------- Documents ---------- */
.liste-docs { display: flex; flex-direction: column; gap: 4px; }
.doc { display: flex; align-items: center; gap: 12px; min-height: 56px; border-radius: 14px; }
.doc-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-titre { font-size: 15px; font-weight: 600; }
.doc-type { font-size: 12px; color: var(--label); }
.doc .chevron { color: var(--chevron); transition: transform .2s ease, color .2s ease; }
a.doc:hover .chevron { transform: translateX(3px); color: var(--encre); }
a.doc:hover .doc-titre { color: var(--accent); }
.doc.indispo .pastille-ico { filter: grayscale(1); opacity: .6; }
.doc.indispo .doc-titre { color: var(--doux); }

/* ---------- Notices (carte sombre) ---------- */
.carte-sombre {
  background: var(--sombre); border-color: var(--sombre-bord);
  color: #FFFFFF; justify-content: space-between; gap: 22px;
}
.carte-sombre-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.carte-sombre-tete .attenue { color: rgba(255, 255, 255, .6); }
.carte-sombre-titre { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; color: #FFFFFF; }
.carte-sombre-sous { margin-top: 6px; font-size: 14px; color: rgba(255, 255, 255, .66); }
.notices {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 24px;
  grid-template-rows: repeat(var(--lignes, 1), auto); grid-auto-flow: column;
}
.notice {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 6px 10px; margin: 0 -10px; border-radius: 14px;
  transition: background .2s ease;
}
.notice:hover { background: rgba(255, 255, 255, .07); }
.notice-ico {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .75);
  display: grid; place-items: center;
}
.notice-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.notice-appareil { font-size: 15px; font-weight: 600; color: #FFFFFF; }
.notice-modele { font-size: 12px; color: rgba(255, 255, 255, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-fleche { color: rgba(255, 255, 255, .4); transition: color .2s ease, transform .2s ease; }
.notice:hover .notice-fleche { color: #FFFFFF; transform: translate(2px, -2px); }

/* ---------- Page d'une vidéo de notice ---------- */
.video-page { display: flex; flex-direction: column; gap: 16px; }
.video-lecteur {
  display: block; width: 100%; max-height: 75vh;
  background: #000; border-radius: 22px;
}
.video-youtube { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.video-youtube p { flex: 1; min-width: 240px; font-size: 14px; line-height: 1.5; color: var(--doux); }

/* ---------- Plan ---------- */
.carte-plan {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--rayon); border: 1px solid var(--bord);
  background: var(--plan-sol); min-height: 250px;
}
.plan-fond { position: absolute; inset: 0; width: 100%; height: 100%; }
.pf-sol { fill: var(--plan-sol); }
.pf-parc { fill: var(--plan-parc); }
.pf-eau { stroke: var(--plan-eau); }
.pf-rue { stroke: var(--plan-rue); }
.plan-leaflet { position: absolute; inset: 0; z-index: 1; background: transparent; }
.plan-leaflet.leaflet-container { background: var(--plan-sol); font-family: inherit; }
/* Plan « papier » : monochrome chaud, la punaise bleue ressort */
.plan-leaflet .leaflet-tile-pane { filter: grayscale(1) sepia(.18) brightness(1.04) contrast(.88); }
[data-theme="dark"] .plan-leaflet .leaflet-tile-pane { filter: grayscale(1) invert(1) sepia(.12) brightness(.82) contrast(.92); }
.plan-leaflet .leaflet-control-attribution {
  font-size: 10px; color: var(--doux); background: var(--plan-verre);
  border-radius: 0 0 0 8px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.plan-leaflet .leaflet-control-attribution a { color: inherit; text-decoration: underline; }
.plan-pin-statique { position: absolute; inset: 0; display: grid; place-items: center; z-index: 0; pointer-events: none; }
.carte-ok + .plan-pin-statique { display: none; }
.pin {
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--accent); color: #FFFFFF;
  display: grid; place-items: center;
  box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 14px rgba(37, 99, 235, .18), 0 8px 18px -4px rgba(26, 24, 20, .35);
}
.pin-leaflet { background: none; border: 0; }
.plan-ville, .plan-bouton { position: absolute; z-index: 1001; }
.plan-ville {
  top: 16px; left: 16px;
  background: var(--plan-verre); color: var(--encre); border: 1px solid var(--plan-verre-bord);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 10px;
}
.plan-bouton {
  left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border-radius: 14px; background: var(--plan-verre); color: var(--encre); border: 1px solid var(--plan-verre-bord);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 6px 20px -8px rgba(26, 24, 20, .3);
  font-size: 14px; font-weight: 700;
  transition: background .2s ease;
}
.plan-bouton:hover { background: var(--carte); }

/* ---------- Points de vigilance ---------- */
.vigilance {
  background: var(--vig-fond); border: 1px solid var(--vig-bord);
  border-radius: var(--rayon); padding: 32px;
  display: flex; flex-direction: column; gap: 28px; min-width: 0;
}
.vig-entete { display: flex; align-items: center; gap: 16px; }
.vig-entete-ico {
  width: 56px; height: 56px; flex: none; border-radius: 18px;
  background: var(--encre); color: var(--fond);
  display: grid; place-items: center;
}
.vig-titre { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.vig-sous { font-size: 15px; color: var(--doux); }

.vig-cartes {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.vig-carte {
  background: var(--carte); border: 1px solid var(--vig-bord); border-radius: 22px;
  padding: 22px; min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
}
.vig-carte-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.vig-ico {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  background: var(--vig-doux); color: var(--vig-accent);
  display: grid; place-items: center;
}
.vig-lieu {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--doux); background: var(--neutre);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.vig-corps { display: flex; flex-direction: column; gap: 4px; }
.vig-carte-titre { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.vig-constat { font-size: 14px; line-height: 1.55; color: var(--doux); }
.vig-geste {
  margin-top: auto;
  background: var(--vig-geste); border-left: 3px solid var(--vig-accent);
  border-radius: 4px 14px 14px 4px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.vig-geste-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--vig-accent);
}
.vig-geste p { font-size: 14px; line-height: 1.5; font-weight: 500; color: var(--encre); }

/* Carte urgente : grande et en premier, dans un rose doux */
.vig-carte.urgent {
  grid-row: span 2;
  background: var(--urgent-fond); border-color: var(--urgent-bord);
  padding: 28px; gap: 18px;
}
.vig-carte.urgent .vig-ico { width: 60px; height: 60px; border-radius: 18px; background: var(--urgent-doux); color: var(--urgent-texte); }
.vig-carte.urgent .vig-lieu { background: var(--urgent-doux); color: var(--urgent-texte); }
.vig-carte.urgent .vig-corps { gap: 8px; }
.vig-carte.urgent .vig-carte-titre { font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; }
.vig-carte.urgent .vig-constat { font-size: 15px; }
.vig-carte.urgent .vig-geste { margin-top: 0; background: var(--carte); }
.vig-carte.urgent .vig-geste-label { color: var(--urgent-texte); }
.bouton-urgence {
  width: 100%; min-height: 52px; border-radius: 16px;
  background: var(--carte); border: 1px solid var(--urgent-bord);
  color: var(--urgent-texte); font-size: 15px;
}
.bouton-urgence:hover { background: var(--urgent-doux); }

/* ---------- Galerie (aperçu sur le tableau de bord) ---------- */
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 14px 12px; }
.vignette { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vignette-img {
  aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; margin-bottom: 6px;
  display: grid; place-items: center; color: var(--vide-icone);
}
.vignette-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
@media (hover: hover) { .vignette:hover .vignette-img img { transform: scale(1.06); } }
.vignette-nom { font-size: 14px; font-weight: 600; }
.vignette-nb { font-size: 12px; color: var(--label); }
.teinte-0 { background: var(--teinte-0); }
.teinte-1 { background: var(--teinte-1); }
.teinte-2 { background: var(--teinte-2); }
.teinte-3 { background: var(--teinte-3); }
.teinte-4 { background: var(--teinte-4); }

/* ---------- Tuiles ménage / gestion locative ---------- */
.pile-tuiles { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.pile-tuiles > .tuile { flex: 1; gap: 16px; }
.tuile {
  border-radius: var(--rayon); padding: 28px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-width: 0;
}
.tuile-beige { background: var(--beige); color: var(--encre); }
.tuile-tete { display: flex; justify-content: space-between; align-items: flex-start; }
.tuile-ico { width: 48px; height: 48px; border-radius: 999px; background: var(--carte); display: grid; place-items: center; }
.tuile-titre { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.tuile-texte { font-size: 14px; line-height: 1.5; color: var(--beige-texte); }
.tuile-accent { background: var(--accent); color: #FFFFFF; }
.tuile-accent .tuile-texte { color: #FFFFFF; }
a.tuile-accent:hover { background: var(--accent-survol); }

/* ---------- Page de connexion ---------- */
.connexion { min-height: calc(100vh - 220px); display: grid; place-items: center; }
.connexion-carte { width: 100%; max-width: 400px; gap: 22px; box-shadow: var(--ombre); }
.connexion-logo {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--beige); color: var(--encre); display: grid; place-items: center;
}
.connexion-titre { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.connexion-sous { font-size: 15px; color: var(--doux); }
.connexion-champ { display: flex; flex-direction: column; gap: 8px; }
.connexion-champ input {
  min-height: 52px; padding: 0 16px; border-radius: 16px;
  border: 1px solid var(--bord); background: var(--fond); color: var(--encre);
  font: inherit; font-size: 16px;
}
.connexion-champ input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.connexion-champ input[aria-invalid="true"] { border-color: var(--rouge); }
.connexion-erreur { margin-top: -8px; font-size: 14px; font-weight: 600; color: var(--rouge-titre); }
.bouton-plein { width: 100%; background: var(--accent); color: #FFFFFF; }
.bouton-plein:hover { background: var(--accent-survol); }

/* ---------- Pied de page ---------- */
.pied { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding-top: 8px; }
.pied-lien { font-size: 14px; font-weight: 600; }
.pied-lien:hover { color: var(--accent); }

/* ---------- Page galerie ---------- */
.onglets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -8px; }
.onglet {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 999px; background: var(--carte); border: 1px solid var(--bord);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .2s ease;
}
.onglet:hover { background: var(--neutre); }
.onglet[aria-current="page"] { background: var(--encre); border-color: var(--encre); color: var(--fond); font-weight: 700; }

.grille-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.carte-piece {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon);
  overflow: hidden; display: flex; flex-direction: column;
}
.carte-piece-img { aspect-ratio: 4 / 3; display: grid; place-items: center; color: var(--vide-icone); overflow: hidden; }
.carte-piece-img img { width: 100%; height: 100%; object-fit: cover; }
.carte-piece-texte { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 2px; }
.carte-piece-nom { font-size: 18px; font-weight: 700; }
.carte-piece-nb { font-size: 13px; color: var(--label); }

.grille-medias { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.media {
  position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden;
  background: var(--vide); display: block;
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
@media (hover: hover) { .media:hover img, .media:hover video { transform: scale(1.04); } }
.badge-video {
  position: absolute; top: 12px; left: 12px;
  background: rgba(31, 27, 24, .8); color: #FFFFFF;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 8px;
}
.bouton-lecture {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 999px;
  background: rgba(31, 27, 24, .8); color: #FFFFFF;
  display: grid; place-items: center; padding-left: 3px;
}

/* ---------- Page « Points de propreté » ---------- */
.progression-carte { gap: 16px; margin-bottom: 20px; }
.progression-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.progression-chiffre { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.progression-unite { font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--doux); }
.progression-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.progression-actions .bouton-contour { padding: 0 16px; }
.barre { height: 12px; border-radius: 999px; background: var(--neutre); overflow: hidden; }
.barre-remplie { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--vert); transition: width .35s ease; }
.progression-note { font-size: 14px; color: var(--doux); }
.progression-carte.termine { background: var(--vert-doux); border-color: transparent; }
.progression-carte.termine .progression-note { color: var(--vert); font-weight: 700; }

.proprete-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.rubrique { gap: 14px; }
.rubrique-tete { display: flex; align-items: center; gap: 14px; }
.rubrique-ico {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  background: var(--beige); color: var(--encre); display: grid; place-items: center;
}
.rubrique-titre { flex: 1; min-width: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.rubrique-compteur {
  flex: none; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 999px; background: var(--neutre); color: var(--doux);
  transition: background .2s ease, color .2s ease;
}
.rubrique.complete .rubrique-compteur { background: var(--vert-doux); color: var(--vert); }
.taches { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tache {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 44px; padding: 10px 12px; margin: 0 -12px; border-radius: 14px;
  font-size: 15px; line-height: 1.45; cursor: pointer;
  transition: background .2s ease;
}
.tache:hover { background: var(--neutre); }
.tache input {
  -webkit-appearance: none; appearance: none;
  flex: none; width: 22px; height: 22px; margin: 0;
  border: 2px solid var(--chevron); border-radius: 7px; background: var(--carte);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.tache input::after {
  content: ''; width: 10px; height: 5px; margin-top: -2px;
  border: 2.5px solid var(--fond); border-top: 0; border-right: 0;
  transform: rotate(-45deg) scale(0); transition: transform .15s ease;
}
.tache input:checked { background: var(--vert); border-color: var(--vert); }
.tache input:checked::after { transform: rotate(-45deg) scale(1); }
.tache input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tache input:checked + span { color: var(--doux); text-decoration: line-through; text-decoration-color: var(--chevron); }

/* ---------- Visionneuse ---------- */
html.vis-ouverte { overflow: hidden; }
.visionneuse {
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(14, 12, 10, .97); color: #FFFFFF;
}
.visionneuse[open] { display: flex; flex-direction: column; }
.visionneuse::backdrop { background: rgba(14, 12, 10, .6); }
.vis-barre { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.vis-legende { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .8); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vis-actions { display: flex; gap: 8px; flex: none; }
.vis-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, .12); color: #FFFFFF;
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s ease;
}
.vis-btn:hover { background: rgba(255, 255, 255, .22); }
.vis-corps { flex: 1; min-height: 0; display: flex; align-items: center; gap: 16px; padding: 0 16px 24px; position: relative; }
.vis-nav { flex: none; width: 48px; height: 48px; }
.vis-scene { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.vis-scene img, .vis-scene video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }

/* ---------- Adaptation tablette / mobile ---------- */
@media (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span3, .pile-tuiles { grid-column: 1 / -1; }
  .pile-tuiles { flex-direction: row; }
  .hero { min-height: 0; aspect-ratio: 16 / 10; }
  .vig-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vig-carte.urgent { grid-column: 1 / -1; grid-row: auto; }
  .grille-medias { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .page { padding: 28px 16px 40px; gap: 28px; }
  .titre { font-size: 32px; }
  .sous-titre { font-size: 15px; }
  .bento { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .span2 { grid-column: auto; }
  .hero { aspect-ratio: 4 / 3; }
  .hero-texte { padding: 56px 24px 24px; }
  .hero-texte h2 { font-size: 24px; }
  .carte, .tuile { padding: 24px; }
  .pile-tuiles { gap: 16px; flex-direction: column; }
  .notices { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .proprete-grille { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .progression-chiffre { font-size: 32px; }
  .carte-plan { min-height: 280px; }
  .vigilance { padding: 20px; gap: 20px; }
  .vig-entete-ico { width: 48px; height: 48px; border-radius: 15px; }
  .vig-titre { font-size: 22px; }
  .vig-sous { font-size: 14px; }
  .vig-cartes { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .vig-carte { padding: 20px; }
  .vig-carte.urgent { padding: 22px; }
  .vig-carte.urgent .vig-carte-titre { font-size: 22px; }
  .vignettes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grille-medias { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .media { border-radius: 14px; }
  .onglets { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .onglets::-webkit-scrollbar { display: none; }
  .vis-corps { padding: 0 0 16px; }
  .vis-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; background: rgba(0, 0, 0, .45); }
  .vis-prec { left: 8px; }
  .vis-suiv { right: 8px; }
  .vis-scene img, .vis-scene video { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
