/*
 * La Hotte partagée : styles de l'espace privé (comptes, familles, invitations).
 * Même charte que les pages publiques (design/DESIGN.md) ; seuls les couples
 * texte et fond dont le contraste AA est calculé y sont employés.
 * Mikael - chef de projet - 2026-11-08
 */

.scene-espace { padding-bottom: 56px; }
.scene-espace .entete { flex-wrap: wrap; }
.nav-privee { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav-privee a, .nav-privee .lien-bouton { color: var(--creme); font-weight: 700; text-decoration: none; }
.nav-privee a:hover { text-decoration: underline; }
.nav-privee form { margin: 0; }
.titre-espace { margin-top: 28px; font-size: clamp(2rem, 4vw, 3rem); color: var(--or-pale); }
.phrase-espace { margin-top: 14px; max-width: 42em; color: var(--creme); font-size: 1.125rem; }

.espace { background: var(--creme); padding: 48px 0 96px; }
.conteneur-etroit { max-width: 860px; }
.espace .carte { padding: 28px; margin-bottom: 24px; }
.espace h2 { font-size: 1.5rem; margin-bottom: 14px; }

.formulaire { display: flex; flex-direction: column; gap: 18px; }
.formulaire-ligne { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-top: 16px; }
.formulaire-ligne .champ { flex: 1 1 240px; }
.champ { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }
.champ small { font-weight: 400; color: var(--brume); }
.champ input, .champ select, .champ textarea, .lien-invitation input, .alerte input {
  font: inherit; font-weight: 400; color: var(--encre); background: var(--papier);
  border: 1.5px solid var(--brume); border-radius: 12px; padding: 12px 14px; min-height: 48px; width: 100%;
}
.champ input:focus, .champ select:focus, .champ textarea:focus { outline: 3px solid var(--or); outline-offset: 1px; border-color: var(--encre); }
.code-saisi { font-size: 1.75rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.case { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.case input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--sapin); flex: 0 0 auto; }

.bouton-retour { border: 0; cursor: pointer; font: inherit; font-weight: 700; align-self: flex-start; }
.bouton-petit { min-height: 44px; padding: 8px 18px; margin-top: 0; }
.bouton-contour { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--encre); color: var(--encre); background: transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.bouton-contour:hover { background: var(--sable); }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--ruban); text-decoration: underline; cursor: pointer; }
.nav-privee .lien-bouton { color: var(--creme); text-decoration: none; }

.alerte { border-radius: 14px; padding: 14px 18px; margin-bottom: 20px; font-weight: 700; }
.alerte-ok { background: var(--vert-pale); color: var(--sapin); }
.alerte-erreur { background: var(--papier); color: var(--ruban); border: 2px solid var(--ruban); }
.aide-sous { color: var(--brume); margin-top: 12px; }

.liste-simple { list-style: none; margin: 0; padding: 0; }
.ligne-liste { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--sable); }
.ligne-liste small { color: var(--brume); }
.grille-cartes { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.carte-lien { display: flex; flex-direction: column; gap: 6px; text-decoration: none; padding: 24px; }
.carte-lien strong { font-family: var(--police-titre); font-size: 1.375rem; }
.carte-lien span { color: var(--brume); }
.vide { text-align: left; }

.invitation { border-top: 1px solid var(--sable); padding-top: 18px; margin-top: 18px; }
.code-invitation { font-family: var(--police-titre); font-size: 1.5rem; letter-spacing: .08em; color: var(--sapin); }
.partage { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.texte-long { white-space: normal; line-height: 1.7; }

/* Piège à robots : hors écran, invisible aussi pour les lecteurs d'écran. */
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 720px) {
  .espace { padding-top: 32px; }
  .espace .carte { padding: 20px; }
  .nav-privee { width: 100%; justify-content: flex-start; }
}

/* ---------- Listes et comparateur (étape 3) ----------
 * Carte d'une envie, tableau des prix, boutons « Chercher », relevé de prix
 * et vue enfant. Même charte que le reste de l'espace.
 * Mikael - chef de projet - 2026-11-09 */
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.envie-entete { display: flex; gap: 16px; align-items: flex-start; }
.rang { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sapin); color: var(--creme); font-family: var(--police-titre); font-size: 1.25rem; }
.note-enfant { margin-top: 8px; font-style: italic; color: var(--sapin); }
.meilleur-prix { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin: 18px 0 8px; font-size: 1.125rem; }
.meilleur-prix strong { font-family: var(--police-titre); font-size: 1.75rem; color: var(--sapin); font-variant-numeric: tabular-nums; }
.meilleur-prix small { flex-basis: 100%; color: var(--brume); }
.etiquette-meilleur { padding: 2px 12px; border-radius: 999px; background: var(--or-pale); color: var(--encre); font-size: .875rem; font-weight: 700; }
.tableau-defilant { overflow-x: auto; margin: 12px 0; }
.offres-tableau { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.offres-tableau th, .offres-tableau td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--sable); vertical-align: top; }
.offres-tableau thead th { color: var(--brume); font-weight: 700; }
.offres-tableau .chiffres { font-variant-numeric: tabular-nums; white-space: nowrap; }
.statut { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 700; background: var(--sable); }
.statut-verifie { background: var(--vert-pale); color: var(--sapin); }
.statut-a_reverifier, .statut-non_vendu { background: var(--papier); color: var(--ruban); }
.recherches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.recherches span { font-weight: 700; margin-right: 4px; }
.bouton-mini { min-height: 44px; padding: 6px 14px; font-size: .9375rem; }
.champ-coller { display: flex; gap: 8px; }
.champ-coller input { flex: 1 1 auto; min-width: 0; }
.relever { margin-top: 14px; border-top: 1px solid var(--sable); padding-top: 14px; }
.relever summary { cursor: pointer; font-weight: 700; color: var(--sapin); min-height: 44px; display: flex; align-items: center; }
.relever .formulaire { margin-top: 12px; }
.actions-envie { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.actions-envie form { margin: 0; }
.liste-enfant h2 { font-size: 1.75rem; color: var(--sapin); }
.envies-enfant { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.envie-enfant { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 18px; background: var(--papier); }
.rang-enfant { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--or-pale); font-family: var(--police-titre); font-size: 1.5rem; }
.texte-enfant { display: flex; flex-direction: column; gap: 4px; font-size: 1.125rem; }
.texte-enfant small { color: var(--brume); }
.texte-enfant em { color: var(--sapin); }
@media (prefers-reduced-motion: no-preference) {
  .envie-enfant { animation: envie-apparait .5s ease-out both; }
  @keyframes envie-apparait { from { transform: translateY(8px); } to { transform: none; } }
}
/* ---------- Réservations (étape 4) ----------
 * Panneau « Je l'offre / Je participe », pastilles (DESIGN.md :
 * pastilleReserve sapin sur papier), barre d'un cadeau commun (<progress>
 * natif, aucune largeur en style en ligne), explications « ? », « Mes
 * cadeaux » et tableau de bord du parent. Cibles de 44 px au moins.
 * Mikael - chef de projet - 2026-11-10 */
.reservation { margin: 16px 0 8px; padding: 16px; border-radius: 16px; background: var(--papier); border: 1.5px solid var(--sable); }
.pastille { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: 999px; font-weight: 700; }
.pastille-moi { background: var(--sapin); color: var(--papier); }
.pastille-pris { background: var(--papier); color: var(--brume); border: 1.5px solid var(--brume); }
.pastille-achete { background: var(--vert-pale); color: var(--sapin); }
.actions-reservation { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; margin-top: 12px; }
.actions-reservation form { margin: 0; }
.participer { margin-top: 0; flex: 1 1 320px; }
.participer small { flex-basis: 100%; margin-top: 0; }
.barre-commun { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-weight: 700; }
.barre-commun progress { width: 100%; height: 14px; accent-color: var(--sapin); }
.aide-notion { flex-basis: 100%; }
.aide-notion summary { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--encre); font-weight: 700; cursor: pointer; list-style: none; }
.aide-notion summary::-webkit-details-marker { display: none; }
.aide-notion summary:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.aide-notion p { margin-top: 8px; max-width: 40em; color: var(--encre); }
.totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 0; }
.totaux div { padding: 14px; border-radius: 14px; background: var(--papier); }
.totaux dt { color: var(--brume); font-weight: 700; }
.totaux dd { margin: 4px 0 0; font-family: var(--police-titre); font-size: 1.5rem; color: var(--sapin); }
.chiffres { font-variant-numeric: tabular-nums; }
/* ---------- Corrections de revue (2026-11-11) ----------
 * Message d'erreur relié à son champ (aria-describedby), champ refusé
 * souligné par la bordure ET par le texte (jamais par la seule couleur),
 * aperçu du parent avant le mode enfant.
 * Mikael - chef de projet - 2026-11-11 */
