/* Générateur — pensé d'abord pour un téléphone tenu d'une main dans un logement vide. */
.gen-barre { position: sticky; top: 64px; z-index: 30; background: var(--papier); border-bottom: 1px solid var(--trait-clair); }
.gen-barre__in { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 6px; }
.gen-titre { flex: 1; min-width: 0; }
.gen-titre strong { display: block; font: 700 1.02rem/1.25 var(--titre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gen-etat { font-size: .8rem; color: var(--encre-3); }
.gen-etapes { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.gen-etapes::-webkit-scrollbar { display: none; }
.gen-etapes button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px 6px 6px; border: 1px solid var(--trait); border-radius: 20px;
  background: var(--feuille); color: var(--encre-2); font: 600 .86rem/1 var(--texte); cursor: pointer; }
.gen-etapes button span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--champ); font: 600 .78rem/1 var(--mono); }
.gen-etapes button[aria-current="step"] { background: var(--encre); border-color: var(--encre); color: #fff; }
.gen-etapes button[aria-current="step"] span { background: var(--accent); color: #fff; }
.gen-corps { display: grid; gap: 24px; padding-top: 18px; padding-bottom: 24px; }
@media (min-width: 1100px) {
  .gen-corps { grid-template-columns: minmax(0, 1fr) minmax(0, 520px); align-items: start; }
  .gen-voir { display: none; }
}
.gen-form { min-width: 0; }
.gen-h { font-size: 1.55rem; margin: 4px 0 14px; }
.gen-h2 { font-size: 1.12rem; margin: 26px 0 8px; }
.gen-etape .champ { margin-bottom: 12px; }
.req { color: var(--accent); }
.grille-champs { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.champ.etroit { max-width: 110px; }
.bloc-f { border: 1px solid var(--trait); border-radius: var(--r); background: var(--feuille); padding: 14px 14px 4px; margin: 0 0 14px; }
.bloc-f legend { font: 700 .82rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); padding: 0 6px; }
.interrupteur { background: var(--feuille); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px; margin-bottom: 14px; }
.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.segment button { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--trait); border-radius: var(--r); background: var(--feuille); cursor: pointer; font: inherit; color: var(--encre); }
.segment button small { color: var(--encre-3); }
.segment button[aria-checked="true"] { border-color: var(--encre); box-shadow: inset 0 0 0 1px var(--encre); background: var(--accent-voile); }
.ligne-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: end; padding: 10px 0; border-bottom: 1px dashed var(--trait); position: relative; }
.ligne-liste .btn-x { position: absolute; top: 6px; right: 0; }
@media (min-width: 640px) { .ligne-liste { grid-template-columns: 1.2fr 1fr .8fr 40px; } .ligne-liste .btn-x { position: static; margin-bottom: 14px; } }
.btn-x { width: 38px; height: 38px; border: 1px solid var(--trait); border-radius: var(--r); background: var(--feuille); color: var(--encre-2); font-size: 1.1rem; cursor: pointer; }
.btn-x:hover { border-color: var(--encre); color: var(--encre); }

/* Pièces */
.piece { background: var(--feuille); border: 1px solid var(--trait); border-radius: var(--r); margin-bottom: 12px; }
.piece__tete { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; border-bottom: 1px solid var(--trait-clair); }
.piece.ferme .piece__tete { border-bottom: 0; }
.piece__bascule { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 6px 10px; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; color: var(--encre); }
.piece__nom { font: 700 1.05rem/1.2 var(--titre); }
.piece__compte { font: 500 .8rem/1 var(--mono); color: var(--encre-3); background: var(--champ); padding: 5px 8px; border-radius: 12px; white-space: nowrap; }
.piece__compte.complet { color: #fff; background: var(--neuf); }
.piece__outils { display: flex; gap: 4px; }
.piece__corps { padding: 12px; }
.piece__renommer { max-width: 360px; }
.piece__raccourcis { margin: 0 0 8px; }
.element { padding: 12px 0; border-top: 1px solid var(--trait-clair); }
.element.pire { background: var(--alerte-voile); margin: 0 -12px; padding: 12px; }
.element__tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 8px; }
.element__nom { font-weight: 600; }
.element.a-faire .element__nom::after { content: " ·"; color: var(--accent); }
.element__avant { font: 500 .78rem/1 var(--mono); color: var(--encre-2); background: var(--champ); padding: 4px 7px; border-radius: 3px; }
.puces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.puce { min-height: 42px; padding: 4px 2px; border: 1.5px solid var(--trait); border-radius: var(--r); background: var(--feuille); cursor: pointer;
  font: 600 .74rem/1.1 var(--texte); color: var(--encre-2); }
