/* Feugarde : feuille de style de l'app.
   Couleur unique : le rose du retardant largué sur les feux, qui est aussi la couleur des zones OLD sur Géoportail. */
@font-face { font-family: 'Schibsted Grotesk'; src: url('../fonts/schibsted-grotesk.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('../fonts/martian-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --encre: #101513;
  --encre-2: #2A302D;
  --gris: #6B706D;
  --trait: #E3E5E1;
  --cendre: #F4F5F2;
  --blanc: #FFFFFF;
  --nuit: #0B0F0E;
  --nuit-2: #151B19;
  --gris-nuit: #9BA09C;
  --retardant: #D61F57;
  --retardant-texte: #C8174F;
  --retardant-nuit: #FF5C8A;
  --retardant-voile: #FDE7EE;
  --ok: #2E7D57;
  --ok-voile: #E3F1EA;
  --attention: #9A5B00;
  --attention-voile: #FFF2DC;
  --texte: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Martian Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --rayon: 14px;
  --ombre: 0 1px 2px rgba(16, 21, 19, .06), 0 12px 32px rgba(16, 21, 19, .12);
  --panneau-l: 420px;
  --barre-h: 56px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--texte);
  font-size: 16px;
  line-height: 1.5;
  color: var(--encre);
  background: var(--nuit);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--retardant-texte); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--retardant); outline-offset: 2px; border-radius: 6px; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--blanc); padding: 10px 14px; border-radius: 10px; }
.evitement:focus { top: 12px; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; letter-spacing: -.01em; }

/* ---------- Accueil ---------- */
.accueil {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background: radial-gradient(120% 90% at 70% 30%, #17201D 0%, var(--nuit) 60%);
  color: var(--blanc);
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  transition: opacity .6s var(--ease), visibility .6s;
}
.accueil.sortie { opacity: 0; visibility: hidden; }
.accueil-fond { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.accueil-anneau { width: min(150vmin, 1100px); height: auto; opacity: .55; transform: translate(30%, -6%); }
@media (max-width: 700px) { .accueil-anneau { transform: translate(34%, -30%); opacity: .4; } }
.anneau-trace { fill: none; stroke: var(--retardant); stroke-width: 1.6; stroke-dasharray: 943; stroke-dashoffset: 943; animation: tracer 2.6s .3s var(--ease) forwards; }
.anneau-graduations line { stroke: rgba(255, 255, 255, .22); stroke-width: 1; }
.anneau-graduations line.forte { stroke: rgba(255, 255, 255, .5); stroke-width: 1.4; }
.anneau-maison { fill: rgba(255, 255, 255, .16); opacity: 0; animation: apparaitre .8s 1.6s var(--ease) forwards; }
@keyframes tracer { to { stroke-dashoffset: 0; } }
@keyframes apparaitre { to { opacity: 1; } }

.accueil-contenu { position: relative; width: min(100%, 640px); }
.marque { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 48px; font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.accueil h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 8.4vw, 84px);
  line-height: .98;
  letter-spacing: -.045em;
  font-weight: 800;
  text-wrap: balance;
}
.accueil-chapo { margin: 0 0 36px; font-size: clamp(17px, 2.2vw, 20px); line-height: 1.5; color: #C9CDCA; max-width: 34em; text-wrap: pretty; }

.recherche { position: relative; }
.champ {
  display: flex; align-items: center; gap: 10px;
  background: var(--blanc); color: var(--encre);
  border-radius: 999px; padding: 6px 6px 6px 18px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 18px 50px rgba(0, 0, 0, .45);
}
.champ:focus-within { box-shadow: 0 0 0 3px var(--retardant), 0 18px 50px rgba(0, 0, 0, .45); }
.champ-icone { width: 22px; height: 22px; color: var(--retardant); flex: none; }
.champ input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 12px 0; }
.champ input::placeholder { color: #8B908C; }
.bouton-chercher { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--retardant); color: var(--blanc); display: grid; place-items: center; transition: transform .2s var(--ease), background .2s; }
.bouton-chercher svg { width: 22px; height: 22px; }
.bouton-chercher:hover { background: var(--retardant-texte); transform: translateX(2px); }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 5;
  margin: 0; padding: 6px; list-style: none;
  background: var(--blanc); color: var(--encre); border-radius: 18px; box-shadow: var(--ombre);
}
.suggestions li { padding: 12px 14px; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; }
.suggestions li small { color: var(--gris); font-size: 13px; }
.suggestions li small strong { color: var(--encre); font-weight: 650; }
.suggestions li[aria-selected='true'], .suggestions li:hover { background: var(--cendre); }
.recherche-message { min-height: 1.5em; margin: 12px 4px 0; font-size: 14px; color: var(--retardant-nuit); }
.lien-exemple { margin-top: 8px; padding: 10px 0; text-align: left; border: 0; background: none; color: var(--blanc); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 5px; }
.lien-exemple:hover { text-decoration-color: var(--retardant-nuit); }
.accueil-note { margin: 40px 0 0; font-size: 13px; color: var(--gris-nuit); max-width: 36em; }

