/* Styles communs du site : couleurs, polices, menu */
:root {
  --bg: #f8f5ef; --surface: #ffffff; --ink: #142c1e; --muted: #4f5f55; --line: #e5dccb;
  --accent: #142c1e; --accent-soft: #f2e9d9; --peach: #d4b483;
  --display: "Cormorant Garamond", Garamond, Georgia, "Times New Roman", serif;
  --body: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Allura", "Snell Roundhand", cursive;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #0f2117; --surface: #142c1e; --ink: #f3eee4; --muted: #b5c0b8; --line: #2b4535;
  --accent: #d4b483; --accent-soft: #23402f; --peach: #d4b483; color-scheme: dark } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.65; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.site-nav { background: var(--surface); border-bottom: 3px solid var(--peach); position: sticky; top: 0; z-index: 10; }
.site-nav .inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { text-decoration: none; color: var(--ink); line-height: 1.2; margin-right: auto; }
.brand strong { font-family: var(--script); font-weight: 400; font-size: 30px; line-height: 1; display: block; }
.brand span { font-size: 13px; color: var(--muted); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.site-nav ul a { display: block; padding: 8px 12px; border-radius: 99px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.site-nav ul a:hover { background: var(--accent-soft); }
.site-nav ul a[aria-current="page"] { background: var(--accent); color: var(--surface); }
.site-nav ul a.cta { border: 1px solid var(--accent); color: var(--accent); }
.menu-toggle { display: none; font: inherit; font-weight: 700; background: none; border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; color: var(--ink); cursor: pointer; }
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .site-nav .inner { flex-wrap: wrap; }
  .site-nav ul { display: none; width: 100%; flex-direction: column; padding-bottom: 8px; }
  .site-nav.open ul { display: flex; }
}

.page { max-width: 1180px; margin: 0 auto; padding-block: 32px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin: 0 0 6px; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(34px, 5vw, 54px); line-height: 1.05; margin: 0 0 12px; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.2; margin: 0 0 6px; text-wrap: balance; }
.lede { font-size: 18px; color: var(--muted); max-width: 60ch; margin: 0; }
.btn { display: inline-block; font: inherit; font-weight: 700; text-decoration: none; border-radius: 99px; padding: 12px 22px; border: 1px solid var(--accent); background: var(--accent); color: var(--surface); }
.btn.ghost { background: transparent; color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 36px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.tile:hover { border-color: var(--peach); }
.tile p { margin: 0; color: var(--muted); font-size: 15px; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.tag.soon { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; max-width: 720px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
footer.site-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer.site-foot .inner { max-width: 1180px; margin: 0 auto; padding-block: 18px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Formulaires */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.form label { font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.form input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; }
.form-row label { flex: 1 1 180px; }
button.btn { cursor: pointer; }
button.btn[disabled] { opacity: .5; cursor: default; }
.msg { border-radius: 10px; padding: 12px 14px; margin: 0; }
.msg.ok { background: var(--accent-soft); }
.msg.erreur { background: color-mix(in srgb, var(--peach) 25%, transparent); }
.lien-copie { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; user-select: all; }
.link-btn { all: unset; cursor: pointer; display: block; padding: 8px 12px; border-radius: 99px; font-weight: 600; font-size: 15px; color: var(--muted); }
.link-btn:hover { background: var(--accent-soft); }

/* Tableau admin */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.num { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
.small { font-size: 14px; color: var(--muted); }

/* Vidéos */
.v-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.progress { min-width: 0; flex: 0 1 260px; }
.progress-label { font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin-top: 6px; }
.bar span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: minmax(0, 1fr); } .layout aside { order: 2; } }
aside.modules { display: flex; flex-direction: column; gap: 14px; }
.module { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.module > button { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.mod-num { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-family: var(--display); font-weight: 600; }
.mod-text { min-width: 0; flex: 1; }
.mod-title { font-weight: 700; display: block; }
.mod-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chev { flex: none; color: var(--muted); transition: transform .2s; }
.module.open .chev { transform: rotate(90deg); }
.lessons { list-style: none; margin: 0; padding: 0 8px 10px; display: none; }
.module.open .lessons { display: block; }
.lesson { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; font-size: 15px; }
.lesson:hover, .lesson.current { background: var(--accent-soft); }
.lesson.current { font-weight: 700; }
.tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; color: var(--surface); }
.lesson.done .tick { background: var(--accent); border-color: var(--accent); }
.lesson .dur { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.player { aspect-ratio: 16 / 9; max-width: 100%; width: 100%; border-radius: 16px; overflow: hidden; background: var(--ink); position: relative; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--bg); }
.placeholder p { margin: 8px 0 0; opacity: .8; font-size: 15px; max-width: 40ch; }
.play { width: 64px; height: 64px; border-radius: 50%; background: var(--peach); display: grid; place-items: center; margin: 0 auto; color: var(--ink); }
.crumb { font-size: 14px; color: var(--muted); margin: 20px 0 4px; }
.desc { max-width: 65ch; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Carnet alimentaire */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.carnet-tete { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.carnet-tete h1 { margin: 0; }
.bilan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px 24px; }
.bilan h2 { margin: 0 0 6px; }
.bilan h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 10px; }
.bilan-chiffres { display: flex; flex-direction: column; gap: 6px; }
.bilan-ligne { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.bilan-ligne strong { font-size: 17px; }
.rpj { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.rpj select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; }
.tendance-ligne { display: grid; grid-template-columns: 64px minmax(0, 1fr) 52px; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 8px; }
.tendance-ligne .bar { margin: 0; }
.tendance-date { color: var(--muted); }
.tendance-coeurs { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 699px) { .bilan { grid-template-columns: minmax(0, 1fr); padding: 16px; } }

.semaine-nav { display: flex; align-items: center; gap: 12px; }
.semaine-nav .btn { padding: 6px 16px; font-size: 20px; line-height: 1; }
.semaine-nav .btn[disabled] { opacity: .35; cursor: default; }
.semaine-titre { display: flex; flex-direction: column; font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.2; }
.semaine-titre::first-letter { text-transform: uppercase; }
.semaine-titre .small { font-family: var(--body); font-weight: 400; }

.grille { display: grid; grid-template-columns: 84px repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.grille > * { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 0; }
.col-tete { padding: 10px 8px; text-align: center; font-weight: 700; font-size: 14px; text-transform: capitalize; }
.col-tete.auj { background: var(--accent-soft); }
.col-long, .case-moment { display: none; }
.ligne-tete { padding: 10px; font-size: 13px; font-weight: 700; color: var(--muted); border-left: 0; }
.coin { border-left: 0; }
.case { padding: 6px; }
.case-repas { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.vignette { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.vignette:hover, .vignette:focus-visible { border-color: var(--peach); }
.vignette:focus-visible { outline: 2px solid var(--accent); }
.vignette img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.vignette-texte { padding: 6px 8px 0; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.vignette-pied { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 24px; }
.vignette-reaction { font-size: 16px; line-height: 1; }
.vignette.a-etudier { border-color: var(--peach); border-width: 2px; }
.vignette-droite { display: flex; align-items: center; gap: 4px; }
.pastille-nouveau { width: 10px; height: 10px; border-radius: 50%; background: var(--peach); box-shadow: 0 0 0 2px color-mix(in srgb, var(--peach) 35%, transparent); }
.case-ajout { all: unset; box-sizing: border-box; cursor: pointer; flex: 1; min-height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); font-size: 22px; opacity: .45; }
.case-ajout:hover, .case-ajout:focus-visible { opacity: 1; background: var(--accent-soft); }

@media (max-width: 899px) {
  .grille { display: flex; flex-direction: column; background: none; border: 0; border-radius: 0; gap: 0; }
  .grille > * { border: 0; }
  .coin, .ligne-tete, .col-court { display: none; }
  .col-long { display: inline; }
  .col-tete { text-align: left; font-family: var(--display); font-size: 20px; padding: 18px 0 6px; background: none !important; }
  .case { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
  .case-moment { display: block; font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 4px; }
  .case-repas { flex-direction: row; flex-wrap: wrap; }
  .vignette { width: 132px; }
  .case-ajout { flex: 0 0 auto; width: 132px; min-height: 44px; border: 1px dashed var(--line); opacity: .7; }
  .grille.patiente .col-tete { display: none; }
  .grille.patiente [data-j]:not(.actif) { display: none; }
  .grille.patiente .case:first-of-type { border-top: 0; }
  .grille:not(.patiente) .case.vide { display: none; }
}

.fenetre { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.fenetre::backdrop { background: rgba(20, 44, 30, .55); }
.fenetre-tete { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.fenetre-tete h2 { margin: 0; font-size: 21px; }
.fenetre-tete h2::first-letter { text-transform: uppercase; }
.fermer { all: unset; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.fermer:hover { background: var(--accent-soft); }
#fiche-corps { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.fiche-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.fiche-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.fiche-photos a:only-child img { aspect-ratio: 4 / 3; }
.fiche-texte { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.ressenti { color: var(--muted); font-style: italic; }
.champ-titre { font-weight: 700; font-size: 14px; display: block; }
.pastilles { display: flex; gap: 6px; flex-wrap: wrap; }
.pastille { font-size: 13px; padding: 2px 10px; border-radius: 99px; background: var(--accent-soft); }
.avis { border-left: 3px solid var(--peach); padding: 4px 0 4px 14px; }
.avis-tete { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.avis-reaction { font-size: 22px; line-height: 1; }
.avis-tete small { white-space: nowrap; font-weight: 400; color: var(--muted); font-size: 13px; }
.avis-signature { margin: 0; font-size: 13px; color: var(--muted); }
.avis-signature b { color: var(--ink); }
/* Petite pastille V / C sur la réaction : qui l'a mise. */
.reaction-signee { position: relative; display: inline-block; line-height: 1; }
.reaction-signee .initiale { position: absolute; right: -5px; bottom: -4px; min-width: 12px; height: 12px; padding: 0 2px; box-sizing: border-box; border-radius: 99px; background: #142c1e; color: #d4b483; border: 1px solid #fff; font: 700 8px/10px var(--body); text-align: center; letter-spacing: 0; }
.avis-reaction .initiale, .reactions .initiale { min-width: 14px; height: 14px; font-size: 9px; line-height: 12px; right: -6px; bottom: -5px; }
@media (prefers-color-scheme: dark) { .reaction-signee .initiale { background: #d4b483; color: #142c1e; border-color: #142c1e; } }
.avis-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.avis-form textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.reactions { display: flex; gap: 8px; }
.reactions button { font-size: 22px; width: 52px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.reactions button[aria-pressed="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
.link-btn.danger { padding-left: 0; color: #a3361f; display: inline-block; }
@media (prefers-color-scheme: dark) { .link-btn.danger { color: #f2a06b; } }
.vide { color: var(--muted); margin: 0; }

.repas-form { max-width: none; padding: 16px 18px 20px; gap: 14px; }
.form select, .form textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.photos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-btn { cursor: pointer; text-align: center; }
.photo-btn:not(.petit) { width: 100%; padding: 16px; }
.photo-btn.petit { width: 84px; height: 84px; padding: 0; display: grid; place-items: center; border-radius: 12px; border-style: dashed; font-size: 14px; }
.photo-miniature { position: relative; }
.photo-miniature img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; display: block; }
.retirer { all: unset; cursor: pointer; position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 12px; display: grid; place-items: center; }
.choix { display: flex; flex-wrap: wrap; gap: 6px; }
.choix button { font: inherit; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.choix button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cote { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 559px) { .cote { grid-template-columns: minmax(0, 1fr); } }
.echelle { border: 0; padding: 0; margin: 0; min-width: 0; }
.echelle legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 6px; }
.echelle-choix { display: flex; gap: 6px; }
.echelle-choix button { font: inherit; font-weight: 700; font-size: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.echelle-choix button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.echelle-bornes { display: flex; justify-content: space-between; max-width: 204px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.repas-form .form-row label { flex: 1 1 120px; }
@media (max-width: 559px) { .choix button { font-size: 13px; padding: 6px 11px; } }
.repas-form > .link-btn { padding-left: 0; align-self: flex-start; }

/* Liste des patientes : carnets à étudier */
.etudier { font-size: 14px; color: var(--muted); }
.etudier.a-faire { font-weight: 700; color: var(--accent); }

/* Accès limité dans le temps */
.prolonger { font: inherit; font-size: 13px; margin-top: 4px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 6px; }
.termine { color: #a3361f; }
@media (prefers-color-scheme: dark) { .termine { color: #f2a06b; } }

/* Accueil : prochain rendez-vous, objectifs, frise */
.accueil-haut { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.accueil-haut .panel { max-width: none; }
.carte-rdv h2 { margin-bottom: 4px; }
.rdv-quand { margin: 0 0 8px; font-weight: 600; }
.rdv-quand::first-letter { text-transform: uppercase; }
.rdv-form { max-width: none; margin-top: 12px; }
.rdv-form .form-row label { flex: 1 1 130px; }
.obj-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; }
.obj-cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; font-family: var(--body); }
.obj-cols p { margin: 0 0 4px; }
.accompagnement { max-width: none; margin-top: 16px; }
.acc-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.frise { list-style: none; margin: 12px 0 0; padding: 4px 0 10px; display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
.fr-it { flex: 0 0 104px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; position: relative; padding: 0 4px; }
.fr-it::before { content: ""; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.fr-it:first-child::before { display: none; }
.fr-it.fait::before, .fr-it.prochain::before { background: var(--accent); }
.fr-pt { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface); border: 2px solid var(--line); color: var(--muted); margin-bottom: 6px; }
.fr-it.fait .fr-pt { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.fr-it.prochain .fr-pt { border-color: var(--peach); background: var(--accent-soft); color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--peach) 30%, transparent); }
.fr-it b { font-size: 14px; }
.fr-it small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.fr-action { font-size: 12px; padding: 2px 10px; margin-top: 4px; display: inline-block; }
.fr-it:not(.fait) .fr-action { color: var(--accent); border: 1px solid var(--line); }

/* Programme (patiente) */
.prog-objectif { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; max-width: 420px; }
.prog-objectif strong { font-size: 17px; }
.prog-titre { margin-top: 8px; }
.prog-repas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.repas-p { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.repas-p header { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.repas-p h3 { font-family: var(--display); font-size: 22px; margin: 0; }
.repas-p ul { margin: 0; padding: 0; list-style: none; }
.repas-p li { padding: 5px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.repas-p li:last-child { border-bottom: 0; }
.prog-note { white-space: pre-wrap; color: var(--muted); max-width: 70ch; margin: 0; }
.prog-obj { border-top: 1px solid var(--peach); padding-top: 16px; margin-top: 8px; }

/* Dossier (équipe) */
.panel.large { max-width: none; }
.form-ligne { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 10px 0; }
.form-ligne label { flex: 0 1 220px; }
.form select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.prog-form { max-width: none; margin-top: 12px; }
.prog-form h3 { margin: 10px 0 0; font-family: var(--display); font-size: 21px; }
.p-repas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.p-un-repas { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.p-un-repas .form-row label { flex: 1 1 110px; }
.p-un-repas .link-btn, #p-ajouter { padding-left: 0; align-self: flex-start; }
.cote3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form textarea { resize: vertical; }
.form input, .form textarea, .form select { font-weight: 400; }

/* Messagerie (patiente et équipe) */
.nb { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #b8325a; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.btn.petit { padding: 6px 14px; font-size: 13px; }
.etiq { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.e-rouge { background: #fbe8ee; color: #9b2448; } .e-ambre { background: #f8efd9; color: #735c23; } .e-vert { background: #e3f0e7; color: #2f6b47; } .e-neutre { background: var(--accent-soft); color: var(--ink); }
.e-mention { background: #735c23; color: #fff; }
@media (prefers-color-scheme: dark) {
  .e-rouge { background: #3a2230; color: #f08aa8; } .e-ambre { background: #3a3320; color: #e8c873; } .e-vert { background: #1f3a2a; color: #8fd1a6; }
  .e-mention { background: #d4b483; color: #142c1e; }
}
.mention { font-weight: 700; color: #735c23; }
@media (prefers-color-scheme: dark) { .mention { color: #d4b483; } }

.messagerie-p { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.messagerie-p h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 4px; }
.messagerie-p .fil-tete p { margin: 0; }
.bulles { display: flex; flex-direction: column; gap: 6px; }
.jour-sep { align-self: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.vide-fil { text-align: center; max-width: 46ch; align-self: center; margin: 24px 0; }
.plus-anciens { align-self: center; }
.msg-l { display: flex; align-items: center; gap: 4px; max-width: 100%; }
.msg-l.d { flex-direction: row-reverse; }
.msg-l.plein .bulle { max-width: 100%; flex: 1; }
.bulle { max-width: min(78%, 560px); padding: 8px 13px; border-radius: 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; min-width: 0; }
.bulle.autre { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bulle.moi { background: var(--accent); color: var(--surface); border-bottom-right-radius: 4px; }
.bulle.commun { background: var(--accent-soft); border: 1px solid var(--peach); }
.bulle time { display: block; font-size: 11px; opacity: .7; margin-top: 2px; text-align: right; }
.bulle .qui { display: block; font-size: 12px; font-weight: 700; color: #735c23; }
.bulle.moi .qui { color: var(--peach); }
@media (prefers-color-scheme: dark) { .bulle .qui { color: var(--peach); } .bulle.moi .qui { color: #735c23; } }
.b-txt { white-space: pre-wrap; display: block; }
.b-mentions { display: block; font-size: 13px; }
.bulle.moi .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.commun-tag { display: inline-block; font-size: 11px; font-weight: 700; background: var(--surface); border: 1px solid var(--peach); border-radius: 99px; padding: 1px 8px; margin-bottom: 4px; }
.b-img { display: block; max-width: 100%; width: 260px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; margin: 4px 0; }
.b-cite { all: unset; box-sizing: border-box; cursor: pointer; display: block; border-left: 3px solid var(--peach); background: color-mix(in srgb, var(--accent-soft) 70%, transparent); border-radius: 8px; padding: 4px 8px; margin: 2px 0 6px; font-size: 13px; max-width: 100%; }
.bulle.moi .b-cite { background: rgba(255, 255, 255, .14); }
.b-cite b { display: block; font-size: 12px; }
.b-cite span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; opacity: .85; }
.b-rep { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; opacity: .6; }
.b-rep:hover, .b-rep:focus-visible { opacity: 1; background: var(--accent-soft); color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .b-rep { opacity: 0; } .msg-l:hover .b-rep, .b-rep:focus-visible { opacity: 1; } }
.msg-l.flash .bulle { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--peach); } 100% { box-shadow: 0 0 0 0 transparent; } }

.compose { display: flex; flex-direction: column; gap: 8px; }
.messagerie-p .compose { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.notifier { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.notifier button, .rapides button { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 99px; padding: 4px 12px; cursor: pointer; }
.notifier button[aria-pressed="true"] { background: #735c23; border-color: #735c23; color: #fff; }
.rapides { display: flex; gap: 6px; flex-wrap: wrap; }
.rapides button { border-style: dashed; font-weight: 500; }
.citation, .apercu-photo { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 6px 6px 10px; font-size: 13px; min-width: 0; }
.citation > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.citation span:not(.cit-barre) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.cit-barre { align-self: stretch; width: 3px; border-radius: 3px; background: var(--peach); flex: none; }
.apercu-photo img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.apercu-photo span { flex: 1; }
.cit-x { all: unset; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); flex: none; }
.cit-x:hover { background: var(--accent-soft); }
.ecrire { display: flex; gap: 8px; align-items: flex-end; }
.ecrire textarea { flex: 1; min-width: 0; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 46px; max-height: 180px; resize: none; }
.joindre { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.joindre:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.envoyer { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: #735c23; color: #fff; cursor: pointer; display: grid; place-items: center; }
.envoyer[disabled] { opacity: .5; cursor: default; }
.ico { width: 20px; height: 20px; }

/* Boîte de l'équipe */
.groupe { display: flex; flex-direction: column; gap: 10px; border-color: var(--peach); }
.groupe h2 { margin: 0; }
.groupe p { margin: 0; }
.groupe-form { max-width: none; }
.groupe-form textarea { width: 100%; }
.groupe-form .actions { align-items: center; margin: 0; }
.groupe h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 4px; }
.histo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.histo b { color: var(--ink); }
.messagerie-e { display: grid; grid-template-columns: 300px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; height: min(720px, calc(100dvh - 140px)); min-height: 480px; }
.boite { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.boite-tete { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 6px; flex-wrap: wrap; }
.filtre { font: inherit; border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.filtre[aria-pressed="true"] { background: var(--accent); color: var(--surface); border-color: var(--accent); }
#convs { overflow-y: auto; flex: 1; min-height: 0; }
.boite-vide { padding: 12px; margin: 0; }
.conv { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-bottom: 1px solid var(--line); width: 100%; }
.conv:hover, .conv[aria-current="true"] { background: var(--accent-soft); }
.conv:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: var(--accent-soft); border: 1px solid var(--peach); }
.conv-corps { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.conv .l1 { display: flex; justify-content: space-between; gap: 6px; }
.conv .l1 small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.conv.non-lu .l1 b, .conv.non-lu .conv-extrait { font-weight: 700; color: var(--ink); }
.conv-extrait { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-etiqs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.nouvelle { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-top: 1px solid var(--line); }
.nouvelle select { font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; }
.fil { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.messagerie-e .fil-tete { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.fil-nom { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fil-nom b { font-size: 16px; }
.fil-liens { display: flex; gap: 6px; flex-wrap: wrap; }
.retour-boite { display: none; }
.messagerie-e .bulles { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px; }
.messagerie-e .compose { border-top: 1px solid var(--line); padding: 10px 12px; }
@media (max-width: 799px) {
  .messagerie-e { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 120px); }
  .messagerie-e .fil { display: none; }
  .messagerie-e.ouvert .boite { display: none; }
  .messagerie-e.ouvert .fil { display: flex; }
  .retour-boite { all: unset; display: grid; place-items: center; cursor: pointer; width: 36px; height: 36px; text-align: center; font-size: 24px; border-radius: 50%; }
  .messagerie-e .fil-tete { padding: 8px 10px; }
  .bulle { max-width: 86%; }
  .intro-messagerie { display: none; }
  .fil-liens { flex-basis: 100%; }
  .messagerie-e { scroll-margin-top: 76px; height: calc(100dvh - 92px); }
  .rapides { flex-wrap: nowrap; overflow-x: auto; }
  .rapides button { white-space: nowrap; }
}

/* Programme : PDF joint (patiente) et outils de dépôt (équipe) */
.prog-pdf { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; max-width: 520px; }
.prog-pdf:hover, .prog-pdf:focus-visible { border-color: var(--peach); }
.prog-pdf > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.prog-pdf .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog-pdf-ic { flex: none; width: 42px; height: 50px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.prog-pdf > span:last-child { font-size: 22px; color: var(--muted); }
.prog-outils { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.prog-outil { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.prog-outil h3 { margin: 0; font-size: 16px; }
.prog-outil .small { margin: 0; overflow-wrap: anywhere; }
.prog-outil-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.btn.fichier { position: relative; cursor: pointer; }
.btn.fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.btn.fichier:focus-within { outline: 2px solid var(--peach); outline-offset: 2px; }

/* Première connexion guidée */
.bienvenue { max-width: 640px; }
.bienvenue .panel h2 { margin: 0; }
.bv-etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bv-etapes li { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); border-top: 3px solid var(--line); padding-top: 8px; }
.bv-etapes li span { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.bv-etapes li.actif, .bv-etapes li.fait { color: var(--ink); border-top-color: var(--peach); }
.bv-etapes li.actif span { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.bv-etapes li.fait span { background: var(--accent-soft); border-color: var(--peach); }
.form .bv-case, .bv-case { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; font-weight: 500; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; }
.bv-case input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.bv-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bv-visite { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 0; }
.bv-visite li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.bv-visite li:last-child { border-bottom: 0; }
.bv-visite span { color: var(--muted); font-size: 14px; }
.bv-sortie { display: inline; padding: 0; font-size: 13px; text-decoration: underline; }
@media (max-width: 559px) { .bv-etapes li { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12px; } }

/* Fiche de la patiente (dossier équipe) */
.fiche { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 20px; margin: 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.fiche div { min-width: 0; }
.fiche dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.fiche dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.fiche a { color: inherit; }

/* Documents légaux et Mes données */
footer.site-foot .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.foot-liens { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-liens a { color: inherit; }
.legal { max-width: 760px; }
.legal .panel h2 { margin: 0; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal-sommaire ol { margin: 0; padding-left: 20px; columns: 2 220px; column-gap: 24px; }
.legal-sommaire li { padding: 2px 0; break-inside: avoid; }
.legal-table { overflow-x: auto; }
.legal-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; white-space: normal; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.legal-table th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.legal-table td:first-child { width: 42%; font-weight: 600; }
.legal-table tr:last-child td { border-bottom: 0; }
.bienvenue .form.bv-accord { max-width: none; }
.legal-liens a, .md-historique, .md-actions { color: inherit; }
mark.a-completer { background: #fbe3a8; color: #142c1e; padding: 0 4px; border-radius: 4px; }
.bv-promesses { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.bv-facultatif { border-style: dashed; }
.bv-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-right: 4px; }
.mes-donnees { max-width: 680px; }
.mes-donnees .panel h2 { margin: 0; }
.md-actions { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.md-historique { list-style: none; margin: 0; padding: 0; }
.md-historique li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.md-historique li span:last-child { color: var(--muted); }
@media (max-width: 559px) {
  .legal-table td:first-child { width: auto; }
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .legal-table td { display: block; border: 0; padding: 2px 0; }
}

/* Version de test (MODE_TEST=oui) */
.bandeau-test { margin: 0; padding: 8px 16px; text-align: center; font-size: 14px; font-weight: 600; background: #d4b483; color: #142c1e; }

/* Agenda de la semaine (patiente et équipe) : une liste, pas une grille jour par jour. */
.agenda .ag-panel { max-width: 860px; padding: 20px 24px; }
.ag-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ag-sem { text-align: center; }
.ag-sem h2 { margin: 0; }
.ag-fleche { padding: 6px 16px; font-size: 20px; line-height: 1.2; }
.ag-liste { list-style: none; margin: 0; padding: 0; }
.ag-it { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 6px 18px; align-items: start; padding: 16px 0 16px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.ag-it:last-child { border-bottom: 0; }
.ag-coaching { border-left-color: var(--accent); }
.ag-cercle { border-left-color: var(--peach); }
.ag-perso { border-left-color: #735c23; }
.ag-fait { opacity: .6; }
.ag-quand { display: flex; flex-direction: column; font-variant-numeric: tabular-nums; }
.ag-quand b::first-letter { text-transform: uppercase; }
.ag-quand b, .ag-quand span { white-space: nowrap; }
.ag-quand span { font-size: 14px; color: var(--muted); }
.ag-quoi h3 { font-family: var(--display); font-size: 21px; line-height: 1.2; margin: 2px 0; }
.ag-quoi p { margin: 0; }
.ag-tag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #735c23; }
.ag-lien { word-break: break-all; }
.ag-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.btn.petit { padding: 7px 16px; font-size: 14px; }
.ag-vide { margin: 0; padding: 28px 0 12px; text-align: center; color: var(--muted); }
.ag-form { max-width: 860px; }
@media (prefers-color-scheme: dark) { .ag-tag { color: var(--peach); } .ag-perso { border-left-color: #b89a5e; } }
@media (max-width: 599px) {
  .agenda .ag-panel { padding: 16px; }
  .ag-sem h2 { font-size: 21px; }
  .ag-it { grid-template-columns: minmax(0, 1fr); padding-left: 12px; }
  .ag-quand { flex-direction: row; gap: 8px; align-items: baseline; }
  .ag-actions { justify-content: flex-start; }
}
