:root {
  --texte: #1d1d1f; --doux: #5f6368; --fond: #f6f6f4; --carte: #fff; --bord: #d9d9d6;
  --accent: #1f4e79; --erreur: #a4262c; --ok: #1e6b3a; --vide: #ececea;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--texte); background: var(--fond); }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
a { color: var(--accent); }
.barre { display: flex; align-items: center; background: #23272e; color: #fff; }
.barre a { color: #fff; text-decoration: none; }
.barre .marque { font-weight: 700; padding: 14px 0; white-space: nowrap; }
.lien { background: none; border: 0; color: #cfd6df; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.etroite { max-width: 420px; margin: 24px auto; }
label { display: block; margin: 0 0 12px; font-weight: 600; }
input, select { display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; border: 1px solid var(--bord); border-radius: 6px; min-height: 44px; }
button, .bouton { display: inline-block; min-height: 44px; padding: 10px 16px; font: inherit; font-weight: 600; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; }
.secondaire { background: #fff; color: var(--accent); }
.aide { color: var(--doux); font-weight: 400; font-size: .9rem; }
.grand { font-size: 1.2rem; }
.message { padding: 10px 14px; border-radius: 6px; background: #eef3f8; }
.message.erreur { background: #fbeaea; color: var(--erreur); }
.message.ok { background: #e8f4ec; color: var(--ok); }
.gardes { list-style: none; padding: 0; margin: 0 0 12px; }
.gardes li { padding: 8px 0; border-bottom: 1px solid var(--bord); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.gardes .dates { font-weight: 600; min-width: 18em; }
.gardes .nature { color: var(--doux); }
.entete-planning { display: flex; align-items: center; gap: 12px; }
.entete-planning h1 { margin: 0; flex: 1; text-align: center; }
.outils { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 12px 0; }
.en-ligne { display: flex; gap: 8px; align-items: end; margin: 0; }
.en-ligne label { margin: 0; }
.grille { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.grille th { background: #23272e; color: #fff; padding: 6px; font-size: .85rem; border-radius: 4px; }
.grille td { vertical-align: top; height: 92px; padding: 6px; border-radius: 6px; color: #111; }
.grille td.hors { background: transparent; }
.grille td.vide { background: var(--vide); color: var(--doux); }
.num { font-size: .8rem; color: #333; }
.ferie { font-size: .72rem; font-weight: 600; }
.nom-secondaire { text-align: center; font-size: .85rem; overflow-wrap: anywhere; }
.nom-principal { text-align: center; font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.mien { outline: 3px solid #111; outline-offset: -3px; }
.aujourdhui .num { font-weight: 700; text-decoration: underline; }
.badge { display: inline-block; margin-top: 4px; font-size: .7rem; padding: 1px 6px; border-radius: 8px; background: #fff; border: 1px dashed #555; }
.liste-mois { display: none; list-style: none; padding: 0; margin: 0; }
.liste-mois li { display: flex; gap: 10px; align-items: baseline; padding: 10px; margin-bottom: 3px; border-radius: 6px; color: #111; }
.liste-mois li.vide { background: var(--vide); }
.liste-mois .date { width: 4.2em; font-weight: 600; }
.liste-mois .qui { font-weight: 700; flex: 1; }
.liste-mois li.we { box-shadow: inset 6px 0 0 rgba(0, 0, 0, .35); }
.legende { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 16px 0 4px; }
.legende li { padding: 4px 10px; border-radius: 6px; color: #111; font-size: .9rem; }
.actions { margin: 8px 0; }
@media (max-width: 700px) {
  .grille { display: none; }
  .liste-mois { display: block; }
  .gardes .dates { min-width: 0; }
}

/* Saisie, équipe, décompte, coordination */
.alerte { background: #fbeaea; border: 2px solid var(--erreur); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.alerte h2 { color: var(--erreur); }
.c-v { background: #f4b183; }
.c-i { background: #c9c9c9; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.12) 6px 8px); }
.c-plus { background: #b7e1b2; }
.c-moins { background: #f3e7a8; }
.c-vide { background: #fff; }
fieldset { border: 0; padding: 0; margin: 0 0 10px; }
legend { font-weight: 600; margin-bottom: 6px; }
.outils-codes { display: flex; flex-wrap: wrap; gap: 6px; }
.pastille { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 8px 12px; border: 1px solid var(--bord); border-radius: 20px; font-weight: 600; cursor: pointer; min-height: 44px; }
.pastille input { width: auto; min-height: 0; margin: 0; display: inline; }
.pastille:has(input:checked) { outline: 3px solid #111; }
.confirmation { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; color: var(--erreur); }
.confirmation input { width: auto; min-height: 0; margin-top: 4px; display: inline; }
.grille.saisie td { height: auto; padding: 0; background-color: #fff; }
.grille.saisie td.we { background-color: #e9e9e6; }
.grille.saisie td.c-v { background: #f4b183; }
.grille.saisie td.c-i { background-color: #c9c9c9; }
.grille.saisie td.c-plus { background: #b7e1b2; }
.grille.saisie td.c-moins { background: #f3e7a8; }
.jour { width: 100%; min-height: 56px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: #111; display: flex; flex-direction: column; align-items: center; font-weight: 400; }
.jour:disabled { opacity: .35; cursor: default; }
.jour .code { font-weight: 800; font-size: 1.1rem; min-height: 1.2em; }
.jour .garde { font-size: .65rem; font-weight: 700; background: #111; color: #fff; border-radius: 6px; padding: 0 5px; }
.jour .ferie { font-size: .6rem; }
.deux-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.defile { overflow-x: auto; }
table.equipe { border-collapse: collapse; font-size: .85rem; }
table.equipe th, table.equipe td { border: 1px solid var(--bord); padding: 3px 4px; text-align: center; min-width: 26px; }
table.equipe th[scope=row] { text-align: left; position: sticky; left: 0; background: var(--carte); }
table.equipe .we { background-color: #f0f0ee; }
table.equipe td.c-v { background: #f4b183; font-weight: 700; }
table.equipe td.c-i { font-weight: 700; background-color: #c9c9c9; }
table.equipe tr.moi th { text-decoration: underline; }
table.equipe tr.total td { font-weight: 700; }
.peu { background: #f8d0d0 !important; color: var(--erreur); font-weight: 800; }
table.decompte { border-collapse: collapse; min-width: 420px; }
table.decompte th, table.decompte td { padding: 6px 10px; border-bottom: 1px solid var(--bord); text-align: right; }
table.decompte th[scope=row], table.decompte thead th:first-child { text-align: left; }
table.decompte tr.synthese { background: #f2f2f2; font-weight: 700; }
h3 { font-size: 1rem; margin: 14px 0 6px; }
@media (max-width: 700px) {
  .grille.saisie { display: table; }
  .jour { min-height: 48px; }

}

/* Administration */
table.admin { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.admin th, table.admin td { padding: 8px 6px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: middle; }
table.admin tr.inactif { color: var(--doux); }
table.admin select { min-height: 36px; padding: 4px; margin: 0; width: auto; display: inline-block; }
table.admin input.champ-email { min-height: 36px; padding: 4px 6px; margin: 0; width: 15em; }
.petit { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
.actions-ligne { display: flex; flex-wrap: wrap; gap: 6px; }
.actions-ligne form { margin: 0; }
.grille-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 10px; }
.grille-form label { margin: 0; }
.grille-form input[type=color] { padding: 2px; height: 44px; }
.case { display: flex; gap: 8px; align-items: center; }
.case input { width: auto; min-height: 0; margin: 0; }
.ligne-medecin { padding-bottom: 10px; border-bottom: 1px solid var(--bord); }
.pastille-medecin { display: inline-block; padding: 10px 12px; border-radius: 6px; font-weight: 700; color: #111; align-self: center; }
.bloc-periode { border-top: 1px solid var(--bord); padding-top: 8px; margin-top: 8px; }
.feries { list-style: none; padding: 0; margin: 8px 0; }
.feries li { padding: 4px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lien-danger { background: none; border: 0; color: var(--erreur); text-decoration: underline; cursor: pointer; padding: 0; min-height: 0; font: inherit; font-size: .85rem; }
.mdp { font: 700 1.5rem/1.3 ui-monospace, monospace; letter-spacing: .05em; background: #f2f2f2; padding: 12px; border-radius: 6px; text-align: center; user-select: all; }
.qr img { display: block; margin: 8px auto; background: #fff; padding: 8px; border: 1px solid var(--bord); }
code.cle { word-break: break-all; }
.numeros { font-size: 1.1rem; font-weight: 600; margin-top: -6px; }
textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--bord); border-radius: 8px; }
.demande { border-bottom: 1px solid var(--bord); padding-bottom: 12px; margin-bottom: 12px; }
.demande:last-child { border-bottom: 0; margin-bottom: 0; }
.citation { font-style: italic; color: var(--doux); }
/* Saisie : barre d'outils toujours visible, sélection en cours */
.barre-saisie { position: sticky; top: 0; z-index: 5; background: var(--carte); padding: 8px 0 4px; margin: 0 0 8px; border-bottom: 1px solid var(--bord); }
.barre-saisie .message { margin: 6px 0 0; }
.barre-saisie .confirmation { margin: 6px 0 0; }
.outils-js { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 6px; }
.outils-js[hidden] { display: none; }
.outils-js .case { margin: 0; font-weight: 400; }
.grille.saisie .jour { user-select: none; -webkit-user-select: none; }
.grille.saisie td.selection { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (max-width: 700px) {
  .barre-saisie .pastille { padding: 4px 9px; min-height: 38px; font-size: .85rem; }
  .barre-saisie legend { font-size: .85rem; }
}

/* Navigation : onglets (en haut sur ordinateur, en bas sur téléphone) + menu groupé */
.barre { flex-wrap: nowrap; padding: 0 16px; gap: 16px; min-height: 56px; }
.pastille-nombre { display: inline-block; min-width: 1.4em; margin-left: 4px; padding: 0 5px; border-radius: 10px; background: var(--erreur); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.4; vertical-align: middle; }
.onglets { display: flex; gap: 4px; align-self: stretch; flex: 1; }
.onglets a { display: flex; align-items: center; gap: 6px; padding: 0 14px; color: #cfd6df; text-decoration: none; font-weight: 600; border-bottom: 4px solid transparent; border-top: 4px solid transparent; white-space: nowrap; }
.onglets a:hover { color: #fff; background: #2f343c; }
.onglets a.actif { color: #fff; border-bottom-color: #7fb3e6; background: #353b45; }
.onglets .icone { font-size: 1.1rem; }
.onglets .telephone { display: none; }
.menu-deroulant { position: relative; margin-left: auto; }
.menu-deroulant summary { list-style: none; cursor: pointer; padding: 8px 14px; border: 1px solid #59606b; border-radius: 8px; color: #fff; font-weight: 600; white-space: nowrap; }
.menu-deroulant summary::-webkit-details-marker { display: none; }
.menu-deroulant summary.actif, .menu-deroulant[open] summary { background: #353b45; border-color: #7fb3e6; }
.menu-panneau { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 340px; max-height: 80vh; overflow: auto; background: var(--carte); color: var(--texte); border: 1px solid var(--bord); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 8px; }
.menu-groupes { display: flex; flex-direction: column; gap: 6px; }
.menu-groupe { display: flex; flex-direction: column; padding: 4px 0; border-top: 1px solid var(--bord); }
.menu-groupe:first-child { border-top: 0; }
.menu-groupe h2 { margin: 6px 10px 2px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.menu-groupe a, .lien-menu { display: block; padding: 10px 12px; border-radius: 8px; color: var(--texte); text-decoration: none; font-weight: 500; text-align: left; }
.menu-groupe.essentiel a { font-weight: 700; font-size: 1.05rem; }
.menu-groupe a:hover, .lien-menu:hover { background: #eef3f8; }
.menu-groupe a[aria-current] { background: #e3edf7; color: var(--accent); font-weight: 700; box-shadow: inset 4px 0 0 var(--accent); }
.menu-groupe form { margin: 0; }
.lien-menu { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; min-height: 0; color: var(--erreur); }
.menu-page { max-width: 520px; margin: 0 auto; }
.menu-page .menu-groupe a, .menu-page .lien-menu { padding: 16px 14px; font-size: 1.1rem; border: 1px solid var(--bord); background: var(--carte); margin-bottom: 8px; }
.menu-page .menu-groupe { border: 0; }
.sous-nav { display: flex; flex-wrap: wrap; gap: 4px; max-width: 1100px; margin: 0 auto; padding: 10px 16px 0; }
.sous-nav a { padding: 8px 14px; border-radius: 20px; border: 1px solid var(--bord); background: var(--carte); text-decoration: none; font-weight: 600; font-size: .92rem; }
.sous-nav a[aria-current] { background: var(--accent); color: #fff; border-color: var(--accent); }
/* Messages de confirmation : flottants en bas d'écran (avec JavaScript), jamais hors de vue */
.js .toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 35; width: min(92vw, 560px); display: flex; flex-direction: column; gap: 8px; }
.js .toasts .message { margin: 0; box-shadow: 0 4px 16px rgba(0,0,0,.2); padding-right: 44px; position: relative; }
.fermer-toast { position: absolute; top: 4px; right: 4px; min-height: 0; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: inherit; font-size: 1.4rem; line-height: 1; }
@media (max-width: 700px) {
  .barre { justify-content: center; }
  .barre .marque { margin: 0; }
  .menu-deroulant, .onglets .ordinateur { display: none; }
  .onglets .telephone { display: flex; }
  .onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #23272e; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); gap: 2px; }
  .onglets a { flex: 1 1 0; min-width: 0; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 2px; font-size: .74rem; font-weight: 600; border: 0; border-radius: 8px; min-height: 58px; position: relative; }
  .onglets a.actif { background: #fff; color: #23272e; }
  .onglets .icone { font-size: 1.45rem; line-height: 1; }
  .onglets .pastille-nombre { position: absolute; top: 2px; right: 8px; margin: 0; }
  body { padding-bottom: 80px; }
  .js .toasts { bottom: 86px; }
  .sous-nav { padding: 10px 16px 0; }
  .sous-nav a { font-size: .85rem; padding: 8px 12px; }
}

/* Accueil guidé */
.aujourdhui-carte { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; }
.aujourdhui-carte > div { display: flex; flex-direction: column; gap: 2px; }
.etiquette { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 700; }
.aujourdhui-carte .numeros { margin: 0; font-size: 1rem; }
.a-faire { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.a-faire h2 { margin: 0; }
.a-faire .alerte { margin: 0; }
.tout-va { margin: 0; padding: 12px 16px; border-radius: 10px; background: #e8f4ec; color: var(--ok); font-weight: 600; }
.gros-bouton { display: block; padding: 16px 18px; border-radius: 12px; text-decoration: none; color: #fff; background: var(--accent); }
.gros-bouton strong { display: block; font-size: 1.15rem; }
.gros-bouton span { display: block; font-size: .9rem; opacity: .9; }
.gros-bouton.urgent { background: var(--erreur); }
.gros-bouton.fait { background: #e8f4ec; color: var(--ok); border: 1px solid #b9dcc4; }
.gros-bouton.coord { background: #2d3a4a; }
.info-ligne { display: block; padding: 12px 16px; border-radius: 10px; background: var(--carte); border: 1px solid var(--bord); color: var(--texte); text-decoration: none; }
.info-ligne.acceptee { border-color: #b9dcc4; background: #f1f9f3; }
.info-ligne.refusee, .info-ligne.caduque { border-color: #e7c1c3; background: #fdf3f3; }
.mes-gardes { list-style: none; padding: 0; margin: 0; }
.mes-gardes li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.mes-gardes li.mois { padding: 14px 0 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 700; }
.mes-gardes .dates { display: block; font-weight: 700; font-size: 1.05rem; }
.mes-gardes .nature { display: block; color: var(--doux); }
.mes-gardes .bouton { white-space: nowrap; }
.badge-etat { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 10px; background: #fff4d6; border: 1px solid #e8c768; font-size: .8rem; font-weight: 600; }
.suite-gardes summary { cursor: pointer; padding: 12px 0; color: var(--accent); font-weight: 600; }

/* Saisie : touches de code (une seule ligne, aussi sur téléphone) */
.outils-codes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.outils-codes legend { grid-column: 1 / -1; font-weight: 600; margin-bottom: 4px; }
.touche { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 6px 2px; border: 1px solid var(--bord); border-radius: 10px; cursor: pointer; min-height: 56px; font-weight: 600; color: #111; }
.touche input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.touche .lettre { font-size: 1.3rem; font-weight: 800; line-height: 1.1; }
.touche .libelle { font-size: .8rem; }
.touche:has(input:checked) { outline: 3px solid #111; outline-offset: 1px; }
.touche:has(input:focus-visible) { outline: 3px solid var(--accent); }
.mode-emploi { margin: 0 0 12px; }
.mode-emploi summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.mode-emploi ul { margin: 8px 0 0; padding-left: 20px; }

/* Saisie : menu de choix par jour (feuille en bas d'écran) */
form.avec-js .sans-js { display: none; }
.consigne { font-weight: 600; }
.feuille { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--carte); border-top: 1px solid var(--bord); box-shadow: 0 -6px 24px rgba(0,0,0,.18); border-radius: 14px 14px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.feuille[hidden] { display: none; }
.feuille-titre { margin: 0 0 10px; font-weight: 700; font-size: 1.1rem; text-align: center; }
.feuille-choix { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.feuille-choix .touche { min-height: 72px; border-width: 2px; font: inherit; font-weight: 600; color: #111; }
.feuille-choix .touche.courant { outline: 3px solid #111; outline-offset: 1px; }
.feuille-fermer { width: 100%; margin-top: 10px; }
/* Messages de la saisie : flottants, ne décalent jamais le calendrier sous le doigt */
form.avec-js #retour-saisie { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 25; width: min(92vw, 520px); margin: 0; box-shadow: 0 4px 16px rgba(0,0,0,.2); text-align: center; }
@media (max-width: 700px) { form.avec-js #retour-saisie { bottom: 84px; } }

/* Cycle du coordinateur */
.etape h2 { margin-bottom: 8px; }
.reglages { margin: 10px 0; }
.reglages summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.proposition { border-top: 2px solid var(--bord); margin-top: 16px; padding-top: 8px; }
table.apercu-planning { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 2px; font-size: .85rem; }
table.apercu-planning td { padding: 4px; border-radius: 4px; vertical-align: top; height: 44px; color: #111; }
table.apercu-planning td.vide { background: var(--vide); }
table.apercu-planning td.nouveau { box-shadow: inset 0 0 0 2px #111; }
table.apercu-planning .num { display: block; font-size: .75rem; }
table.apercu-planning .qui { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .grille.apercu-planning { display: table; } table.apercu-planning { font-size: .7rem; } }
button:disabled, button[disabled] { opacity: .45; cursor: not-allowed; }

/* Journal */
.filtres-journal { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; align-items: end; }
.filtres-journal label { margin: 0; }
.filtres-journal .actions-filtres { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; grid-column: 1 / -1; }
table.journal td.quand { white-space: nowrap; }
.pages { display: flex; gap: 20px; }

/* Parcours d'échange : étapes, choix en grosses lignes, bilan « vous serez / ne serez plus de garde » */
.etapes-parcours { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: e; }
.etapes-parcours li { flex: 1; display: flex; align-items: center; gap: 6px; padding: 8px; border-radius: 8px; background: var(--vide); color: var(--doux); font-size: .85rem; font-weight: 600; }
.etapes-parcours li span { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: #fff; flex: none; }
.etapes-parcours li.fait { background: #e8f4ec; color: var(--ok); }
.etapes-parcours li.actuelle { background: var(--accent); color: #fff; }
.etapes-parcours li.actuelle span { color: var(--accent); }
.consigne { font-size: 1.1rem; font-weight: 700; margin: 6px 0 10px; }
.rappel-garde { margin: 0 0 8px; }
.rappel-garde .changer { margin-left: 8px; font-size: .9rem; }
.choix-lignes { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.choix-lignes a, .choix-lignes button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 12px 16px; border: 1px solid var(--bord); border-radius: 10px; background: var(--carte); color: var(--texte); text-decoration: none; text-align: left; font: inherit; font-weight: 400; cursor: pointer; }
.choix-lignes a:hover, .choix-lignes button:hover { border-color: var(--accent); background: #f4f8fc; }
.choix-lignes strong { display: block; font-size: 1.05rem; }
.choix-lignes .aide { display: block; }
.choix-lignes .fleche { font-size: 1.8rem; color: var(--accent); line-height: 1; }
.choix-lignes .choix-tous { border: 2px solid var(--accent); }
.grande-case { padding: 12px 0; font-weight: 600; }
.grande-case input { width: 24px; height: 24px; }
.bilan { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.bilan-col { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; }
.bilan-col.moins { background: #fdf3f3; border: 1px solid #e7c1c3; }
.bilan-col.plus { background: #f1f9f3; border: 1px solid #b9dcc4; }
.bilan-col strong { font-size: 1.05rem; }
button.large, .bouton.large { width: 100%; min-height: 56px; font-size: 1.1rem; }
.envoi label { margin-top: 8px; }
.carte-urgente { border: 2px solid var(--erreur); }
.demande-titre { font-size: 1.1rem; margin: 0 0 4px; }
.demande-dates { margin: 0 0 6px; }
details.historique > summary { cursor: pointer; list-style: none; }
details.historique > summary h2 { display: inline; }
details.historique > summary::before { content: "▸ "; color: var(--accent); }
details.historique[open] > summary::before { content: "▾ "; }

/* Saisie des dispos : état en tête, légende permanente, cases qui ressemblent à des boutons,
   fériés visibles, barre « J'ai fini » toujours en bas d'écran */
.sous-titre { display: block; font-size: 1.05rem; font-weight: 600; color: var(--doux); }
.etat-saisie { padding: 12px 16px; border-radius: 10px; margin-bottom: 12px; }
.etat-saisie.a-faire { background: #fff4d6; border: 1px solid #e8c768; }
.etat-saisie.fait { background: #e8f4ec; border: 1px solid #b9dcc4; color: var(--ok); }
.etapes-saisie { margin: 6px 0 0; padding-left: 22px; }
.etapes-saisie li { margin: 2px 0; }
.souris { display: none; }
@media (hover: hover) and (pointer: fine) { .souris { display: inline; } .tactile { display: none; } }
.outils-js { gap: 8px; }
.outils-js button { min-height: 44px; }
#mode-plage[aria-pressed="true"] { background: var(--accent); color: #fff; }
.legende-codes { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 4px 0 10px; font-size: .85rem; }
.legende-codes li { padding: 3px 8px; border-radius: 6px; border: 1px solid var(--bord); font-weight: 600; }
.legende-codes .l-garde { border: 0; padding: 3px 0; font-weight: 400; }
.legende-codes .garde, .jour .garde { font-size: .65rem; font-weight: 700; background: #111; color: #fff; border-radius: 6px; padding: 0 5px; }
.grille.saisie td { background-color: transparent; }
.grille.saisie .jour { border: 1px solid #c8ccd2; background: #fff; border-radius: 6px; min-height: 56px; }
.grille.saisie td.we .jour { background: #eef1f6; }
.grille.saisie td.c-v .jour { background: #f4b183; }
.grille.saisie td.c-i .jour { background-color: #c9c9c9; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.12) 6px 8px); }
.grille.saisie td.c-plus .jour { background: #b7e1b2; }
.grille.saisie td.c-moins .jour { background: #f3e7a8; }
.grille.saisie td.est-ferie .jour { border: 2px solid #8a5cb8; }
.grille.saisie .jour .ferie { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .6rem; color: #5b3a80; }
.grille.saisie .jour:disabled { opacity: .35; }
.grille.saisie .jour:not(:disabled):hover { border-color: var(--accent); }
.autres-outils > summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.autres-outils[open] > summary { margin-bottom: 12px; }
.barre-fini { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px -16px 0; padding: 10px 16px; background: var(--carte); border-top: 1px solid var(--bord); box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
.barre-fini button { flex: none; }
body:has(.barre-fini) .js .toasts, .js body:has(.barre-fini) .toasts { bottom: 90px; }
body:has(.barre-fini) form.avec-js #retour-saisie { bottom: 90px; }
@media (max-width: 700px) {
  .barre-fini { bottom: 66px; margin: 16px -16px 0; }
  .barre-fini .aide { display: none; }
  .barre-fini button { width: 100%; min-height: 52px; }
  .js body:has(.barre-fini) .toasts, body:has(.barre-fini) form.avec-js #retour-saisie { bottom: 150px; }
  .grille.saisie .jour .ferie { font-size: .5rem; }
}
.grille.saisie td.we, .grille.saisie td.c-v, .grille.saisie td.c-i, .grille.saisie td.c-plus, .grille.saisie td.c-moins { background: transparent; background-image: none; }
.outils-js { flex-wrap: nowrap; margin-top: 0; }
.outils-js button { flex: 1 1 auto; padding: 8px 10px; }

/* Calcul et publication : résumé des étapes, pastilles fait / à faire */
.resume-etapes { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; position: sticky; top: 0; z-index: 6; background: var(--fond); padding: 6px 0; }
.resume-etapes li { flex: 1; }
.resume-etapes a { display: block; padding: 8px 10px; border-radius: 8px; background: var(--vide); color: var(--doux); font-weight: 600; text-decoration: none; text-align: center; font-size: .9rem; }
.resume-etapes li.fait a { background: #e8f4ec; color: var(--ok); }
.resume-etapes li.fait a::before { content: "✓ "; }
.resume-etapes li.actuelle a { background: var(--accent); color: #fff; }
.pastille-etape { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px; font-size: .78rem; font-weight: 700; vertical-align: middle; }
.pastille-etape.fait { background: #e8f4ec; color: var(--ok); }
.pastille-etape.actuelle { background: var(--accent); color: #fff; }
.pastille-etape.a-faire { background: var(--vide); color: var(--doux); }
@media (max-width: 700px) { .resume-etapes a { font-size: .75rem; padding: 8px 4px; } }

/* Finitions : tableaux en cartes au téléphone, planning, coordination */
@media (max-width: 700px) {
  table.cartes-mobile, table.cartes-mobile tbody, table.cartes-mobile tr, table.cartes-mobile td, table.cartes-mobile th { display: block; width: 100%; }
  table.cartes-mobile thead { display: none; }
  table.cartes-mobile tr { border: 1px solid var(--bord); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: var(--carte); }
  table.cartes-mobile td, table.cartes-mobile th { border: 0; padding: 4px 0; }
  table.cartes-mobile [data-label]::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); font-weight: 700; }
  table.cartes-mobile th[data-label="Identifiant"]::before { display: none; }
  table.cartes-mobile th[scope=row] { font-size: 1.1rem; }
  .defile:has(table.cartes-mobile) { overflow: visible; }
  .mois-voisin { display: none; }
}
.liens-planning { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.outils-affichage > summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.liste-mois li.aujourdhui { outline: 3px solid var(--accent); outline-offset: -3px; }
.grille td.aujourdhui { box-shadow: inset 0 0 0 3px var(--accent); }
.mois-voisin { font-size: .9rem; }
details.carte > summary.resume-periode { cursor: pointer; font-weight: 700; color: var(--accent); }
details.carte[open] > summary.resume-periode { margin-bottom: 10px; }
details.carte:not([open]) { padding: 12px 16px; }
#aujourdhui { scroll-margin-top: 80px; }

/* Corrections après la seconde revue */
.liste-mois li.aujourdhui { outline: 0; }
.grille td.aujourdhui { box-shadow: none; }
.grille td.aujourdhui .num, .liste-mois li.aujourdhui .date { font-weight: 800; }
.menu-deroulant summary.actif { background: #fff; color: #23272e; border-color: #fff; }
.grille.saisie .jour .ferie { white-space: normal; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: clip; }
table.decompte tr.moi th, table.decompte tr.moi td { background: #e3edf7; font-weight: 700; }
table.equipe tr.moi th { text-decoration: none; background: #e3edf7; }
@media (max-width: 700px) {
  .entete-planning { position: sticky; top: 0; z-index: 6; background: var(--fond); padding: 6px 0; }
  .mois-voisin { display: inline; font-size: .75rem; }
  .entete-planning .bouton { padding: 8px 8px; }
  .entete-planning h1 { font-size: 1.25rem; }
}
.fiche-medecin { border-bottom: 1px solid var(--bord); padding: 8px 0; }
.fiche-medecin > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fiche-medecin[open] > summary { margin-bottom: 8px; }
.fiche-medecin .ligne-medecin { border: 0; }
/* Tableau qui défile : ombre à droite tant qu'il reste des colonnes cachées */
@media (max-width: 700px) {
.carte .defile { background: linear-gradient(to right, var(--carte) 30%, transparent) left / 24px 100% no-repeat local,
          linear-gradient(to left, var(--carte) 30%, transparent) right / 24px 100% no-repeat local,
          linear-gradient(to right, rgba(0,0,0,.18), transparent) left / 10px 100% no-repeat scroll,
          linear-gradient(to left, rgba(0,0,0,.18), transparent) right / 10px 100% no-repeat scroll; }
}
.bloc-periode .en-ligne { flex-wrap: wrap; align-items: center; }
.bloc-periode form.en-ligne { padding: 6px 10px; border: 1px solid var(--bord); border-radius: 8px; }
html, body { overflow-x: clip; }
.comparer { margin: 10px 0; flex-wrap: wrap; }
.comparaison { border: 1px dashed var(--accent); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
table.decompte td.change { background: #fff4d6; font-weight: 700; }
table.decompte td.change .avant { color: var(--doux); font-weight: 400; text-decoration: line-through; }

/* Cibles tactiles d'au moins 44 px (liens d'appoint, sections repliables, petits boutons) */
summary { padding: 10px 0; cursor: pointer; }
.menu-deroulant summary { padding: 8px 14px; }
.rappel-garde .changer, .liens-retour a, p > a:only-child { display: inline-block; padding: 10px 0; }
.etat-saisie + .aide a, .sous-titre a { display: inline-block; padding: 10px 2px; }
@media (max-width: 700px) {
  .petit { min-height: 44px; }
  table.admin select, table.admin input.champ-email { min-height: 44px; }
}

/* Changer de période : boutons en tête (défilent au téléphone), suite en bas, mois passés repliés */
.choix-periode { display: flex; gap: 8px; overflow-x: auto; margin: 4px 0 14px; padding-bottom: 4px; }
.choix-periode a { flex: none; padding: 10px 16px; border: 1px solid var(--bord); border-radius: 999px; background: var(--carte); color: var(--texte); text-decoration: none; font-weight: 600; white-space: nowrap; min-height: 44px; box-sizing: border-box; }
.choix-periode a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.suite-periode { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin: 20px 0 8px; }
.suite-periode .bouton:last-child { margin-left: auto; }
.mois-passes { margin: 8px 0 16px; }
.mois-passes > summary { cursor: pointer; color: var(--doux); padding: 10px 0; min-height: 44px; box-sizing: border-box; }

/* Planning : choix calendrier / liste (sans choix : calendrier à l'ordinateur, liste au téléphone) */
.choix-vue { display: inline-flex; border: 1px solid var(--accent); border-radius: 8px; overflow: hidden; }
.choix-vue a { padding: 8px 14px; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; color: var(--accent); text-decoration: none; font-weight: 600; }
.choix-vue a[aria-current] { background: var(--accent); color: #fff; }
.planning.vue-calendrier .grille { display: table; }
.planning.vue-calendrier .liste-mois { display: none; }
.planning.vue-liste .grille { display: none; }
.planning.vue-liste .liste-mois { display: block; }
.liste-mois .numeros { display: block; font-weight: 400; font-size: .85rem; }
.menu-pdf { position: relative; }
.menu-pdf > summary { list-style: none; }
.menu-pdf > summary::-webkit-details-marker { display: none; }
.menu-pdf > div { position: absolute; z-index: 15; margin-top: 4px; background: var(--carte); border: 1px solid var(--bord); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.15); display: flex; flex-direction: column; min-width: 240px; }
.menu-pdf > div a { padding: 12px 14px; min-height: 44px; box-sizing: border-box; }
.grille .court, .grille .initiales-court { display: none; }
@media (max-width: 700px) {   /* calendrier choisi au téléphone : initiales, jours abrégés */
  .planning.vue-calendrier .grille { border-spacing: 2px; }
  .planning.vue-calendrier .grille td { height: 58px; padding: 3px; }
  .planning.vue-calendrier .grille .long, .planning.vue-calendrier .grille .nom-principal,
  .planning.vue-calendrier .grille .nom-secondaire, .planning.vue-calendrier .grille .ferie { display: none; }
  .planning.vue-calendrier .grille .court { display: inline; }
  .planning.vue-calendrier .grille .initiales-court { display: block; text-align: center; font-weight: 700; font-size: 1rem; margin-top: 4px; }
  .planning.vue-calendrier .grille .badge-etat { display: none; }
}
