:root {
  --creme: #FCF4E9;
  --blanc: #FFFDF9;
  --rose: #E09A9A;
  --rose-clair: #F6DDDA;
  --rose-texte: #9A5257;
  --sauge: #7F8F6B;
  --sauge-fonce: #55654A;
  --sauge-clair: #E4EADB;
  --trait: #EBDDCB;
  --rayon: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--sauge-fonce);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}
h1, h2 { font-weight: normal; line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-style: italic; color: var(--sauge); }
h2 { font-size: 1.3rem; color: var(--rose-texte); }
p { margin: 0 0 1rem; }
a { color: var(--rose-texte); }
a:hover { color: var(--sauge-fonce); }
:focus-visible { outline: 3px solid var(--rose); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.discret { color: #7a7566; font-size: .95rem; }
.centre { text-align: center; }
.droite { text-align: right; }
.inline { display: inline; margin: 0; }

/* Bandeau mode préparation */
.bandeau { background: var(--sauge-fonce); color: var(--creme); text-align: center; font-size: .9rem; padding: .4rem 1rem; }

/* En-tête */
.entete { background: var(--blanc); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 10; }
.entete-in { max-width: 70rem; margin: 0 auto; padding: .6rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.marque { text-decoration: none; font-size: 1.45rem; font-style: italic; line-height: 1.1; }
.marque-1 { color: var(--sauge); }
.marque-2 { color: var(--rose-texte); font-size: 1.05rem; font-style: normal; letter-spacing: .08em; }
.menu { display: flex; align-items: center; gap: .3rem 1.1rem; flex-wrap: wrap; }
.menu > a { text-decoration: none; color: var(--sauge-fonce); padding: .35rem .1rem; border-bottom: 2px solid transparent; }
.menu > a:hover, .menu > a[aria-current="page"] { border-bottom-color: var(--rose); }
.menu-espace { display: flex; align-items: center; gap: .8rem; margin-left: .4rem; }
.burger { display: none; background: none; border: 1px solid var(--trait); border-radius: 10px; padding: .6rem .7rem; cursor: pointer; }
.burger-barres, .burger-barres::before, .burger-barres::after { display: block; width: 22px; height: 2px; background: var(--sauge-fonce); position: relative; content: ""; }
.burger-barres::before { position: absolute; top: -7px; }
.burger-barres::after { position: absolute; top: 7px; }

@media (max-width: 62rem) {
  .burger { display: block; }
  .menu { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: .4rem 0 .8rem; }
  .menu.ouvert { display: flex; }
  .menu > a { padding: .85rem .3rem; border-bottom: 1px solid var(--trait); }
  .menu-espace { margin: .8rem 0 0; justify-content: space-between; }
}

/* Contenu */
.contenu { max-width: 70rem; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }
.page { max-width: 52rem; margin: 0 auto; }
.chapo { font-size: 1.15rem; margin-bottom: 1.5rem; }
.fil { font-size: .95rem; margin-bottom: .4rem; }
.carte { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.3rem 1.4rem; margin-bottom: 1.1rem; }
.carte-centre { text-align: center; }
.carte-form { max-width: 28rem; margin: 1rem auto; }
.carte-lien { display: block; text-decoration: none; color: inherit; transition: border-color .2s, background .2s; }
.carte-lien:hover { border-color: var(--rose); background: #fff; }
.carte-attente { background: transparent; border-style: dashed; }
.grille-2 { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grille-3 { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.grille-2 .carte, .grille-3 .carte { margin-bottom: 0; }

/* Accueil */
.hero { text-align: center; padding: .5rem 0 2rem; }
.hero-logo { display: block; width: min(86vw, 28rem); height: auto; margin: 0 auto; }
.hero-texte { max-width: 36rem; margin: 0 auto 1.4rem; font-size: 1.2rem; }
.hero-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* Boutons */
.btn { display: inline-block; background: var(--sauge-fonce); color: var(--creme); border: 2px solid var(--sauge-fonce); border-radius: 999px; padding: .7rem 1.5rem; font: inherit; font-size: 1rem; text-decoration: none; cursor: pointer; text-align: center; transition: background .2s, border-color .2s, color .2s; }
.btn:hover { background: var(--rose-texte); border-color: var(--rose-texte); color: var(--creme); }
.btn-clair { background: transparent; color: var(--sauge-fonce); }
.btn-clair:hover { background: var(--rose-clair); border-color: var(--rose); color: var(--sauge-fonce); }
.btn-petit { padding: .4rem 1rem; font-size: .92rem; }
.btn-grand { font-size: 1.15rem; padding: .9rem 2rem; word-break: break-all; }
.btn-plein { width: 100%; margin-top: 1.1rem; }
.lien-bouton { background: none; border: 0; padding: 0; font: inherit; color: var(--rose-texte); text-decoration: underline; cursor: pointer; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

/* Formulaires */
label { display: block; margin: 1rem 0 .3rem; font-size: .98rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]) {
  width: 100%; font: inherit; color: var(--sauge-fonce); background: #fff; border: 1.5px solid #d8c9b5; border-radius: 10px; padding: .7rem .85rem; min-height: 2.9rem;
}
input:focus { border-color: var(--sauge); outline: 3px solid var(--sauge-clair); }
.champ-mdp { position: relative; }
.champ-mdp input { padding-right: 5.5rem; }
.voir-mdp { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); background: var(--sauge-clair); border: 0; border-radius: 8px; padding: .4rem .7rem; font: inherit; font-size: .88rem; color: var(--sauge-fonce); cursor: pointer; }
.form-ligne { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); align-items: end; margin-top: 1rem; }
.form-ligne > p, .form-ligne > button { grid-column: 1 / -1; }
.recherche { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.2rem 0 .6rem; }
.recherche input { flex: 1 1 14rem; width: auto; }

/* Messages */
.message { border-radius: 10px; padding: .8rem 1rem; margin: 0 0 1rem; border: 1px solid; word-break: break-word; }
.message-ok { background: var(--sauge-clair); border-color: var(--sauge); }
.message-info { background: #fff6e3; border-color: #e3c98b; }
.message-erreur { background: var(--rose-clair); border-color: var(--rose); color: #7d3338; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th { text-align: left; font-weight: normal; font-style: italic; color: var(--sauge); padding: .5rem .6rem; border-bottom: 2px solid var(--rose-clair); }
.tableau th.droite { text-align: right; }
.tableau td { padding: .7rem .6rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.pastille { display: inline-block; border-radius: 999px; padding: .1rem .7rem; font-size: .85rem; }
.pastille-ok { background: var(--sauge-clair); }
.pastille-attente { background: var(--rose-clair); color: #7d3338; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

@media (max-width: 40rem) {
  .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau, .tableau tbody, .tableau tr, .tableau td { display: block; width: 100%; }
  .tableau tr { padding: .6rem 0; border-bottom: 1px solid var(--trait); }
  .tableau td { border: 0; padding: .2rem 0; text-align: left !important; }
  .tableau td[data-label]::before { content: attr(data-label) " : "; color: var(--sauge); font-style: italic; }
  .tableau td:last-child { padding-top: .5rem; }
}

/* Pied de page */
.pied { text-align: center; font-size: .9rem; padding: 1.5rem 1rem 2rem; border-top: 1px solid var(--trait); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Admin des tarifs ---------- */
.page-large { max-width: 70rem; }
.btn-danger { background: transparent; color: var(--rose-texte); border-color: var(--rose); }
.btn-danger:hover { background: var(--rose-texte); border-color: var(--rose-texte); color: var(--creme); }
.coche { display: flex; align-items: center; gap: .5rem; margin: 1rem 0 0; }
.coche input { width: 1.2rem; height: 1.2rem; }
.deux-col { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.actions-form { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.4rem 0 0; }

.groupe-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.groupe-tete h2 { margin-bottom: .1rem; }
.groupe-tete p { margin: 0; }
.groupe-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.groupe-pied { margin: .9rem 0 0; }
.groupe-entete { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .8rem; }
.groupe-entete input { flex: 1 1 18rem; width: auto; }
.options { margin-top: .8rem; }
.options > summary { cursor: pointer; font-size: .92rem; color: var(--sauge); font-style: italic; }
details.carte.options { padding: 1rem 1.4rem; }

.la-liste { margin-top: .8rem; }
.la { display: grid; grid-template-columns: minmax(12rem, 1fr) 5.5rem 6rem 6rem 19rem; gap: .3rem .8rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--trait); margin: 0; }
.la-entete { font-style: italic; color: var(--sauge); font-size: .88rem; border-top: 0; border-bottom: 2px solid var(--rose-clair); padding: .2rem 0; }
.la-masquee .la-nom, .la-masquee .la-code, .la-masquee .la-mut, .la-masquee .la-pat { opacity: .5; }
.la-boutons { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; }
.pastille-bouton { font: inherit; font-size: .82rem; border-radius: 999px; padding: .2rem .8rem; border: 1.5px solid; cursor: pointer; min-width: 5.2rem; }
.pastille-bouton.on { background: var(--sauge-clair); border-color: var(--sauge); color: var(--sauge-fonce); }
.pastille-bouton.off { background: transparent; border-color: #cdbfae; color: #7a7566; }
.mini { font: inherit; font-size: .88rem; background: transparent; border: 1.5px solid var(--trait); border-radius: 8px; padding: .2rem .6rem; color: var(--sauge-fonce); cursor: pointer; text-decoration: none; display: inline-block; }
.mini:hover { background: var(--rose-clair); border-color: var(--rose); }

@media (max-width: 64rem) {
  .la-entete { display: none; }
  .la { grid-template-columns: 1fr 1fr; padding: .8rem 0; }
  .la-nom { grid-column: 1 / -1; font-weight: bold; }
  .la-code { grid-column: 1 / -1; font-size: .9rem; color: #7a7566; }
  .la-mut::before { content: "Mutuelle : "; color: var(--sauge); font-style: italic; }
  .la-pat::before { content: "À charge : "; color: var(--sauge); font-style: italic; }
  .la-mut, .la-pat { text-align: left; font-size: .95rem; }
  .la-boutons { grid-column: 1 / -1; justify-content: flex-start; margin-top: .3rem; }
}

/* ---------- Dossiers, patientes, espace ---------- */
select, textarea, input[type=date], input[type=file] {
  width: 100%; font: inherit; color: var(--sauge-fonce); background: #fff; border: 1.5px solid #d8c9b5; border-radius: 10px; padding: .65rem .85rem; min-height: 2.9rem;
}
textarea { line-height: 1.5; resize: vertical; }
select:focus, textarea:focus, input[type=date]:focus { border-color: var(--sauge); outline: 3px solid var(--sauge-clair); }
code { background: var(--sauge-clair); border-radius: 5px; padding: .05rem .35rem; font-size: .9em; }
.choix-mode { margin: 1.2rem 0 .4rem; }
.choix-mode .coche { margin: .3rem 0; }

.dl-liste { margin-top: .6rem; }
.dl { display: flex; align-items: center; gap: .3rem 1rem; padding: .7rem 0; border-top: 1px solid var(--trait); margin: 0; flex-wrap: wrap; }
.dl-liste > .dl:first-child, .dl-liste > .pat:first-child, .dl-liste > .acc:first-child { border-top: 0; }
.dl-nom { flex: 1 1 14rem; font-size: 1.05rem; }
a.dl-nom { text-decoration: none; color: var(--sauge-fonce); }
a.dl-nom:hover { color: var(--rose-texte); text-decoration: underline; }
.dl-meta { color: #7a7566; font-size: .9rem; }
a.dl-lien { text-decoration: none; color: var(--sauge-fonce); }
a.dl-lien:hover { background: var(--rose-clair); }
a.dl-lien .dl-meta { color: var(--rose-texte); }
.type-pastille { display: inline-block; font-size: .78rem; border-radius: 999px; padding: .05rem .6rem; margin-right: .4rem; border: 1px solid; vertical-align: middle; }
.type-audio { background: var(--rose-clair); border-color: var(--rose); color: #7d3338; }
.type-pdf   { background: var(--sauge-clair); border-color: var(--sauge); }
.type-page  { background: #fff6e3; border-color: #e3c98b; color: #6b5420; }

/* Liste des patientes */
.filtres { display: grid; gap: .2rem 1rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); align-items: end; margin-bottom: 1rem; }
.filtres .filtre-q { grid-column: span 2; }
.filtres label { margin-top: .4rem; font-size: .9rem; font-style: italic; color: var(--sauge); }
.filtre-btn { display: flex; gap: .5rem; align-items: center; padding-bottom: .1rem; }
.pat { display: grid; grid-template-columns: minmax(12rem, 1fr) 2fr auto; gap: .4rem 1rem; align-items: center; padding: .7rem 0; border-top: 1px solid var(--trait); }
.pat-nom { display: flex; flex-direction: column; }
.pat-nom a { text-decoration: none; color: var(--sauge-fonce); font-size: 1.05rem; }
.pat-nom a:hover { color: var(--rose-texte); }
.pat-nom .discret { font-size: .85rem; word-break: break-all; }
.pat-acces { display: flex; flex-wrap: wrap; gap: .3rem .4rem; align-items: center; }
.pat-actions { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; }
.chip { display: inline-block; font-size: .82rem; border-radius: 999px; padding: .1rem .7rem; border: 1px solid; white-space: nowrap; }
.chip-actif   { background: var(--sauge-clair); border-color: var(--sauge); }
.chip-bientot { background: #fff1d6; border-color: #e0b25a; color: #6b4a0c; }
.chip-futur   { background: #e8eef7; border-color: #9db4d6; color: #2f4668; }
.chip-expire  { background: #efe9e1; border-color: #cdbfae; color: #7a7566; }
@media (max-width: 52rem) {
  .pat { grid-template-columns: 1fr; }
  .pat-actions { justify-content: flex-start; }
  .filtres .filtre-q { grid-column: 1 / -1; }
}

/* Fiche patiente */
.acc { padding: .8rem 0; border-top: 1px solid var(--trait); margin: 0; }
.acc-nom { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.acc-dates { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; margin-top: .5rem; }
.acc-dates input[type=date] { width: auto; min-height: 2.4rem; padding: .3rem .6rem; }
.acc-dates .lt-label { position: static; width: auto; height: auto; clip: auto; margin: 0; font-size: .9rem; }
.form-acces select, .form-acces input { max-width: 100%; }

/* Espace patientes */
.lecteur { text-align: center; padding: 2rem 1.4rem; }
.lecteur audio { width: 100%; max-width: 32rem; }
.pdf { width: 100%; height: 75vh; min-height: 28rem; border: 1px solid var(--trait); border-radius: var(--rayon); background: #fff; }
.texte-page h2 { margin-top: 1.2rem; }
.texte-page ul { padding-left: 1.3rem; }
.texte-page p:last-child, .texte-page ul:last-child { margin-bottom: 0; }

/* ---------- Facturation ---------- */
.annees { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-bottom: 1.2rem; }
.annee-case { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 1.2rem 1.4rem; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: .3rem; margin: 0; }
a.annee-case:hover { border-color: var(--rose); background: #fff; }
.annee-num { font-size: 2.3rem; font-style: italic; color: var(--sauge); line-height: 1.1; }
.annee-info { font-size: .95rem; }
.annee-ajout { border-style: dashed; background: transparent; justify-content: center; align-items: center; min-height: 7rem; }

.mois-grille { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); margin: 1.2rem 0 .6rem; }
.mois-case { border: 2px solid; border-radius: var(--rayon); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--sauge-fonce); min-height: 7.5rem; transition: transform .15s; }
.mois-case:hover { transform: translateY(-2px); }
.mois-vide   { background: #f3eee6; border-color: #ddd2c2; }
.mois-encode { background: #fff1d6; border-color: #e0b25a; }
.mois-envoye { background: var(--sauge-clair); border-color: var(--sauge); }
.mois-nom { font-size: 1.2rem; font-style: italic; }
.mois-statut { font-size: .82rem; }
.mois-montant { font-size: 1.2rem; font-weight: bold; margin-top: auto; }
.mois-detail { font-size: .85rem; color: #5d6b52; }
.mois-vide-txt { font-weight: normal; font-size: .88rem; color: #7a7566; }
.mois-courant { box-shadow: 0 0 0 3px var(--rose); }
.legende { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; font-size: .88rem; color: #7a7566; margin: 0 0 1.4rem; }
.pt { display: inline-block; width: .9rem; height: .9rem; border-radius: 50%; border: 2px solid; margin-right: .3rem; vertical-align: middle; }
.pt-vide { background: #f3eee6; border-color: #ddd2c2; }
.pt-encode { background: #fff1d6; border-color: #e0b25a; }
.pt-envoye { background: var(--sauge-clair); border-color: var(--sauge); }
.mois-pastille { display: inline-block; vertical-align: middle; font-size: .85rem; font-style: normal; border: 2px solid; border-radius: 999px; padding: .1rem .8rem; margin-left: .5rem; color: var(--sauge-fonce); }
.tableau tfoot td { border-top: 2px solid var(--rose-clair); padding: .7rem .6rem; }

.fact-table { width: 100%; border-collapse: collapse; min-width: 34rem; }
.fact-table th { text-align: left; font-weight: normal; font-style: italic; color: var(--sauge); padding: .3rem .4rem; font-size: .92rem; }
.fact-table td { padding: .25rem .3rem; border-top: 1px solid var(--trait); vertical-align: middle; }
.fact-table input { min-height: 2.5rem; padding: .35rem .5rem; }
.fact-table input[type=number] { width: 5.5rem; }
.fl-total { font-weight: bold; text-align: center; white-space: nowrap; min-width: 4rem; }
.fl-err { color: #b3261e; }
.totaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; text-align: center; background: var(--sauge-clair); border-color: var(--sauge); }
.totaux > div { display: flex; flex-direction: column; }
.totaux strong { font-size: 1.35rem; }
.totaux-total strong { font-size: 1.8rem; color: var(--sauge-fonce); }

.verifs { list-style: none; padding: 0; margin: .6rem 0; }
.verif { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0; }
.verif-ico { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: bold; border: 2px solid; }
.verif-ok .verif-ico   { background: var(--sauge-clair); border-color: var(--sauge); }
.verif-info .verif-ico { background: #e8eef7; border-color: #9db4d6; }
.verif-warn .verif-ico { background: #fff1d6; border-color: #e0b25a; }
.verif-err .verif-ico  { background: var(--rose-clair); border-color: var(--rose); color: #7d3338; }
.hist { padding: .5rem 0; border-top: 1px solid var(--trait); display: flex; flex-direction: column; gap: .1rem; }
.dl-liste > .hist:first-child { border-top: 0; }
.hist-detail { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Correctif : champs heure / nombre + colonnes du tableau d'encodage ---------- */
input[type=time], input[type=number] {
  width: 100%; font: inherit; color: var(--sauge-fonce); background: #fff; border: 1.5px solid #d8c9b5; border-radius: 10px; padding: .65rem .85rem; min-height: 2.9rem;
}
input[type=time]:focus, input[type=number]:focus { border-color: var(--sauge); outline: 3px solid var(--sauge-clair); }
.fact-table { table-layout: fixed; }
.fact-table th:nth-child(1) { width: 30%; }
.fact-table th:nth-child(2), .fact-table th:nth-child(3) { width: 19%; }
.fact-table th:nth-child(4) { width: 15%; }
.fact-table th:nth-child(5) { width: 11%; text-align: center; }
.fact-table th:nth-child(6) { width: 3.2rem; }
.fact-table input, .fact-table input[type=number] { width: 100%; min-height: 2.6rem; padding: .4rem .6rem; }

/* ---------- Liste des patientes à grande échelle ---------- */
.chips-bloc { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); padding: .7rem 1rem; margin: .8rem 0 .6rem; display: flex; flex-direction: column; gap: .5rem; }
.chips-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; }
.chips-titre { flex: 0 0 5.2rem; font-size: .85rem; font-style: italic; color: var(--sauge); }
.chip-f { display: inline-flex; align-items: center; gap: .4rem; font-size: .92rem; text-decoration: none; color: var(--sauge-fonce); background: transparent; border: 1.5px solid #d8c9b5; border-radius: 999px; padding: .3rem .9rem; line-height: 1.3; transition: background .15s, border-color .15s; }
.chip-f:hover { background: var(--rose-clair); border-color: var(--rose); }
.chip-f-actif, .chip-f-actif:hover { background: var(--sauge-fonce); border-color: var(--sauge-fonce); color: var(--creme); }
.chip-n { font-size: .78rem; background: rgba(85, 101, 74, .13); border-radius: 999px; padding: 0 .45rem; }
.chip-f-actif .chip-n { background: rgba(255, 255, 255, .25); }
@media (max-width: 40rem) { .chips-titre { flex-basis: 100%; } }

.pat-resume { margin: .4rem 0 .8rem; }
.lettres-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .8rem; }
.lettres { display: flex; flex-wrap: wrap; gap: .25rem; }
.lettres a, .lettre-vide { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; border-radius: 8px; font-size: .92rem; text-decoration: none; }
.lettres a { background: var(--blanc); border: 1.5px solid var(--sauge); color: var(--sauge-fonce); font-weight: bold; }
.lettres a:hover { background: var(--sauge-clair); }
.lettre-vide { color: #c9bda9; }
.pat-plier { display: flex; gap: .4rem; }

.grp { background: var(--blanc); border: 1px solid var(--trait); border-radius: var(--rayon); margin-bottom: .6rem; scroll-margin-top: 5.5rem; }
.grp-sum { cursor: pointer; display: flex; align-items: baseline; gap: .8rem; padding: .6rem 1.1rem; list-style: none; }
.grp-sum::-webkit-details-marker { display: none; }
.grp-sum::before { content: "▸"; color: var(--rose-texte); transition: transform .15s; }
.grp[open] > .grp-sum::before { transform: rotate(90deg); }
.grp[open] > .grp-sum { border-bottom: 1px solid var(--trait); }
.grp-lettre { font-size: 1.5rem; font-style: italic; color: var(--sauge); min-width: 1.6rem; }
.grp-nb { font-size: .9rem; color: #7a7566; }
.grp-corps { padding: 0 1.1rem; }
.grp-corps > .pat:first-child { border-top: 0; }

/* ---------- Encodage d'un mois : une carte par prestation sur téléphone ---------- */
.fact-table tr[hidden] { display: none !important; }
.fl-x-txt { display: none; }
@media (max-width: 48rem) {
  .fact-table, .fact-table tbody { display: block; min-width: 0; width: 100%; }
  .fact-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fact-table tr.fl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem .6rem; padding: .85rem .9rem; margin-bottom: .8rem; border: 1.5px solid var(--trait); border-radius: 14px; background: #fffdf9; }
  .fact-table tr.fl td { display: block; padding: 0; border: 0; min-width: 0; }
  .fact-table td[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; font-style: italic; color: var(--sauge); margin-bottom: .15rem; }
  .fact-table td[data-label="Date"] { grid-column: 1 / -1; }
  .fact-table td[data-label="Pause (min)"] { grid-column: auto; }
  .fact-table tr.fl input { min-height: 3rem; font-size: 1.05rem; width: 100%; }
  .fact-table td.fl-total { grid-column: 1 / 3; display: flex; align-items: baseline; gap: .6rem; font-size: 1.3rem; text-align: left; }
  .fact-table td.fl-total::before { margin: 0; }
  .fact-table td.fl-x { grid-column: 3; justify-self: end; align-self: end; }
  .fl-x .mini { min-height: 2.6rem; padding: .3rem .8rem; }
  .fl-x-txt { display: inline; }
  /* Le total reste visible en bas de l'écran pendant la saisie */
  .totaux { position: sticky; bottom: .6rem; z-index: 5; grid-template-columns: 1fr 1fr; box-shadow: 0 6px 22px rgba(85, 101, 74, .28); padding: .8rem 1rem; }
  .totaux > div:nth-child(2), .totaux > div:nth-child(3) { display: none; }
  .totaux strong { font-size: 1.2rem; }
  .totaux-total strong { font-size: 1.55rem; }
}

/* ---------- Envoi de documents ---------- */
.carte-envoi { background: var(--sauge-clair); border: 2px solid var(--sauge); margin-bottom: 1.1rem; }
.carte-envoi h2 { color: var(--sauge-fonce); font-size: 1.5rem; }
.carte-envoi p { margin-bottom: 0; }
.carte-envoi:hover { background: #dbe4d0; }
.etape h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.etape-num { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--sauge-fonce); color: var(--creme); font-size: 1rem; font-style: normal; }
.compteur { margin-left: auto; font-size: .9rem; font-style: italic; color: var(--sauge); }
.docs-groupe { margin: 1rem 0 .4rem; font-size: .9rem; font-style: italic; color: var(--sauge); }
.docs-groupe:first-of-type { margin-top: .2rem; }
.chips-doc { display: flex; flex-wrap: wrap; gap: .55rem; margin: .3rem 0 .6rem; }
.chip-doc { position: relative; margin: 0; cursor: pointer; }
.chip-doc input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip-doc-in { display: inline-flex; align-items: center; gap: .5rem; border: 2px solid #d8c9b5; border-radius: 999px; padding: .55rem 1.1rem; background: #fff; font-size: 1rem; line-height: 1.3; min-height: 2.9rem; transition: background .15s, border-color .15s; user-select: none; }
.chip-doc:hover .chip-doc-in { border-color: var(--rose); background: var(--rose-clair); }
.chip-doc input:checked + .chip-doc-in { background: var(--sauge-fonce); border-color: var(--sauge-fonce); color: var(--creme); }
.chip-doc input:checked + .chip-doc-in::before { content: "✓"; font-weight: bold; }
.chip-doc input:checked + .chip-doc-in .type-pastille { background: transparent; border-color: rgba(255, 255, 255, .55); color: var(--creme); }
.chip-doc input:focus-visible + .chip-doc-in { outline: 3px solid var(--rose); outline-offset: 2px; }
.chip-doc .type-pastille { margin-right: 0; }
.date-libre { max-width: 14rem; }
.fin-prevue { margin: .4rem 0 0; font-style: italic; color: var(--sauge-fonce); min-height: 1.6rem; }
.btn-grand { font-size: 1.15rem; padding: .9rem 2.4rem; }
.docs-envoyes { margin: .2rem 0 0; padding-left: 1.2rem; }
.lien-qr { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.qr { min-width: 176px; min-height: 176px; padding: 8px; background: #fff; border: 1px solid var(--trait); border-radius: 10px; }
.qr:empty { display: none; }
.lien-qr > div:last-child { flex: 1 1 16rem; }
.pied-discret { color: #a79d8b; font-size: .85rem; }
.doc-ligne { padding: 1.1rem .6rem; border-radius: 10px; }
.doc-ligne .dl-nom { font-size: 1.15rem; }