@media (min-width: 480px) { .puce { font-size: .82rem; } }
.puce[aria-checked="true"] { color: #fff; }
.puce--neuf[aria-checked="true"] { background: var(--neuf); border-color: var(--neuf); }
.puce--bon[aria-checked="true"] { background: var(--bon); border-color: var(--bon); }
.puce--usage[aria-checked="true"] { background: var(--usage); border-color: var(--usage); }
.puce--mauvais[aria-checked="true"] { background: var(--mauvais); border-color: var(--mauvais); }
.puce--na[aria-checked="true"] { background: var(--encre-3); border-color: var(--encre-3); }
.element__pied { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.element__pied .obs { flex: 1; min-height: 42px; font-size: 15px; }
.btn-photo { flex: none; display: inline-grid; place-items: center; width: 46px; height: 42px; border: 1.5px solid var(--encre); border-radius: var(--r); background: var(--feuille); color: var(--encre); cursor: pointer; }
.btn-photo:hover { background: var(--champ); }
.btn-photo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.btn-photo.envoi { opacity: .5; pointer-events: none; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.vignettes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.vignettes:empty { display: none; }
.vignette { width: 64px; height: 64px; padding: 0; border: 1px solid var(--trait); border-radius: 3px; overflow: hidden; background: var(--champ); cursor: pointer; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.piece__ajout { display: flex; gap: 8px; margin: 12px 0; }
.piece__ajout input { flex: 1; }
.ajout-piece { margin: 18px 0; }
.ajout-piece__grille { display: flex; flex-wrap: wrap; gap: 6px; }

/* Mobilier */
.mobilier { border-bottom: 1px dashed var(--trait); padding: 10px 0; }
.mobilier.manquant .case span { color: var(--mauvais); }
.mobilier__detail { display: grid; grid-template-columns: 90px 1fr; gap: 0 10px; margin-top: 8px; }
.mobilier__detail .champ:last-child { grid-column: 1 / -1; }
@media (min-width: 640px) { .mobilier__detail { grid-template-columns: 90px 160px 1fr; } .mobilier__detail .champ:last-child { grid-column: auto; } }

/* Signatures */
.signatures { display: grid; gap: 14px; }
@media (min-width: 760px) { .signatures { grid-template-columns: 1fr 1fr; } }
.signature { background: var(--feuille); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px; }
.pad { width: 100%; height: 150px; border: 1.5px dashed var(--encre-3); border-radius: var(--r); background: #FBFAF7; touch-action: none; cursor: crosshair; }
.signature__pied { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.signature__pied input { flex: 1 1 160px; min-height: 38px; }
.signature.signee img { max-width: 100%; height: 90px; object-fit: contain; display: block; border-bottom: 1px solid var(--trait); }

/* Achat */
.achat { margin-top: 24px; border: 1.5px solid var(--encre); }
.achat--ok { border-color: var(--neuf); }
.achat__offres { display: grid; gap: 8px; margin-bottom: 14px; }
.offre { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--trait); border-radius: var(--r); cursor: pointer; }
.offre:has(input:checked) { border-color: var(--encre); background: var(--accent-voile); }
.offre input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; }
.offre small { display: block; color: var(--encre-3); }
.achat__boutons { display: flex; flex-wrap: wrap; gap: 10px; }
.code-promo summary { cursor: pointer; color: var(--encre-2); font-size: .92rem; margin-bottom: 10px; }
.consentement { margin: 6px 0 14px; }
.manques ul { margin: 6px 0 0; padding-left: 20px; }

/* Navigation bas de page (collante sur téléphone) */
.gen-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
@media (max-width: 1099px) {
  .gen-nav { position: sticky; bottom: 0; z-index: 20; margin: 22px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(245, 244, 239, .97); border-top: 1px solid var(--trait); }
  .gen-apercu { display: none; }
}
.gen-nav .btn { flex: 1; max-width: 220px; }

/* Aperçu */
.gen-apercu { position: sticky; top: 140px; background: var(--feuille); border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden; }
.gen-apercu__barre { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--trait-clair); font-size: .9rem; }
.gen-apercu iframe { display: block; width: 100%; height: calc(100vh - 200px); min-height: 520px; border: 0; background: #fff; }
.gen-dialogue { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: var(--papier); }
.gen-dialogue::backdrop { background: rgba(22, 25, 28, .5); }
.gen-dialogue__barre { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--trait); background: var(--feuille); }
.gen-dialogue iframe { width: 100%; height: calc(100dvh - 58px); border: 0; background: #fff; }
.gen-plus-tard { margin: 8px 0 32px; }
.gen-plus-tard summary { cursor: pointer; font-weight: 600; }
.gen-seo { padding: 40px 0; }

/* ── Vue bureau (refonte 25/09/2026) : le plan à gauche, le formulaire au centre,
   le document à droite. Une seule page qui défile : les deux colonnes latérales
   restent collées, seul l'aperçu (le document lui-même) a son propre défilement. */
.gen-rail { display: none; }
.gen-visite-btn { display: inline-flex; }
@media (min-width: 1240px) {
  .gen-corps { grid-template-columns: 210px minmax(0, 1fr) minmax(0, 460px); max-width: 1440px; }
  .gen-rail { display: block; position: sticky; top: 88px; align-self: start; }
  .gen-etapes, .gen-visite-btn { display: none; }
  .gen-barre__in { padding-bottom: 10px; }
  .gen-apercu { top: 88px; }
  .gen-apercu iframe { height: calc(100vh - 140px); }
}
.gen-rail__titre { font: 600 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--encre-3); margin: 4px 0 10px; }
.gen-rail__etapes { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 2px; }
.gen-rail__etapes > li > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; cursor: pointer;
  font: 600 .92rem/1.2 var(--texte); color: var(--encre-2); text-align: left; }
.gen-rail__etapes > li > button:hover { background: var(--champ); color: var(--encre); }
.gen-rail__etapes > li > button[aria-current="step"] { background: var(--feuille); color: var(--encre); box-shadow: 0 0 0 1px var(--trait), var(--ombre); }
.gen-rail__n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--champ); font: 600 .72rem/1 var(--mono); color: var(--encre-2); }
.gen-rail__etapes button[aria-current="step"] .gen-rail__n { background: var(--accent); color: #fff; }
.gen-rail__pieces { list-style: none; margin: 2px 0 6px 21px; padding: 0 0 0 12px; border-left: 1px solid var(--trait); display: grid; gap: 1px; }
.gen-rail__pieces button { width: 100%; display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: 500 .86rem/1.25 var(--texte); color: var(--encre-3); text-align: left; }
.gen-rail__pieces button:hover { background: var(--champ); color: var(--encre); }
.gen-rail__pieces button small { font: 500 .72rem/1.4 var(--mono); }
.gen-rail__pieces button.encours { color: var(--encre-2); }
.gen-rail__pieces button.fait { color: var(--encre); }
.gen-rail__pieces button.fait small { color: var(--neuf); }
.gen-rail__pieces button.pire { color: var(--mauvais); }
.gen-rail__pieces button.pire small { color: #fff; background: var(--mauvais); padding: 0 6px; border-radius: 8px; }
.gen-rail__pieces button.pire span::after { content: " · dégradé"; font-size: .76rem; }
.gen-rail__visite { margin-top: 4px; }

/* Finitions de la refonte */
.gen-h { font-family: var(--display); font-weight: 400; font-size: 2.2rem; }
.piece, .bloc-f, .interrupteur, .signature, .segment button, .offre { border-radius: 14px; }
.piece { box-shadow: var(--ombre); }
.puce { border-radius: 10px; }
.btn-photo, .btn-x { border-radius: 10px; }
.gen-apercu { border-radius: 16px; box-shadow: var(--ombre); }
.achat { border-radius: 16px; }

/* Retenue suggérée (sortie) */
.retenues { margin: 18px 0; border-radius: 16px; }
.table-defile { overflow-x: auto; }
.retenues__table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.retenues__table th { text-align: left; font: 600 .72rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--encre-3); padding: 8px 6px; border-bottom: 1px solid var(--trait); }
.retenues__table td { padding: 10px 6px; border-bottom: 1px solid var(--trait-clair); vertical-align: top; }
.retenues__table td small { display: block; color: var(--encre-3); font-size: .8rem; margin-top: 2px; }
.retenues__table input { width: 110px; min-height: 38px; }
.retenues__table select { min-height: 38px; max-width: 200px; }
.retenues__table .montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.retenues__table tfoot td { border-bottom: 0; font-weight: 600; padding-top: 14px; }

.gen-mode-info{padding-top:16px;padding-bottom:16px;font-size:14px;line-height:1.7}.gen-mode-info a{margin-left:6px;text-decoration:underline}

.gen-titre h1{font:inherit;font-weight:700;margin:0}