/* ---------- Carte ---------- */
.carte { position: fixed; inset: 0; background: #1B211F; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--panneau-bas, 0px)); }
.etiquette-parcelle {
  font-family: var(--mono); font-size: 11px; line-height: 1.25; font-weight: 600;
  background: rgba(16, 21, 19, .82); color: var(--blanc);
  padding: 5px 8px; border-radius: 8px; white-space: nowrap;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .18);
  pointer-events: none; transform-origin: center; animation: etiquette .5s var(--ease) both;
}
.etiquette-parcelle span { display: block; font-weight: 400; color: #FFB3C7; }
.etiquette-parcelle.chez-soi { background: var(--blanc); color: var(--encre); border-color: transparent; }
.etiquette-parcelle.chez-soi span { color: var(--retardant-texte); }
@keyframes etiquette { from { opacity: 0; transform: translateY(6px) scale(.96); } }

/* ---------- Barre ---------- */
.barre {
  position: fixed; z-index: 20; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top));
  display: flex; align-items: center; gap: 10px; pointer-events: none;
}
.barre > * { pointer-events: auto; }
.barre-marque {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 10px;
  border: 0; border-radius: 999px; background: var(--blanc); font-weight: 800; letter-spacing: -.02em; box-shadow: var(--ombre);
}
.barre-adresse {
  margin: 0; min-width: 0; flex: 0 1 auto; height: 44px; display: flex; align-items: center; padding: 0 16px;
  border-radius: 999px; background: rgba(16, 21, 19, .78); color: var(--blanc); font-size: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.barre-actions { margin-left: auto; display: flex; gap: 8px; }
.pastille {
  height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--trait);
  background: var(--blanc); font-size: 14px; font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}
.pastille[aria-pressed='true'] { background: var(--encre); color: var(--blanc); border-color: var(--encre); }

/* ---------- Relevé (chargement) ---------- */
.releve {
  position: fixed; z-index: 25; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 420px); padding: 22px 22px 18px; border-radius: 20px;
  background: rgba(11, 15, 14, .9); color: var(--blanc); box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.releve-titre { margin: 0 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--retardant-nuit); }
.releve-lignes { margin: 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 12.5px; }
.releve-lignes li { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); color: var(--gris-nuit); animation: etiquette .4s var(--ease) both; }
.releve-lignes li b { color: var(--blanc); font-weight: 600; min-width: 9.5em; }
.releve-lignes li .val { margin-left: auto; text-align: right; }
.releve-lignes li.fait .val { color: var(--blanc); }
.releve-lignes li.erreur .val { color: var(--retardant-nuit); }