.erreur-champ { flex-basis: 100%; margin: 4px 0 0; color: var(--ruban); font-weight: 700; }
.champ input[aria-invalid="true"] { border-color: var(--ruban); border-width: 2px; }
.apercu-parent { margin-top: 24px; }
/* ---------- Lettres, listes, collages et dessins (pièces jointes) ----------
 * Galerie en vignettes, dépôt (deux boutons, zone de dépôt, aperçu des pages
 * réordonnables, progression), document en grand, visionneuse plein écran,
 * impression. Cibles de 44 px, focus visible, mêmes couples de couleurs AA.
 * Mikael - chef de projet - 2026-11-10 */
/* L'attribut hidden l'emporte toujours, même sur un bouton en display flex. */
[hidden] { display: none !important; }
.galerie-lettres { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.piece-galerie { display: flex; flex-direction: column; gap: 8px; }
.piece-galerie .actions-envie { margin-top: 4px; gap: 8px; }
.vignette-lettre { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--sable); box-shadow: var(--ombre-douce); text-decoration: none; }
.vignette-lettre img { width: 100%; height: 100%; object-fit: cover; }
.vignette-lettre:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.vignette-pdf { display: grid; place-items: center; width: 100%; height: 100%; min-height: 96px; font-family: var(--police-titre); font-size: 1.5rem; color: var(--sapin); background: var(--sable); }
.nb-pages { position: absolute; right: 8px; bottom: 8px; padding: 2px 10px; border-radius: 999px; background: var(--papier); color: var(--encre); font-size: .8125rem; font-weight: 700; }
.meta-piece { font-weight: 700; overflow-wrap: anywhere; }
.legende-piece { color: var(--brume); margin-bottom: 12px; }

.encadre-vie-privee { padding: 16px 18px; border-radius: 14px; background: var(--vert-pale); color: var(--sapin); margin-bottom: 14px; }
.conseils-photo { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 18px; padding-left: 20px; color: var(--brume); }
.choix-visibilite { border: 1.5px solid var(--sable); border-radius: 14px; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.choix-visibilite legend { font-weight: 700; padding: 0 6px; }
.choix-fichiers { display: flex; flex-wrap: wrap; gap: 12px; }
.bouton-fichier { position: relative; cursor: pointer; min-height: 48px; }
.bouton-fichier:focus-within { outline: 3px solid var(--or); outline-offset: 2px; }
.zone-depot { border: 2px dashed var(--brume); border-radius: 16px; padding: 22px; text-align: center; color: var(--brume); cursor: pointer; min-height: 88px; display: grid; place-items: center; }
.zone-depot:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.zone-depot.survol { border-color: var(--sapin); background: var(--vert-pale); color: var(--sapin); }
.zone-depot[aria-invalid="true"] { border-color: var(--ruban); }
.pages-apercu { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.page-apercu { display: grid; grid-template-columns: 88px 1fr; gap: 10px 14px; align-items: start; padding: 12px; border-radius: 14px; background: var(--papier); border: 1.5px solid var(--sable); }
.page-apercu img, .page-apercu .vignette-pdf { width: 88px; height: 110px; object-fit: cover; border-radius: 10px; }
.page-apercu progress { width: 100%; height: 12px; accent-color: var(--sapin); }
.page-refusee { border-color: var(--ruban); }
.page-faite { border-color: var(--sapin-clair); }
.texte-page { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.texte-page small { color: var(--brume); overflow-wrap: anywhere; }
.etat-page { color: var(--encre); }
.page-refusee .etat-page { color: var(--ruban); font-weight: 700; }
.outils-page { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.choix-doublon { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.choix-doublon p { flex-basis: 100%; font-weight: 700; color: var(--ruban); }
.erreur-champ { color: var(--ruban); font-weight: 700; }
.champ [aria-invalid="true"], .case [aria-invalid="true"] { border-color: var(--ruban); outline: 2px solid var(--ruban); }
.actions-depot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.etat-depot { font-weight: 700; color: var(--sapin); min-height: 1.5em; }
.depot meter { width: 160px; height: 12px; vertical-align: middle; }
.bouton-danger { background: var(--ruban); color: var(--creme); }

.document { display: flex; flex-direction: column; gap: 24px; }
.page-document { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.page-document img { width: 100%; height: auto; border-radius: 12px; background: var(--sable); }
.page-document figcaption { color: var(--brume); font-weight: 700; }

.visionneuse { width: min(100vw, 1100px); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0 auto; padding: 0; border: 0; background: var(--nuit); color: var(--creme); }
.visionneuse::backdrop { background: rgba(11, 22, 51, .92); }
.visionneuse[open] { display: flex; flex-direction: column; }
.visionneuse-haut, .visionneuse-bas { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; }
.visionneuse-haut .visionneuse-titre { flex: 1 1 auto; font-weight: 700; }
.visionneuse .bouton-contour { color: var(--creme); border-color: var(--creme); }
.visionneuse .bouton-contour:hover { background: var(--nuit-claire); }
.visionneuse .lien-bouton { color: var(--or-pale); }
.visionneuse-bas { justify-content: space-between; }
.visionneuse-image { flex: 1 1 auto; overflow: auto; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.visionneuse-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.visionneuse-image.zoom { place-items: start; }
.visionneuse-image.zoom img { max-width: none; max-height: none; width: 200%; }

@media (max-width: 720px) {
  .galerie-lettres { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page-apercu { grid-template-columns: 72px 1fr; }
  .page-apercu img, .page-apercu .vignette-pdf { width: 72px; height: 90px; }
}

/* Vue d'impression d'une lettre : seulement le document. */
@media print {
  .scene, .pied, .sans-impression, .nav-privee, .alerte { display: none !important; }
  .espace { padding: 0; background: #fff; }
  .document { box-shadow: none; border: 0; }
  .page-document { break-after: page; }
}
.visionneuse button:disabled { opacity: .45; cursor: default; background: transparent; }

/* ---------- Dérivés en <picture>, recadrage, QR code du téléphone ----------
 * <picture> s'efface de la mise en page : l'image garde les règles de sa
 * vignette ou de sa page. Recadrage : le cadre assombrit ce qui ne sera pas
 * envoyé ; ses coins ont une cible de 44 px. QR code : grand, net, sur fond
 * blanc (zone de silence comprise).
 * Mikael - chef de projet - 2026-11-11 */
.vignette-lettre picture, .page-document picture { display: contents; }
.boite-recadrage { width: min(100vw - 24px, 900px); max-height: 100vh; border: 0; border-radius: var(--rayon-carte); padding: 18px; background: var(--papier); color: var(--encre); }
.boite-recadrage::backdrop { background: rgba(11, 22, 51, .85); }
.boite-recadrage[open] { display: flex; flex-direction: column; gap: 14px; align-items: center; }
.scene-recadrage { position: relative; display: inline-block; line-height: 0; touch-action: none; user-select: none; }
.scene-recadrage canvas { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.cadre-recadrage { position: absolute; border: 3px dashed var(--or); box-shadow: 0 0 0 9999px rgba(11, 22, 51, .55); cursor: move; touch-action: none; }
.cadre-recadrage:focus-visible { outline: 3px solid var(--creme); outline-offset: 2px; }
.poignee-recadrage { position: absolute; width: 44px; height: 44px; }
.poignee-recadrage::after { content: ""; position: absolute; inset: 14px; border-radius: 4px; background: var(--or); border: 2px solid var(--nuit); }
.poignee-nw { left: -22px; top: -22px; cursor: nwse-resize; }
.poignee-ne { right: -22px; top: -22px; cursor: nesw-resize; }
.poignee-sw { left: -22px; bottom: -22px; cursor: nesw-resize; }
.poignee-se { right: -22px; bottom: -22px; cursor: nwse-resize; }
.qr-depot .qr-code { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 14px; margin: 12px 0; }
.qr-depot .qr-code svg { width: min(72vw, 280px); height: auto; }
.etapes-qr { padding-left: 22px; display: grid; gap: 6px; }
.adresse-qr { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; word-break: break-all; }

/* ---------- Lettre vivante ----------
 * La vraie lettre de l'enfant, et par-dessus un calque SVG des zones
 * (coordonnées en pourcentage dans les attributs : aucune position en style
 * en ligne, CSP stricte). Contour or sur la lettre, gommette dorée « Déjà
 * pris » (encre sur or, 9,69:1), bascule « Voir la lettre / Voir la liste »,
 * liste des zones en boutons de 44 px dans l'ordre de lecture, fiche de
 * l'envie en boîte de dialogue, éditeur du parent (tracé, poignées de 44 px).
 * Mikael - chef de projet - 2026-11-11 */
.bascule-lettre { display: flex; flex-wrap: wrap; gap: 6px; width: fit-content; max-width: 100%; margin: 0 0 24px; padding: 6px; border-radius: 999px; background: var(--papier); border: 1.5px solid var(--sable); }
.bascule-choix { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; color: var(--encre); font-weight: 700; text-decoration: none; }
.bascule-choix:hover { background: var(--sable); }
.bascule-actif, .bascule-actif:hover { background: var(--sapin); color: var(--papier); }
.bascule-choix:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.lettre-vivante-outils summary { min-height: 44px; }
.page-lettre { margin: 0 0 18px; }
.page-lettre figcaption { margin-top: 8px; color: var(--brume); font-weight: 700; }
.lettre-cadre { position: relative; line-height: 0; border-radius: 12px; background: var(--sable); }
.lettre-cadre picture { display: contents; }
.lettre-cadre img { display: block; width: 100%; height: auto; border-radius: 12px; }
.lettre-zones { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.zone-cible { fill: transparent; stroke: none; pointer-events: all; }
.zone-forme { fill: rgba(233, 185, 73, .14); stroke: var(--or); stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.zone-contour { overflow: visible; pointer-events: none; }
a.zone { cursor: pointer; }
a.zone:hover .zone-forme, .zone.zone-active .zone-forme { fill: rgba(233, 185, 73, .32); stroke: var(--ruban); stroke-width: 4; }
.gommette { pointer-events: none; }
.gommette rect { fill: var(--or); stroke: var(--nuit); stroke-width: 1.5; }
.gommette text { fill: var(--encre); font-family: var(--police-texte); font-size: 13px; font-weight: 700; }
.titre-zones { font-size: 1.25rem; margin: 20px 0 12px; }
.zones-lecture { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: zone; }
.zones-lecture li { counter-increment: zone; }
.bouton-zone { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 16px 8px 8px; border-radius: 999px; border: 1.5px solid var(--encre); color: var(--encre); background: var(--papier); font-weight: 700; text-decoration: none; cursor: pointer; }
button.bouton-zone { width: 100%; font: inherit; font-weight: 700; text-align: left; }
.bouton-zone::before { content: counter(zone); flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--or-pale); font-family: var(--police-titre); }
.bouton-zone:hover, .bouton-zone.zone-active { background: var(--sable); }
.bouton-zone:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
.gommette-texte { margin-left: auto; padding: 2px 12px; border-radius: 999px; background: var(--or); color: var(--encre); font-size: .875rem; }
.zones-lecture-enfant .zone-lue { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 18px; background: var(--papier); font-size: 1.125rem; }
.liens-lettres { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; padding: 0; }
.fiches-lettre .fiche-zone { display: none; }
.fiches-lettre .fiche-zone:target, .fiches-en-liste .fiche-zone { display: block; }
.fiche-zone:focus { outline: none; }
.boite-fiche { width: min(100vw - 24px, 780px); max-width: 100vw; max-height: 92vh; padding: 0; border: 0; border-radius: var(--rayon-carte); background: var(--creme); color: var(--encre); overflow: auto; }
.boite-fiche::backdrop { background: rgba(11, 22, 51, .82); }
.boite-fiche .fiche-zone { display: block; padding: 0 16px 16px; }
.boite-fiche .fiche-zone .carte { margin-bottom: 12px; }
.boite-fiche-haut { position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end; padding: 10px 12px; background: var(--creme); }

.outils-editeur { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 12px; padding: 10px 14px; border: 1.5px solid var(--sable); border-radius: 14px; }
.outils-editeur legend { font-weight: 700; padding: 0 6px; }
/* Au doigt, la photo défile avec la page ; elle ne bloque le défilement que
 * pendant un tracé choisi ou une zone choisie (classe posée par le script).
 * Mikael - chef de projet - 2026-11-11 */
.lettre-editable { touch-action: pan-x pan-y pinch-zoom; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.lettre-editable.trace-actif { touch-action: none; }
.outils-editeur .aide-sous { flex: 1 1 100%; margin: 0; }
.lettre-editable .zone { cursor: move; }
.lettre-editable .zone:focus { outline: none; }
.lettre-editable .zone:focus-visible .zone-forme, .lettre-editable .zone-choisie .zone-forme { fill: rgba(179, 18, 46, .14); stroke: var(--ruban); stroke-width: 4; }
.trace-en-cours { fill: rgba(14, 90, 58, .16); stroke: var(--sapin); stroke-width: 3; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.poignee-zone { fill: transparent; pointer-events: all; cursor: nwse-resize; }
.poignee-zone-point { fill: var(--or); stroke: var(--nuit); stroke-width: 2; pointer-events: none; }
.panneau-zone { margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: var(--papier); border: 1.5px solid var(--sable); }
.panneau-zone p { font-weight: 700; }
.zones-editeur { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 4px; }
.zone-editeur { padding: 10px 0; border-bottom: 1px solid var(--sable); }
.zone-editeur small { color: var(--brume); }
.geometrie-zone .formulaire-ligne { margin-top: 0; }
.geometrie-zone .formulaire-ligne .champ { flex: 1 1 110px; }
.boite-relier { width: min(100vw - 24px, 520px); border: 0; border-radius: var(--rayon-carte); padding: 20px; background: var(--papier); color: var(--encre); }
.boite-relier::backdrop { background: rgba(11, 22, 51, .7); }
@media print {
  .bascule-lettre, .lettre-zones, .zones-lecture, .fiches-lettre { display: none !important; }
}
/* Accolade ci-dessus rétablie le 2026-11-11 : sans elle, toute la suite de la
 * feuille (mercis, Livre des Noëls) ne valait que pour l'impression.
 * Mikael - chef de projet - 2026-11-11 */

/* ---------- « Le Père Noël est passé », mercis et Livre des Noëls ----------
 * Mêmes couples texte et fond que le reste de l'espace (contrastes AA de
 * DESIGN.md). Le livre s'imprime proprement : un chapitre par page, sans
 * bandeau ni bouton, images jamais coupées (« Enregistrer en PDF » depuis
 * le navigateur, aucune bibliothèque PDF côté serveur).
 * Mikael - chef de projet - 2026-11-11 */
.qui-offre { font-weight: 700; color: var(--sapin); margin: 8px 0 0; }
.merci-a-envoyer { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--sable); }
.merci-a-envoyer h3, .mercis-recus h3 { font-size: 1.125rem; margin-bottom: 10px; }
.champ textarea { min-height: 96px; resize: vertical; }
.mercis-envoyes { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.mot-merci { margin: 8px 0; padding: 14px 18px; border-left: 4px solid var(--ruban); border-radius: 0 12px 12px 0; background: var(--papier); font-family: var(--police-titre); font-size: 1.125rem; color: var(--encre); }
.dessin-merci, .morceau-lettre { margin: 10px 0; }
.dessin-merci img, .morceau-lettre img { display: block; max-width: 100%; height: auto; border-radius: 12px; box-shadow: var(--ombre-douce); background: var(--papier); }
.morceau-lettre figcaption { margin-top: 6px; color: var(--brume); }
.merci { padding: 16px 0; border-bottom: 1px solid var(--sable); }
.accord-livre { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: var(--vert-pale); }
.accord-livre .case { flex: 1 1 320px; min-height: 44px; align-items: center; }
.accord-livre .case input { width: 24px; height: 24px; flex: 0 0 auto; }
.accord-livre small { flex-basis: 100%; margin-top: 0; }
.livre-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 24px; }
.livre-couverture { text-align: center; background: var(--nuit); color: var(--creme); }
.espace .livre-couverture h2 { color: var(--or-pale); font-size: clamp(1.75rem, 4vw, 2.5rem); }
.livre-surtitre { font-family: var(--police-logo); color: var(--or-pale); font-size: 1.25rem; }
.livre-chapitre h3 { font-size: 1.25rem; margin: 24px 0 10px; color: var(--sapin); }
.livre-lettre { margin: 0 0 18px; }
.livre-lettre figcaption { font-weight: 700; margin-bottom: 8px; }
.livre-lettre img { display: block; max-width: 100%; height: auto; margin-bottom: 12px; border-radius: 12px; }
.livre-envies { margin: 0; padding-left: 24px; display: grid; gap: 4px; }
.livre-cadeau { padding: 10px 0; border-bottom: 1px solid var(--sable); }

/* Libération d'une réservation par un parent : lien sur la carte, écran de
   confirmation (case et boutons de 44 px au moins). Mikael - chef de projet - 2026-11-11 */
.liberation { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.liste-explications { margin: 12px 0; padding-left: 24px; display: grid; gap: 6px; }
.confirmation-liberation .case { min-height: 44px; align-items: center; margin: 16px 0 4px; }
.confirmation-liberation .case input { width: 24px; height: 24px; margin-top: 0; }
.actions-confirmation { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

@media print {
  .livre-actions { display: none !important; }
  .livre-couverture { background: #fff; color: var(--encre); box-shadow: none; }
  .espace .livre-couverture h2, .livre-surtitre { color: var(--encre); }
  .livre-chapitre { break-before: page; box-shadow: none; border: 0; }
  .livre-lettre img, .dessin-merci img, .mot-merci { break-inside: avoid; box-shadow: none; }
}

/* ---------- Collage qui devient une liste (étape 3 bis) ----------
   Mention de l'analyse par IA bien visible, zones cachées peintes en noir sur
   la photo, cadres proposés numérotés, fiches des propositions.
   Mikael - chef de projet - 2026-11-11 */
.mention-ia { padding: 12px 16px; border-radius: 12px; background: var(--or-pale); color: var(--encre); margin-bottom: 14px; }
.masques-cadre { cursor: crosshair; touch-action: pan-y; }
.masques-cadre.trace-actif { touch-action: none; }
.calque-masques .masque { fill: var(--encre); stroke: var(--or); stroke-width: 2; }
.calque-masques .masque-en-cours { fill-opacity: .6; }
.cadre-propose .zone-forme { fill: transparent; stroke: var(--ruban); stroke-width: 3; }
.cadre-propose.cadre-validee .zone-forme, .cadre-propose.cadre-corrigee .zone-forme { stroke: var(--sapin); }
.cadre-propose.cadre-retiree { opacity: .35; }
.cadre-propose.cadre-actif .zone-forme { stroke-width: 6; }
.numero-cadre { fill: var(--ruban); font-weight: 700; font-size: 20px; paint-order: stroke; stroke: var(--papier); stroke-width: 4px; }
.propositions { list-style: none; padding: 0; margin-top: 20px; display: flex; flex-direction: column; gap: 18px; }
.proposition { padding: 18px; border: 1.5px solid var(--sable); border-radius: 16px; background: var(--papier); }
.proposition .formulaire { margin-top: 12px; }
.proposition .formulaire-ligne { margin-top: 8px; }
.attente-analyse [data-texte-etat] { font-weight: 700; color: var(--sapin); }
/* ---------- Espace du super admin et mode promotion ----------
 * Couples texte et fond de DESIGN.md seulement (encre ou brume sur papier et
 * crème, crème et or pâle sur nuit, papier sur sapin). Le thème de neige
 * reprend la neige des pages publiques (.neige de site.css), derrière le
 * texte, sans capter de clic, immobile si l'on a demandé moins d'animations.
 * Mikael - chef de projet - 2026-11-11 */
.nav-admin { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 24px; }
.nav-admin a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1.5px solid var(--encre); color: var(--encre); font-weight: 700; text-decoration: none; }
.nav-admin a[aria-current="page"] { background: var(--sapin); border-color: var(--sapin); color: var(--papier); }
.chiffres { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.chiffres caption { text-align: left; font-family: var(--police-titre); font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.chiffres th, .chiffres td { padding: 10px 8px; border-bottom: 1px solid var(--sable); text-align: left; vertical-align: top; }
.chiffres td.nombre, .chiffres th.nombre { text-align: right; white-space: nowrap; }
.chiffres thead th { color: var(--brume); font-size: .95rem; }
.table-defilante { overflow-x: auto; }
.journal-securite { font-size: .95rem; }
.journal-securite td { overflow-wrap: anywhere; }
.fiche-admin { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 18px; }
.fiche-admin dt { font-weight: 700; }
.fiche-admin dd { margin: 0; }
.etat-promotion { font-weight: 700; padding: 12px 16px; border-radius: 14px; background: var(--vert-pale); color: var(--sapin); }
.etat-promotion.coupe { background: var(--sable); color: var(--encre); }
.apercu-promotion { border: 2px dashed var(--brume); border-radius: var(--rayon-carte); padding: 8px; }

.promotion { border: 2px solid var(--or); }
.promotion h2 { color: var(--sapin); }
.promotion .champ textarea { min-height: 120px; }
.promotion-boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.bouton-reseau[aria-disabled="true"] { cursor: default; }
.promotion-merci { min-height: 1.5em; margin-top: 12px; font-weight: 700; color: var(--sapin); }
.promotion-plus-tard { margin: 8px 0 0; text-align: right; }
.promotion-plus-tard .lien-bouton { color: var(--brume); min-height: 44px; }
.form-cadeau { display: inline; margin: 0; }
.form-cadeau .lien-bouton { min-height: 44px; }

.cadeau-neige { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 96px; margin-bottom: 24px; padding: 16px 24px; border-radius: var(--rayon-carte); background: var(--nuit); color: var(--creme); }
.cadeau-neige p { margin: 0; font-family: var(--police-logo); color: var(--or-pale); font-size: 1.25rem; }
.cadeau-neige .lien-bouton { color: var(--creme); }
.cadeau-decor-livre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; padding: 14px 20px; border-radius: var(--rayon-carte); background: var(--nuit-claire); color: var(--creme); }
.cadeau-decor-livre p { margin: 0; color: var(--or-pale); font-weight: 700; }
.cadeau-decor-livre .lien-bouton { color: var(--creme); }
.cadeau-decor-livre .guirlande { flex: 1 1 100%; height: 18px; background: radial-gradient(circle at 9px 9px, var(--or) 0 4px, transparent 5px) 0 0 / 36px 18px repeat-x, radial-gradient(circle at 27px 9px, var(--or-pale) 0 3px, transparent 4px) 0 0 / 36px 18px repeat-x; }
@media print {
  .promotion, .promotion-finie, .cadeau-neige, .cadeau-decor-livre, .cadeau-range, .nav-admin { display: none !important; }
}

/*
 * Écrans privés guidés (chantier C11) : visite guidée, boutons « ? »,
 * « Écouter » du mode enfant, page « Aide ». Couples texte et fond de
 * design/DESIGN.md seulement ; cibles de 44 px au moins ; aucun mouvement si
 * l'utilisateur a demandé moins d'animations.
 * Mikael - chef de projet - 2026-11-11
 */

/* Visite guidée : dialogue modal, ou carte dans la page sans script. */
dialog.visite { border: 0; padding: 0; margin: auto; width: 100%; max-width: min(580px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: transparent; color: var(--encre); }
dialog.visite::backdrop { background: rgba(11, 22, 51, .78); }
dialog.visite[open]:not(:modal) { position: static; max-width: none; margin: 0 0 24px; }
.visite-cadre { position: relative; background: var(--papier); border-radius: 22px; padding: 28px; border-top: 8px solid var(--ruban); box-shadow: var(--ombre-douce); }
.visite-surtitre { margin: 0; color: var(--or-fonce); font-weight: 700; }
.visite-titre { margin: 6px 0 10px; font-family: var(--police-titre); font-size: 1.6rem; color: var(--encre); }
.visite-titre:focus, .visite-titre-etape:focus { outline: none; }
.visite-titre:focus-visible, .visite-titre-etape:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }
.visite-intro { margin: 0; color: var(--brume); }
.visite-etapes { list-style: none; margin: 22px 0 8px; padding: 0; display: grid; gap: 18px; }
.visite-etape { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.visite-etape[hidden] { display: none; }
.visite-numero { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--nuit); color: var(--or-pale); font-family: var(--police-titre); font-weight: 700; font-size: 1.125rem; }
.visite-titre-etape { margin: 6px 0 4px; font-size: 1.2rem; }
.visite-etape p { margin: 0; }
.visite-progression { margin: 14px 0 0; color: var(--brume); font-weight: 700; }
.visite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.visite-actions .bouton-retour { margin-top: 0; }
.visite-actions button[hidden] { display: none; }
.visite-passer { margin: 0 0 0 auto; }
.visite-passer .lien-bouton { min-height: 44px; padding: 0 4px; color: var(--brume); }
.visite-enfant .visite-titre { font-size: 1.9rem; }
.visite-enfant .visite-titre-etape { font-size: 1.5rem; }
.visite-enfant .visite-etape p { font-size: 1.25rem; }
dialog.visite[open] { animation: visite-entree .3s ease-out; }
@keyframes visite-entree { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Boutons « ? » : rangée en tête d'écran, ou coin d'une carte. */
.notions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 24px; }
.notions-titre { margin: 0; font-weight: 700; color: var(--brume); }
.aide-en-ligne { flex-basis: auto; }
.notions .aide-notion[open] { flex-basis: 100%; }
.aide-point { display: inline-grid; place-items: center; width: 100%; height: 100%; }
.aide-avec-libelle summary { width: auto; gap: 8px; padding: 0 18px 0 6px; }
.aide-avec-libelle .aide-point { width: 32px; height: 32px; border-radius: 50%; background: var(--nuit); color: var(--or-pale); }
.aide-avec-libelle summary { display: inline-flex; align-items: center; }
.aide-bulle { margin-top: 10px; max-width: 40em; padding: 14px 18px; border-radius: 16px; background: var(--papier); border: 1px solid var(--sable); box-shadow: var(--ombre-douce); }
.aide-bulle p { margin: 0; }
.aide-bulle p + p { margin-top: 8px; }
.aide-exemple { color: var(--brume); }
.aide-coin { position: absolute; top: 18px; right: 18px; z-index: 2; }
.aide-coin[open] .aide-bulle { position: absolute; right: 0; top: 52px; width: min(340px, calc(100vw - 64px)); }
.carte:has(> .aide-coin) > h2 { padding-right: 56px; }

/* « Écouter » du mode enfant. */
.ecouter { margin: 0 0 24px; }
.ecouter-boutons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ecouter-boutons .bouton-retour { margin-top: 0; }
.ecouter-boutons [hidden] { display: none; }
.bouton-ecouter { gap: 10px; min-height: 56px; padding: 10px 28px; font-size: 1.25rem; border: 0; cursor: pointer; font-family: inherit; }
.icone-ecouter { flex: none; }
.mention-voix { margin: 8px 0 0; color: var(--brume); font-size: .9375rem; }

/* Page « Aide ». */
.actions-aide { display: flex; flex-wrap: wrap; gap: 12px; }
.actions-aide .bouton-retour { margin-top: 0; }
.glossaire { display: grid; gap: 20px; margin: 18px 0 0; }
.glossaire-entree dt { font-family: var(--police-titre); font-weight: 700; font-size: 1.15rem; }
.glossaire-entree dd { margin: 4px 0 0; }

@media (prefers-reduced-motion: reduce) {
  dialog.visite[open] { animation: none; }
}
@media print {
  dialog.visite, .notions, .aide-notion, .ecouter { display: none !important; }
}

/* Liste vide d'un parent : les trois façons d'ajouter la première envie
   (correctif de revue C11). Mikael - chef de projet - 2026-11-11 */
.trois-facons { margin-top: 16px; }
.trois-facons-titre { margin: 0 0 10px; font-weight: 700; }
.trois-facons-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; padding: 0; list-style: none; }
.trois-facons-actions .bouton-retour { margin-top: 0; }

/* ---------- Plan de table ----------
 * Éditeur d'un repas (#plan-de-table), boîtes de dialogue et annonces (.pdt-),
 * dossier à imprimer et marque-places (body.pdt-document). Couleurs : les seules
 * variables de la charte, aucune palette propre. Les documents à imprimer ne
 * chargent que cette feuille : leurs règles répètent donc la valeur de la
 * charte en repli de chaque variable.
 * Le plan (.pdt-conteneur-plan) est en position relative et la barre de
 * sélection s'y pose en position absolue : elle ne pousse jamais le plan sous
 * le doigt. Utilisable de 390 px à 1440 px de large.
 * Mikael - chef de projet - 2026-11-12 */
#plan-de-table {
  --pdt-largeur: min(1280px, 100vw - 40px);
  width: var(--pdt-largeur); margin-left: calc((100% - var(--pdt-largeur)) / 2);
  display: flex; flex-direction: column; background: var(--papier); color: var(--encre);
  border: 1px solid var(--sable); border-radius: var(--rayon-carte); box-shadow: var(--ombre-douce);
}
#plan-de-table h2 { font-size: 1.375rem; margin: 0; }
#plan-de-table h3 { font-size: 1.125rem; margin: 18px 0 8px; }
#plan-de-table h4 { font-family: var(--police-titre); font-size: 1.0625rem; margin: 0 0 8px; }
#plan-de-table .pdt-carte > h3:first-child { margin-top: 0; }
#plan-de-table small { font-size: .82em; }
.pdt-chargement { padding: 32px; text-align: center; color: var(--brume); }
.pdt-discret { color: var(--brume); }
.pdt-alerte-texte { color: var(--ruban); font-weight: 700; }
.pdt-espace { flex: 1; }
.pdt-grise { opacity: .6; }

.pdt-bouton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--encre); border-radius: 999px; background: var(--papier); color: var(--encre);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.pdt-bouton:hover { background: var(--sable); }
.pdt-bouton:disabled { opacity: .55; cursor: default; background: var(--papier); }
.pdt-bouton-principal { background: var(--sapin); border-color: var(--sapin); color: var(--papier); }
.pdt-bouton-principal:hover { background: var(--sapin); filter: brightness(1.12); }
.pdt-bouton-danger { background: var(--ruban); border-color: var(--ruban); color: var(--creme); }
.pdt-bouton-danger:hover { background: var(--ruban); filter: brightness(1.12); }
.pdt-bouton-icone { width: 44px; padding: 0; font-size: 1.25rem; }
.pdt-lien { min-height: 44px; border: 0; background: none; padding: 0; color: var(--ruban); font: inherit; text-decoration: underline; text-align: left; cursor: pointer; }
.pdt-lien.pdt-danger { color: var(--ruban); font-weight: 700; }
.pdt-bouton:focus-visible, .pdt-lien:focus-visible, .pdt-onglet:focus-visible, .pdt-etiquette:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }

.pdt-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 14px 18px; }
.pdt-titre p { margin: 2px 0 0; font-size: .9375rem; }
.pdt-etat { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pdt-statut { font-size: .875rem; font-weight: 700; color: var(--sapin); }
.pdt-statut[data-statut="enregistrement"], .pdt-statut[data-statut="relecture"] { color: var(--brume); }
.pdt-statut[data-statut="hors_ligne"], .pdt-statut[data-statut="patience"] { color: var(--ruban); }
.pdt-presences { display: flex; align-items: center; gap: 4px; }
.pdt-personne {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; background: var(--sapin); color: var(--papier); font-weight: 700; font-size: .875rem;
}
.pdt-bandeau-verrou { padding: 8px 18px; background: var(--or-pale); color: var(--encre); font-weight: 700; font-size: .9375rem; }
.pdt-rupture { margin: 18px; text-align: center; }
.pdt-rupture p { margin: 10px 0 16px; }

.pdt-onglets { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--sable); overflow-x: auto; flex-shrink: 0; }
.pdt-onglet { min-height: 46px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--brume); font: inherit; font-weight: 700; white-space: nowrap; cursor: pointer; }
.pdt-onglet.pdt-actif { color: var(--ruban); border-bottom-color: var(--ruban); }

.pdt-panneau { padding: 18px; }
.pdt-panneau-plan { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 0; }
.pdt-colonne-placer { padding: 10px 12px; border-right: 1px solid var(--sable); max-height: calc(clamp(340px, 68vh, 760px) + 110px); overflow-y: auto; }
#plan-de-table .pdt-colonne-placer h3 { margin-top: 0; }
.pdt-liste-placer { display: flex; flex-direction: column; gap: 6px; min-height: 90px; }
.pdt-etiquette {
  display: block; width: 100%; min-height: 44px; padding: 6px 10px; text-align: left; border: 1px solid var(--brume);
  border-left: 5px solid var(--nuit-claire); border-radius: 10px; background: var(--papier); color: var(--encre);
  font: inherit; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.pdt-etiquette small { display: block; color: var(--brume); }
.pdt-etiquette.pdt-categorie-enfant { border-left-color: var(--sapin); }
.pdt-etiquette.pdt-categorie-bebe { border-left-color: var(--or-fonce); }
.pdt-etiquette.pdt-selectionne { background: var(--or-pale); border-color: var(--encre); }
.pdt-zone-plan { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pdt-barre { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.pdt-zone-plan > .pdt-barre { margin: 0; padding: 10px 12px; }
.pdt-formulaire-ligne { display: inline-flex; margin: 0; }
.pdt-recherche { max-width: 260px; }
.pdt-conteneur-plan { position: relative; height: clamp(340px, 68vh, 760px); background: var(--creme); overflow: hidden; }
.pdt-barre-selection {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; flex-wrap: nowrap; align-items: center;
  gap: 10px; padding: 6px 12px; background: var(--or-pale); color: var(--encre);
}
.pdt-barre-selection .pdt-discret { color: var(--encre); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdt-barre-selection .pdt-bouton { flex: 0 0 auto; }
.pdt-barre-selection .pdt-espace { flex: 1 1 0; min-width: 0; }
.pdt-selection-nom { flex: 0 1 auto; min-width: 3em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdt-selection-regime { flex: 0 1 auto; min-width: 0; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
.pdt-libelle-court { display: none; }
.pdt-plan-vide { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 40px 20px; min-height: 280px; }
.pdt-plan-vide p { max-width: 420px; }
.pdt-resume { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 12px; font-size: .9rem; border-top: 1px solid var(--sable); color: var(--brume); }

.pdt-plan { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.pdt-piece { fill: var(--papier); stroke: var(--brume); stroke-width: 3; }
.pdt-cote-piece { fill: var(--brume); font-size: 13px; }
.pdt-meuble { cursor: move; }
.pdt-meuble rect { fill: var(--sable); stroke: var(--brume); }
.pdt-meuble text { fill: var(--encre); font-size: 13px; pointer-events: none; }
.pdt-table { cursor: move; }
.pdt-plateau { fill: var(--or-pale); stroke: var(--or-fonce); stroke-width: 2; }
.pdt-jointure { stroke: var(--or-fonce); stroke-width: 1; stroke-dasharray: 5 4; }
.pdt-nom-table { fill: var(--encre); font-size: 15px; font-weight: 700; pointer-events: none; }
.pdt-mesure-table { fill: var(--encre); font-size: 12px; pointer-events: none; }
.pdt-siege { cursor: pointer; outline: none; }
.pdt-siege circle { fill: var(--papier); stroke: var(--brume); stroke-width: 1.5; }
.pdt-siege text { fill: var(--papier); font-size: 11px; font-weight: 700; pointer-events: none; }
.pdt-siege.pdt-occupe circle { fill: var(--nuit-claire); stroke: var(--nuit-claire); }
.pdt-siege.pdt-categorie-enfant circle { fill: var(--sapin); stroke: var(--sapin); }
.pdt-siege.pdt-categorie-bebe circle { fill: var(--or-fonce); stroke: var(--or-fonce); }
.pdt-siege.pdt-epingle circle { stroke: var(--encre); stroke-width: 3; }
.pdt-siege.pdt-conflit circle { stroke: var(--ruban-vif); stroke-width: 4; stroke-dasharray: 5 3; }
.pdt-siege.pdt-selectionne circle { stroke: var(--or); stroke-width: 5; }
.pdt-siege.pdt-survole circle, .pdt-siege:focus-visible circle { stroke: var(--sapin-clair); stroke-width: 5; }
.pdt-fantome { position: fixed; z-index: 60; transform: translate(-50%, -130%); padding: 4px 12px; border-radius: 999px; background: var(--encre); color: var(--creme); font-size: .9rem; font-weight: 700; pointer-events: none; }

.pdt-carte { background: var(--papier); color: var(--encre); border: 1px solid var(--sable); border-radius: var(--rayon-carte); padding: 18px; margin: 0 0 18px; }
.pdt-vide { text-align: center; color: var(--brume); }
.pdt-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 10px; }
.pdt-cartes .pdt-carte { margin: 0; }
.pdt-chiffres { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.pdt-chiffre { flex: 1 1 130px; padding: 10px 12px; border-radius: 12px; background: var(--creme); border: 1px solid var(--sable); }
.pdt-chiffre strong { display: block; font-family: var(--police-titre); font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pdt-chiffre span { font-size: .875rem; color: var(--brume); }
.pdt-chiffre.pdt-alerte { background: var(--papier); border: 2px solid var(--ruban); }
.pdt-chiffre.pdt-alerte span { color: var(--ruban); font-weight: 700; }
.pdt-pastille { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--sable); color: var(--encre); font-size: .8125rem; font-weight: 700; white-space: nowrap; }
.pdt-reponse-oui { background: var(--vert-pale); color: var(--sapin); }
.pdt-reponse-non { background: var(--papier); color: var(--ruban); box-shadow: inset 0 0 0 1.5px var(--ruban); }
.pdt-liste { list-style: none; padding: 0; margin: 8px 0; }
.pdt-liste li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 0; border-bottom: 1px solid var(--sable); }
.pdt-liste li > span:first-child { flex: 1 1 180px; }
.pdt-liste-conseil { padding-left: 1.1rem; margin: 8px 0; }
.pdt-encart-alerte { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--papier); border: 2px solid var(--ruban); }
.pdt-encart-alerte ul { margin: 6px 0 0; padding-left: 1.1rem; }
.pdt-reglages { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0 0 12px; }
.pdt-reglages dt { color: var(--brume); }
.pdt-reglages dd { margin: 0; font-weight: 700; }
.pdt-journal { list-style: none; padding: 0; margin: 0; }
.pdt-journal li { padding: 6px 0; border-bottom: 1px solid var(--sable); font-size: .9375rem; }
.pdt-defilant { overflow-x: auto; }
.pdt-tableau { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.pdt-tableau th { text-align: left; font-size: .8125rem; color: var(--brume); }
.pdt-tableau th, .pdt-tableau td { padding: 8px; border-bottom: 1px solid var(--sable); vertical-align: middle; }
.pdt-tableau.pdt-compact { width: auto; margin-bottom: 10px; }
.pdt-ligne-active { background: var(--or-pale); font-weight: 700; }
.pdt-regime { display: block; color: var(--brume); }

#plan-de-table select, #plan-de-table input.pdt-recherche,
.pdt-champ input, .pdt-champ select, .pdt-champ textarea, .pdt-adresse {
  font: inherit; font-weight: 400; color: var(--encre); background: var(--papier);
  border: 1.5px solid var(--brume); border-radius: 12px; padding: 8px 12px; min-height: 44px; width: 100%;
}
#plan-de-table .pdt-liste select { width: auto; }
#plan-de-table select:focus, #plan-de-table input.pdt-recherche:focus,
.pdt-champ input:focus, .pdt-champ select:focus, .pdt-champ textarea:focus, .pdt-adresse:focus { outline: 3px solid var(--or); outline-offset: 1px; border-color: var(--encre); }

.pdt-dialogue { width: min(100vw - 24px, 500px); max-height: 88vh; max-height: 88dvh; border: 0; border-radius: var(--rayon-carte); padding: 20px; background: var(--papier); color: var(--encre); }
.pdt-dialogue::backdrop { background: rgba(11, 22, 51, .7); }
.pdt-dialogue h2 { font-size: 1.375rem; }
.pdt-formulaire { display: flex; flex-direction: column; gap: 14px; }
.pdt-champ { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .9375rem; }
.pdt-choix { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.pdt-choix input { width: 22px; height: 22px; accent-color: var(--sapin); }
.pdt-actions-dialogue { position: sticky; bottom: -20px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 10px 0 20px; margin-bottom: -20px; background: var(--papier); }
.pdt-lien-unique { display: flex; flex-direction: column; gap: 10px; }
.pdt-adresse { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .875rem; }
.pdt-liste-connus li > span:first-child { flex: 1 1 140px; }

.pdt-annonces { position: fixed; left: 50%; bottom: 16px; z-index: 70; transform: translateX(-50%); width: min(92vw, 520px); pointer-events: none; }
.pdt-annonce { margin: 6px 0; padding: 12px 16px; border-radius: 14px; font-weight: 700; background: var(--vert-pale); color: var(--sapin); box-shadow: var(--ombre-douce); }
.pdt-annonce-erreur { background: var(--papier); color: var(--ruban); border: 2px solid var(--ruban); }

@media (max-width: 760px) {
  .pdt-panneau-plan { grid-template-columns: minmax(0, 1fr); }
  .pdt-colonne-placer { border-right: 0; border-bottom: 1px solid var(--sable); padding: 8px 10px; max-height: none; overflow: visible; }
  #plan-de-table .pdt-colonne-placer h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pdt-liste-placer { flex-direction: row; overflow-x: auto; min-height: 46px; padding-bottom: 2px; }
  .pdt-liste-placer { -webkit-overflow-scrolling: touch; }
  .pdt-etiquette { width: auto; flex: 0 0 auto; white-space: nowrap; touch-action: pan-x; }
  .pdt-etiquette small { display: none; }
  .pdt-etat { margin-left: 0; }
  .pdt-panneau { padding: 12px; }
  .pdt-conteneur-plan { height: clamp(320px, 58vh, 620px); }
  /* Barre de sélection compacte : une seule ligne, pour ne pas couvrir les sièges du haut. */
  .pdt-barre-selection { gap: 6px; padding: 4px 8px; }
  .pdt-barre-selection .pdt-selection-aide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pdt-barre-selection .pdt-selection-regime { max-width: 4.5em; }
  .pdt-barre-selection .pdt-bouton { min-height: 40px; padding: 4px 10px; font-size: .875rem; }
  .pdt-barre-selection .pdt-libelle-long { display: none; }
  .pdt-barre-selection .pdt-libelle-court { display: inline; }
  .pdt-recherche { max-width: none; }
}

/* Dossier à imprimer et marque-places : documents sans script ni autre feuille. */
body.pdt-document {
  box-sizing: border-box; margin: 0 auto; max-width: 1000px; padding: 24px;
  background: var(--papier, #FFFDF8); color: var(--encre, #1A1430);
  font-family: var(--police-texte, "Nunito Sans", "Segoe UI", Arial, sans-serif); font-size: 1rem; line-height: 1.5;
}
.pdt-document *, .pdt-document *::before, .pdt-document *::after { box-sizing: border-box; }
.pdt-document h1, .pdt-document h2, .pdt-document h3 { font-family: var(--police-titre, "Fraunces", Georgia, serif); line-height: 1.15; }
.pdt-document h1 { font-size: 1.75rem; margin: 0 0 4px; }
.pdt-document h2 { font-size: 1.25rem; margin: 24px 0 8px; }
.pdt-document h3 { font-size: 1.0625rem; margin: 0 0 4px; }
.pdt-document h3 small { font-family: var(--police-texte, "Nunito Sans", "Segoe UI", Arial, sans-serif); font-weight: 400; color: var(--brume, #5B5570); }
.pdt-document p { margin: 0 0 8px; }
.pdt-document ul { margin: 0 0 8px; padding-left: 1.2rem; }
.pdt-document-date { color: var(--brume, #5B5570); font-weight: 700; }
.pdt-sans-impression { color: var(--brume, #5B5570); font-style: italic; }
.pdt-plan-fixe { display: block; width: 100%; height: auto; max-height: 70vh; margin: 12px 0; }
.pdt-liste-table { break-inside: avoid; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--sable, #EFE6D2); border-radius: 12px; }
.pdt-liste-table ul { columns: 2; column-gap: 32px; margin: 0; }
.pdt-marque-places { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin-top: 16px; }
.pdt-marque-place {
  height: 5.5cm; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding-bottom: .5cm;
  border: 1px dashed var(--brume, #5B5570); text-align: center; break-inside: avoid;
  font-family: var(--police-titre, "Fraunces", Georgia, serif);
}
.pdt-marque-place strong { font-size: 1.8rem; line-height: 1.1; }
.pdt-marque-place span { font-size: 1.1rem; }
.pdt-marque-place small { font-family: var(--police-texte, "Nunito Sans", "Segoe UI", Arial, sans-serif); font-size: .8rem; color: var(--brume, #5B5570); }

@media print {
  .pdt-sans-impression, .pdt-annonces, .pdt-dialogue, .pdt-fantome { display: none !important; }
  body.pdt-document { max-width: none; padding: 0; background: #fff; color: #000; }
  .pdt-plan-fixe { max-height: 16cm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pdt-document h2, .pdt-document h3 { break-after: avoid; }
  .pdt-marque-places { margin-top: 0; }
  .pdt-marque-place { border-color: #999; }
}