/* ---------- Panneau ---------- */
.panneau {
  position: fixed; z-index: 15; left: 0; right: 0; bottom: 0;
  height: var(--panneau-h, 54vh); max-height: calc(100% - var(--barre-h) - 24px);
  display: flex; flex-direction: column;
  background: var(--blanc); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
  transition: height .45s var(--ease), transform .45s var(--ease);
  outline: none;
}
.panneau.plein { --panneau-h: calc(100% - var(--barre-h) - 24px); }
.panneau.replie { --panneau-h: 168px; }
.poignee { flex: none; height: 26px; border: 0; background: none; display: grid; place-items: center; touch-action: none; }
.poignee span { width: 44px; height: 5px; border-radius: 3px; background: #CDD1CD; }
.onglets { flex: none; display: flex; gap: 4px; padding: 0 12px 10px; border-bottom: 1px solid var(--trait); overflow-x: auto; scrollbar-width: none; }
.onglet {
  flex: 1 0 auto; position: relative; height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: none;
  font-size: 15px; font-weight: 600; color: var(--gris); white-space: nowrap;
}
.onglet[aria-current='page'] { background: var(--encre); color: var(--blanc); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 10px; background: var(--retardant); color: var(--blanc); font-size: 12px; font-family: var(--mono); }
.vues { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.vue { padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); }
.vue.entree { animation: vue .35s var(--ease) both; }
@keyframes vue { from { opacity: 0; transform: translateY(8px); } }

@media (min-width: 900px) {
  .panneau {
    left: 16px; top: calc(var(--barre-h) + 28px); bottom: 16px; right: auto;
    width: var(--panneau-l); height: auto; max-height: none; border-radius: 22px; box-shadow: var(--ombre);
  }
  .panneau.plein, .panneau.replie { --panneau-h: auto; }
  .poignee { display: none; }
  .onglets { padding-top: 12px; }
  .barre-adresse { max-width: 420px; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}

/* ---------- Contenus des vues ---------- */
.surtitre { margin: 0 0 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gris); }
.vue h2 { margin: 0 0 10px; font-size: 26px; line-height: 1.1; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
.vue h3 { margin: 28px 0 10px; font-size: 17px; letter-spacing: -.015em; }
.vue p { margin: 0 0 12px; text-wrap: pretty; }
.discret { color: var(--gris); font-size: 14px; }

.statut { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: var(--rayon); background: var(--cendre); margin-bottom: 20px; }
.statut p { margin: 0; font-size: 14.5px; }
.statut a { font-weight: 600; }
.statut-pastille { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.statut-pastille::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.statut.concerne { background: var(--retardant-voile); }
.statut.concerne .statut-pastille { background: var(--retardant); color: var(--blanc); }
.statut.concerne .statut-pastille::before { background: var(--blanc); }
.statut.hors-zone .statut-pastille { background: var(--blanc); color: var(--encre); border: 1px solid var(--trait); }
.statut.alerte { background: var(--attention-voile); }
.statut.alerte .statut-pastille { background: var(--attention); color: var(--blanc); }

.chiffre { margin: 4px 0 2px; font-family: var(--mono); font-weight: 600; font-size: clamp(44px, 12vw, 58px); line-height: 1; letter-spacing: -.06em; font-feature-settings: 'tnum'; }
.chiffre small { font-size: .42em; letter-spacing: -.02em; margin-left: 6px; font-weight: 600; font-family: var(--texte); }
.chiffre-legende { margin: 6px 0 16px; color: var(--gris); font-size: 14.5px; }

.repartition { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--cendre); margin: 0 0 10px; }
.repartition span { height: 100%; transition: flex-basis .8s var(--ease); }
.repartition .r-soi { background: var(--retardant); }
.repartition .r-voisins { background: repeating-linear-gradient(45deg, var(--retardant) 0 3px, #F7B6C8 3px 6px); }
.repartition .r-public { background: #C9CDCA; }
.legende-repartition { display: grid; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 14px; }
.legende-repartition li { display: flex; align-items: center; gap: 8px; }
.legende-repartition i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legende-repartition .val { margin-left: auto; font-family: var(--mono); font-size: 13px; }

.precision { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; margin: -10px 0 20px; font-size: 13px; line-height: 1.45; color: var(--gris); }
.precision .mono { font-size: 12px; font-weight: 600; color: var(--encre); background: var(--cendre); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.reglages { display: grid; gap: 10px; margin: 0 0 8px; }
.reglage { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--trait); border-radius: var(--rayon); }
.reglage p { margin: 0; font-size: 14px; }
.reglage strong { display: block; font-size: 15px; }
.bascule { margin-left: auto; display: inline-flex; padding: 3px; border-radius: 999px; background: var(--cendre); flex: none; }
.bascule button { height: 32px; min-width: 52px; padding: 0 10px; border: 0; border-radius: 999px; background: none; font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--gris); }
.bascule button[aria-pressed='true'] { background: var(--encre); color: var(--blanc); }

.liste-parcelles { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--trait); }
.liste-parcelles li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--trait); }
.ref-parcelle { font-family: var(--mono); font-size: 13px; font-weight: 600; min-width: 5.6em; }
.liste-parcelles .surf { margin-left: auto; font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.liste-parcelles small { display: block; color: var(--gris); font-size: 12.5px; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--trait);
  background: var(--blanc); font-weight: 650; font-size: 15px; text-decoration: none; color: var(--encre);
  transition: background .2s, border-color .2s, transform .15s;
}
.bouton:hover { border-color: #C9CDCA; }
.bouton:active { transform: scale(.98); }
.bouton-plein { background: var(--retardant); border-color: var(--retardant); color: var(--blanc); }
.bouton-plein:hover { background: var(--retardant-texte); border-color: var(--retardant-texte); }
.bouton-encre { background: var(--encre); border-color: var(--encre); color: var(--blanc); }
.bouton-petit { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.rangee { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

.repli { border-top: 1px solid var(--trait); margin-top: 22px; }
.repli summary { list-style: none; cursor: pointer; padding: 14px 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.repli summary::-webkit-details-marker { display: none; }
.repli summary::after { content: '+'; margin-left: auto; font-family: var(--mono); font-size: 18px; color: var(--gris); }
.repli[open] summary::after { content: '−'; }
.repli dl { margin: 0 0 16px; }
.repli dt { font-weight: 650; font-size: 14.5px; margin-top: 12px; }
.repli dd { margin: 2px 0 0; color: var(--encre-2); font-size: 14px; }
.repli dd a { font-size: 13px; }
.sources { font-size: 12.5px; color: var(--gris); margin-top: 18px; }
.sources a { color: var(--gris); }

/* Saison : la roue de l'année */
.roue-bloc { display: grid; place-items: center; margin: 4px 0 18px; }
.roue { width: min(100%, 300px); height: auto; overflow: visible; }
.roue .segment { transition: opacity .3s; }
.roue text { font-family: var(--mono); font-size: 9.5px; fill: var(--gris); }
.roue .mois-courant { fill: var(--encre); font-weight: 700; }
.roue-centre-1 { font-family: var(--texte) !important; font-size: 13px !important; fill: var(--gris) !important; }
.roue-centre-2 { font-family: var(--texte) !important; font-size: 20px !important; font-weight: 800; fill: var(--encre) !important; letter-spacing: -.02em; }
.periodes { display: grid; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.periodes li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding: 12px 14px; border-radius: var(--rayon); background: var(--cendre); font-size: 14px; }
.periodes li.actuelle { background: var(--retardant-voile); }
.periodes i { width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; }
.periodes strong { display: block; font-size: 15px; }

.gestes { margin: 0; padding: 0; list-style: none; }
.geste { border-bottom: 1px solid var(--trait); }
.geste label { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; cursor: pointer; font-size: 15px; }
.geste input { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border-radius: 7px; border: 2px solid #BFC4C0; display: grid; place-items: center; transition: background .2s, border-color .2s; }
.geste input:checked { background: var(--ok); border-color: var(--ok); }
.geste input:checked::after { content: ''; width: 6px; height: 11px; border: solid var(--blanc); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.geste small { display: block; color: var(--ok); font-size: 12.5px; margin-top: 2px; }
.progression { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; font-size: 14px; color: var(--gris); }
.progression-barre { flex: 1; height: 6px; border-radius: 3px; background: var(--cendre); overflow: hidden; }
.progression-barre span { display: block; height: 100%; background: var(--ok); transition: width .6s var(--ease); }

/* Voisins */
.carte-voisin { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 14px; margin-bottom: 12px; }
.carte-voisin header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.carte-voisin .surf { margin-left: auto; font-family: var(--mono); font-size: 13px; }
.etapes { display: flex; gap: 6px; margin: 10px 0 12px; padding: 0; list-style: none; }
.etapes li { flex: 1; height: 4px; border-radius: 2px; background: var(--trait); }
.etapes li.fait { background: var(--encre); }
.etapes li.alerte { background: var(--retardant); }
.etat-voisin { font-size: 14px; margin: 0 0 10px; }
.etat-voisin strong { font-weight: 700; }
.champ-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.champ-date input { height: 40px; padding: 0 10px; border: 1px solid var(--trait); border-radius: 10px; background: var(--blanc); }
.encadre { padding: 14px; border-radius: var(--rayon); background: var(--cendre); font-size: 14px; margin: 0 0 18px; }
.encadre p:last-child { margin: 0; }
.profil { display: grid; gap: 10px; margin: 0 0 16px; }
.profil label { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600; }
.profil input { height: 44px; padding: 0 12px; border: 1px solid var(--trait); border-radius: 12px; font-weight: 400; font-size: 15px; }

/* Dossier */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--cendre); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; font-family: var(--mono); font-size: 10px; color: var(--blanc); background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.photo button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .55); color: var(--blanc); font-size: 15px; line-height: 1; }
.ajout-photo { display: inline-flex; }
.ajout-photo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.resume { margin: 0 0 18px; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.resume dt { color: var(--gris); }
.resume dd { margin: 0; font-weight: 600; }
.danger { color: var(--retardant-texte); border-color: #F3C2D1; }

/* Édition du terrain */
.edition {
  position: fixed; z-index: 22; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--encre); color: var(--blanc); box-shadow: var(--ombre);
}
.edition-consigne { margin: 0; font-size: 14.5px; }
.edition-actions { display: flex; gap: 8px; justify-content: flex-end; }
.edition .pastille { background: transparent; color: var(--blanc); border-color: rgba(255, 255, 255, .3); }
.edition .pastille[aria-pressed='true'] { background: var(--blanc); color: var(--encre); }
@media (min-width: 900px) { .edition { left: calc(var(--panneau-l) + 32px); right: auto; width: 460px; } }

/* Fenêtre */
.fenetre { width: min(94vw, 720px); max-height: 88vh; padding: 0; border: 0; border-radius: 20px; box-shadow: 0 40px 100px rgba(0, 0, 0, .45); }
.fenetre::backdrop { background: rgba(11, 15, 14, .6); backdrop-filter: blur(3px); }
.fenetre-cadre { display: flex; flex-direction: column; max-height: 88vh; }
.fenetre-tete { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--trait); }
.fenetre-tete h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.fermer { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--cendre); font-size: 22px; line-height: 1; }
.fenetre-corps { padding: 18px 20px 22px; overflow-y: auto; }
.courrier { width: 100%; min-height: 360px; padding: 16px; border: 1px solid var(--trait); border-radius: 12px; font-family: var(--texte); font-size: 14.5px; line-height: 1.55; resize: vertical; background: #FCFCFB; }
.plan-mini { border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; margin: 12px 0; }
.plan-mini svg { display: block; width: 100%; height: auto; }

/* Messages */
.message { padding: 14px; border-radius: var(--rayon); background: var(--attention-voile); color: #5C3700; font-size: 14.5px; margin: 0 0 16px; }
.message.erreur { background: var(--retardant-voile); color: #7A0F31; }

/* Impression : seul le dossier ou le courrier s'imprime */
.impression { display: none; }
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; overflow: visible; }
  body > *:not(.impression) { display: none !important; }
  .impression { display: block; color: #000; font-size: 11pt; }
  .impression h1 { font-size: 20pt; letter-spacing: -.02em; margin: 0 0 4mm; }
  .impression h2 { font-size: 13pt; margin: 7mm 0 2mm; }
  .impression .page { break-after: page; }
  .impression .page:last-child { break-after: auto; }
  .impression .lettre { white-space: pre-wrap; font-size: 11pt; line-height: 1.5; }
  .impression svg { width: 100%; height: auto; max-height: 120mm; }
  .impression table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  .impression td, .impression th { border-bottom: 0.3mm solid #ccc; padding: 1.6mm 1mm; text-align: left; }
  .impression .photos-impr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; }
  .impression .photos-impr img { width: 100%; height: 45mm; object-fit: cover; }
  .impression .pied { margin-top: 8mm; font-size: 8.5pt; color: #444; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .anneau-trace { stroke-dashoffset: 0; }
  .anneau-maison { opacity: 1; }
}
