/* Style commun des espaces connectés (pro, et plus tard patient) */
:root {
  --navy: #0b2a5e;
  --navy-deep: #0a2350;
  --link: #1a47b8;
  --teal: #0e7676;
  --violet: #7045c4;
  --blue: #1d4fd8;
  --amber: #b45309;
  --amber-bg: #fef3e2;
  --red: #b42318;
  --red-bg: #fdecea;
  --green: #0f7a4f;
  --green-bg: #e7f6ee;
  --text: #182031;
  --muted: #4a5568;
  --soft: #6b7585;
  --line: #e3e8ef;
  --hover: #f2f5fa;
  --tint: #f5f8fd;
  /* Le fond (Jo, 2 oct., comme Google Agenda) : l'en-tête, le menu et la page sur un gris très pâle, le contenu sur des cartes blanches */
  --bg: #f3f5f8;
  --ic-bg: #eef2fb;
  /* Les surfaces (cartes, menus, fenêtres, champs) et les titres : des jetons, que le thème sombre redéfinit (css/sombre.css) */
  --card: #fff;
  --title: #0f1728;
}
/* Un thème par espace, repris des deux cartes de l'accueil : bleu pour les pros, vert-bleu pour les patients.
   Juste à la couleur, on sait où on est. Le portail admin garde le bleu marine. */
body.espace-pro { --navy: #0d3a9a; --navy-deep: #0a2d78; --link: #0d3a9a; --hover: #eef3fc; --tint: #f3f6fd; --ic-bg: #e6edfb; --bg: #f1f4f9; }
body.espace-patient { --navy: #0e7676; --navy-deep: #0a5757; --link: #0e7676; --hover: #eaf6f6; --tint: #f2f9f9; --ic-bg: #dff0f0; --bg: #eff5f5; }
/* L'en-tête du patient, un vert pâle un cran plus foncé que la page, pour le découper (Jo, 8 oct.) */
body.espace-patient .p-header { border-top: 4px solid var(--navy); background: #d5ebe7; box-shadow: inset 0 -1px 0 #b9dcd6; }
body.espace-patient.defile .p-header { box-shadow: inset 0 -1px 0 #b9dcd6, 0 6px 18px rgba(11, 42, 94, .14); }
/* Le portail admin a son thème à lui (Jo, 8 oct. : savoir d'un coup d'œil où on est) : violet, l'en-tête aubergine, le
   badge ADMIN ambre. Rien de bleu (le pro) ni de vert (le patient) */
body[data-role="admin"] { --navy: #6a45c9; --navy-deep: #2a1f4a; --link: #6a45c9; --hover: #f3effc; --tint: #f6f3fd; --ic-bg: #ece6fb; --bg: #f4f2f8; }
body[data-role="admin"] .p-header { background: #2a1f4a; }
body[data-role="admin"] .p-logo .agen { color: #fff; }
body[data-role="admin"] .p-logo .viva { color: #c9b8ff; }
body[data-role="admin"] .p-badge { background: #f6b23c; color: #2a1f4a; }
body[data-role="admin"] .p-header .p-home, body[data-role="admin"] .p-header .p-user { color: #ece8f8; }
body[data-role="admin"] .p-header .p-home .i { fill: #ece8f8; stroke: #ece8f8; }
body[data-role="admin"] .p-header .p-user { border-left-color: rgba(255, 255, 255, .18); }
/* « ÉTIENNE PAR ICI ! » (Jo, 16 oct.) : en tête du menu, à l'ambre du badge ADMIN, pour qu'on ne la rate pas */
/* Ce que seul le labo (Jo) voit dans le portail admin (Jo, 17 oct.) : ses boutons et ses onglets en vert, une couleur
   qui ne sert à rien d'autre ici. Les entrées du menu (.p-nav a.labo) et les onglets des pages (.tabs .labo). */
body[data-role="admin"] { --labo: #0f7a5a; --labo-bg: #e2f4ec; --labo-ligne: #9fd8c1; }
body[data-role="admin"] .p-nav a.labo { color: var(--labo); background: var(--labo-bg); box-shadow: inset 0 0 0 1.5px var(--labo-ligne); }
body[data-role="admin"] .p-nav a.labo:hover { background: #cdeee0; box-shadow: inset 0 0 0 1.5px var(--labo); }
body[data-role="admin"] .p-nav a.labo.active { background: var(--labo); color: #fff; box-shadow: none; }
.tabs button.labo, .tabs a.labo { color: var(--labo); background: var(--labo-bg); border-color: var(--labo-ligne); }
.tabs button.labo:hover, .tabs a.labo:hover { color: var(--labo); border-color: var(--labo); }
.tabs button.labo.on, .tabs a.labo.on { color: #fff; background: var(--labo); border-color: var(--labo); }
.cp-filtres button.labo { color: var(--labo); background: var(--labo-bg); }  /* Compare : le Canada */
.cp-filtres button.labo.on { color: #fff; background: var(--labo); }
body[data-role="admin"] .p-nav a.par-ici { background: #fdf1d8; color: #7a4a05; font-weight: 800; font-size: 14.5px; white-space: nowrap; box-shadow: inset 0 0 0 1.5px #f6b23c; }
body[data-role="admin"] .p-nav a.par-ici:hover { background: #fbe6bb; box-shadow: inset 0 0 0 1.5px #e09a1c; }
body[data-role="admin"] .p-nav a.par-ici.active { background: #f6b23c; color: #2a1f4a; box-shadow: none; }
/* … et qui clignote de façon extrêmement exagérée (Jo, 16 oct.) tant qu'Étienne n'a pas tout vu : le fond qui change
   de couleur, un halo qui pulse, une secousse toutes les 2 s, le drapeau qui s'agite. Sur la page elle-même, seulement
   le halo et le drapeau, pour qu'il puisse lire. */
@keyframes par-ici-fond { 0%, 100% { background: #f6b23c; } 25% { background: #ff4fa3; } 50% { background: #ffe14d; } 75% { background: #3be0b2; } }
@keyframes par-ici-halo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 79, 163, .75), 0 0 10px 2px rgba(246, 178, 60, .9); }
  50% { box-shadow: 0 0 0 9px rgba(255, 79, 163, 0), 0 0 26px 8px rgba(255, 79, 163, .85); }
}
@keyframes par-ici-secoue {
  0%, 62%, 100% { transform: rotate(0) scale(1); }
  66% { transform: rotate(-4deg) scale(1.08); } 70% { transform: rotate(4deg) scale(1.1); }
  74% { transform: rotate(-3deg) scale(1.08); } 78% { transform: rotate(3deg) scale(1.06); } 84% { transform: rotate(0) scale(1); }
}
@keyframes par-ici-drapeau { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
body[data-role="admin"] .p-nav a.par-ici.flash { position: relative; z-index: 2; color: #2a1f4a; text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  animation: par-ici-fond 1.2s linear infinite, par-ici-halo .8s ease-out infinite, par-ici-secoue 2s ease-in-out infinite; }
body[data-role="admin"] .p-nav a.par-ici.flash.active { animation: par-ici-halo .8s ease-out infinite; }
body[data-role="admin"] .p-nav a.par-ici.flash .i { transform-origin: 25% 90%; animation: par-ici-drapeau .35s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  body[data-role="admin"] .p-nav a.par-ici.flash, body[data-role="admin"] .p-nav a.par-ici.flash .i { animation: none; background: #ff4fa3; }
}
/* L'espace pro : l'en-tête marine, avec « PRO » (Étienne, visuel V3, 8 oct.) ; le reste garde le thème bleu */
body.espace-pro .p-header { background: #0b2a5e; }
body.espace-pro .p-logo .agen { color: #fff; }
body.espace-pro .p-logo .viva { color: #7fe0d9; }
body.espace-pro .p-logo::after { content: "PRO"; margin-left: 4px; padding: 3px 8px; border-radius: 6px; background: rgba(127, 224, 217, .16);
  color: #7fe0d9; font-size: 12px; letter-spacing: .8px; transform: translateY(2px); }  /* centré sur le nom : « agenviva » a surtout des minuscules */
body.espace-pro .p-header .p-home, body.espace-pro .p-header .p-bell, body.espace-pro .p-header .p-user,
body.espace-pro .p-header .av-lang { color: #e8eef9; }
body.espace-pro .p-header .p-home .i { fill: #e8eef9; stroke: #e8eef9; }
body.espace-pro .p-header button.p-user { border-left-color: rgba(255, 255, 255, .18); }
body.espace-pro .p-header .p-user .avatar { background: #fff; color: #0b2a5e; }
body.espace-pro .p-header .av-lang select { border-color: rgba(255, 255, 255, .3); }
body.espace-pro .p-header .p-bell .dot { border-color: #0b2a5e; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- En-tête ---------- */
.p-header {
  height: 60px; display: flex; align-items: center; gap: 24px;
  padding: 0 44px 0 24px; background: var(--bg);
}
/* Le logo B2 (visuel V3, 8 oct.) : l'icône et le nom en texte, sans « .com » ; « agen » marine, « viva » teal */
.p-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 21px; letter-spacing: -.6px; line-height: 1; }
.p-logo img { display: block; height: 28px; width: auto; }
.p-logo .agen { color: #0b2a5e; }
.p-logo .viva { color: #0e7676; }
/* L'en-tête figé sur tablette et ordinateur (Jo, visuel V3) : 60 px, toujours (Jo, 8 oct. : pas deux tailles), avec une
   ombre dès qu'on descend (body.defile, portal.js et patient/base.html) ; sur téléphone, il défile (la barre d'onglets du
   bas est déjà fixe).
   z-index 45 : sous les fenêtres (50) et le menu du clic droit (70), au-dessus des info-bulles (40).
   --entete : ce qui colle en haut d'une page (sommaire des Docs, filtres des fiches) colle sous lui */
@media (min-width: 701px) {
  :root { --entete: 60px; }
  html { scroll-padding-top: 60px; }  /* un lien vers #… ou un scrollIntoView ne finit pas caché sous l'en-tête */
  .p-header { position: sticky; top: 0; z-index: 45; transition: box-shadow .2s ease; }
  body.defile .p-header { box-shadow: 0 6px 18px rgba(11, 42, 94, .14); }
  body.cal-plein .p-header { position: static; }  /* l'agenda en plein écran le couvre */
}
@media (prefers-reduced-motion: reduce) { .p-header { transition: none; } }
.p-home { display: flex; align-items: center; gap: 10px; margin-left: 48px; color: var(--navy); font-weight: 600; font-size: 15px; letter-spacing: .3px; }
.p-home .i { width: 22px; height: 22px; fill: var(--navy); stroke: var(--navy); }
.p-right { margin-left: auto; display: flex; align-items: center; }
.p-bell { display: flex; align-items: center; gap: 10px; color: var(--text); padding-right: 28px; position: relative; }
.p-bell .i { width: 22px; height: 22px; }
.p-bell .dot { position: absolute; left: 14px; top: -2px; width: 8px; height: 8px; border-radius: 50%; background: #e0452c; border: 2px solid #fff; }
/* La cloche : la liste de ce que les patients ont fait */
.p-notifs { position: relative; }
button.p-bell { background: none; border: 0; font: inherit; cursor: pointer; }
.p-bell .dot[hidden] { display: none; }
/* Du nouveau : la cloche sonne toutes les 3 s et le point rouge pulse, jusqu'à ce que le pro ouvre la liste */
.p-bell.sonne .i { color: #e0452c; transform-origin: 50% 2px; animation: av-sonne 3s ease-in-out infinite; }
.p-bell.sonne .dot { animation: av-pulse 1.5s ease-out infinite; }
@keyframes av-sonne {
  0%, 60%, 100% { transform: rotate(0); }
  6% { transform: rotate(18deg); } 12% { transform: rotate(-16deg); } 18% { transform: rotate(13deg); }
  24% { transform: rotate(-10deg); } 30% { transform: rotate(6deg); } 36% { transform: rotate(-3deg); }
}
@keyframes av-pulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 69, 44, .65); }
  70% { box-shadow: 0 0 0 9px rgba(224, 69, 44, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 69, 44, 0); }
}
@media (prefers-reduced-motion: reduce) { .p-bell.sonne .i, .p-bell.sonne .dot { animation: none; } }
/* Ce qui attend une action de la personne (une demande à accepter, une heure à confirmer) bouge doucement, en orange,
   jusqu'à ce qu'elle agisse : le compte dans le menu, les demandes dans l'agenda (pro-citas.html), le badge « To confirm » */
@keyframes av-point { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes av-halo { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 138, 30, 0); } 50% { box-shadow: 0 0 0 4px rgba(224, 138, 30, .3); } }
.a-faire { display: inline-grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; margin-left: auto; border-radius: 999px;
  background: #e08a1e; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; animation: av-halo 1.8s ease-in-out infinite; }
.a-faire:empty { display: none; }
.card-h .a-faire { margin-left: 10px; }
.chip.pulse { animation: av-halo 1.8s ease-in-out infinite; }
/* Ce qui attend l'autre personne (le patient attend la réponse de son pro) : un point qui respire, « en cours » */
.chip.attente::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
  animation: av-point 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .a-faire, .chip.pulse, .chip.attente::before { animation: none; } }
.p-nlist {
  display: none; position: absolute; right: 12px; top: calc(100% + 18px); z-index: 50; width: 360px; max-width: calc(100vw - 24px);
  max-height: 440px; overflow-y: auto; padding: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 40, 90, .14);
}
.p-notifs.open .p-nlist { display: block; }
.p-nhead { display: flex; align-items: center; font-weight: 700; color: var(--navy); padding: 8px 10px 6px; }
.p-nclear { margin-left: auto; padding: 3px 8px; border: 0; border-radius: 6px; background: none; color: var(--blue); font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; }
.p-nclear:hover { background: var(--hover); }
.p-nlist a { display: block; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--text); line-height: 1.4; }
.p-nlist a:hover { background: var(--hover); }
.p-nlist a.new { background: var(--tint); font-weight: 600; }
.p-nlist a span { display: block; font-size: 12.5px; font-weight: 400; color: var(--soft); margin-top: 2px; }
.p-nitem { position: relative; }
.p-nitem a { padding-right: 36px; }
.p-nx {
  position: absolute; top: 6px; right: 4px; width: 28px; height: 28px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 6px; color: var(--soft); cursor: pointer;
}
.p-nx:hover { background: #e9ecf1; color: var(--text); }
.p-nx .i { width: 15px; height: 15px; }
/* Bas de la liste : le son, et les notifications de l'ordinateur */
.p-nfoot { display: flex; flex-wrap: wrap; gap: 4px 14px; border-top: 1px solid var(--line); margin-top: 6px; padding: 8px 6px 2px; }
.p-nopt { display: inline-flex; align-items: center; gap: 6px; padding: 4px; font: inherit; font-size: 13px; color: var(--soft); background: none; border: 0; border-radius: 6px; }
button.p-nopt { cursor: pointer; }
button.p-nopt:hover { background: var(--hover); color: var(--text); }
.p-nopt .i { width: 15px; height: 15px; }
.p-nlien { color: var(--blue); font-weight: 600; margin-left: 2px; }
/* Alertes bloquées : où les rouvrir, selon le navigateur */
.p-naide { margin: 6px 6px 4px; padding: 10px 12px; border-radius: 8px; background: var(--tint); font-size: 13px; line-height: 1.5; color: var(--text); }
.p-naide ol { margin: 6px 0 0; padding-left: 18px; }
.p-naide li + li { margin-top: 3px; }
.p-nvide { margin: 4px 10px 10px; color: var(--soft); font-size: 14px; line-height: 1.5; }
.p-user { display: flex; align-items: center; gap: 12px; padding-left: 28px; border-left: 1px solid var(--line); font-weight: 600; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #d5dbe4; color: #fff; font-weight: 700; font-size: 15px; flex: none;
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
/* La pastille d'un membre du cabinet (ticket #93) : ses initiales sur sa couleur, dans l'agenda, « Team », les fenêtres */
.mb { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--mb, #1d4fd8);
  color: #fff; font-size: 9.5px; font-weight: 700; font-style: normal; line-height: 1; letter-spacing: .02em; vertical-align: -4px; }
.mb.lg { width: 34px; height: 34px; font-size: 13px; vertical-align: middle; }
/* Dans une ligne de texte (« Coming up », Jo, 13 oct.) : à la taille du texte, centrée sur sa hauteur */
.mb.sm { width: 16px; height: 16px; font-size: 7px; vertical-align: middle; position: relative; top: -1px; }
/* Une photo (16 oct.) : celle du membre, ou du pro, par-dessus sa couleur ; les initiales restent pour les lecteurs d'écran */
/* !important : l'en-tête de l'espace pro redonne un « background » complet à son avatar, qui remettait la taille à auto */
.mb.ph, .avatar.ph { background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; color: transparent; }
.p-user .i { width: 16px; height: 16px; transition: transform .15s; }
/* Menu du compte : le même que celui de gauche, sous le nom */
.p-account { position: relative; }
button.p-user { background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; cursor: pointer; padding-top: 0; padding-bottom: 0; }
.p-account.open .p-user .i { transform: rotate(180deg); }
.p-menu {
  display: none; position: absolute; right: -12px; top: calc(100% + 18px); z-index: 50; min-width: 240px;
  flex-direction: column; gap: 2px; padding: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 40, 90, .14);
}
.p-account.open .p-menu { display: flex; }
.p-menu a { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 6px; font-size: 15px; font-weight: 500; color: var(--text); white-space: nowrap; }
.p-menu a:hover { background: var(--hover); }
.p-menu a.active { background: var(--navy); color: #fff; }
.p-menu a .i { width: 20px; height: 20px; }
.p-menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ---------- Mise en page ---------- */
.p-layout { display: grid; grid-template-columns: 286px minmax(0, 1fr); min-height: calc(100vh - 60px - 102px); }
.p-side { padding: 24px 24px 34px; display: flex; flex-direction: column; background: var(--bg); }
.p-nav { display: flex; flex-direction: column; gap: 7px; }
.p-nav a {
  display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 16px;
  border-radius: 6px; font-size: 16px; font-weight: 500; color: var(--text);
}
/* Les onglets se détachent à peine du fond gris : un blanc voilé (Jo, 2 oct. : « très subtil ») */
.p-nav a { background: rgba(255, 255, 255, .6); }
.p-nav a:hover { background: color-mix(in srgb, var(--navy) 7%, var(--card)); }
.p-nav a.active { background: var(--navy); color: #fff; }
/* Sur tablette et ordinateur, le même petit cadre que les lignes de RDV, pour bien découper les onglets (Jo, visuel V3) ;
   sur téléphone, le menu est la barre d'onglets du bas, qui ne change pas */
@media (min-width: 701px) {
  .p-nav a { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
  .p-nav a:not(.active):hover { background: var(--hover); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--navy) 22%, var(--card)); }  /* l'onglet actif garde sa couleur */
  .p-nav a.active { box-shadow: none; }
}
.p-nav a .i { width: 22px; height: 22px; }
.p-nav .sep { height: 1px; background: #dfe4ec; margin: 10px 4px; }
.p-help { margin-top: auto; border-radius: 14px; padding: 22px 24px; background: var(--card); }
/* Le dock de l'espace pro (Jo, 16 oct.) : Vivi, l'aide (le casque, vers la page Contact) et « Bug », côte à côte en bas à
   gauche, à la place de la carte « Need help? » du menu (js/portal.js, vivi.js, bug.js) */
.av-dock { position: fixed; left: 18px; bottom: 18px; z-index: 46; display: flex; align-items: center; gap: 10px; }
.av-dock > * { position: static !important; margin: 0 !important; flex: none; }
.av-dock-aide { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--card); color: var(--navy);
  border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(9, 20, 45, .18); transition: transform .15s; }
.av-dock-aide:hover, .av-dock-aide:focus-visible { transform: scale(1.06); }
.av-dock-aide .i { width: 26px; height: 26px; }
@media print { .av-dock { display: none; } }
.p-help.sous-menu { margin-top: 16px; }  /* portail admin : juste sous le menu */
.p-help h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; color: var(--navy); font-size: 17px; }
.p-help h4 .i { width: 24px; height: 24px; }
.p-help p { margin: 0 0 16px; color: var(--muted); line-height: 1.5; font-size: 14.5px; }
.content { padding: 26px 32px 34px; min-width: 0; }

.p-badge { background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1px; padding: 4px 8px; border-radius: 5px; margin-left: -8px; }
.p-nav a.sub { height: 40px; padding-left: 52px; font-size: 15px; gap: 12px; }
.p-nav a.sub .i { width: 18px; height: 18px; }
/* Le sous-menu de « My information » (Jo, 16 oct.) : ses cinq groupes, sous l'onglet, sans le cadre des onglets ;
   sur téléphone, l'accordéon de la page le remplace */
.p-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 27px; padding-left: 10px; border-left: 2px solid var(--line); }
.p-nav .p-sub a { height: 32px; padding: 0 12px; font-size: 15px; font-weight: 500; color: var(--muted); background: none; box-shadow: none; }
.p-nav .p-sub a:hover { color: var(--text); background: var(--hover); box-shadow: none; }
.p-nav .p-sub a.on { color: var(--navy); font-weight: 700; background: color-mix(in srgb, var(--navy) 9%, var(--card)); }
@media (max-width: 700px) { .p-sub { display: none; } }
/* Portail admin : une section pas encore construite */
.p-nav a.todo { color: #9aa3b2; }
.p-nav a.todo .i { opacity: .6; }
.p-nav a.todo:hover { background: #e9ecf1; }
.p-nav a.todo.active { background: #e9ecf1; color: #6b7585; }
.p-nav .soon { margin-left: auto; font-size: 11px; font-weight: 600; letter-spacing: .3px; color: #8a93a3; background: #eef0f4; border-radius: 10px; padding: 2px 8px; }
.p-help code { font-size: 12.5px; word-break: break-all; }

/* ---------- Pied de page ---------- */
.p-footer { background: var(--navy-deep); color: #fff; display: flex; align-items: center; gap: 32px; padding: 20px 60px 20px 28px; min-height: 102px; }
.p-footer .f-copy { font-size: 14px; line-height: 1.7; opacity: .92; }
.p-footer.slim { min-height: 0; padding: 14px 28px; justify-content: space-between; font-size: 13.5px; }
.p-footer.slim span { opacity: .85; }
.p-footer.mini { min-height: 44px; padding: 12px 16px; gap: 6px 22px; flex-wrap: wrap; justify-content: center; text-align: center; font-size: 12.5px; }
/* « Beta · Contact us · Report a bug », descendu du haut de l'espace pro (Jo, 7 oct.) */
.p-footer .f-aide a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.p-footer .f-aide .avb-lien { margin-left: 6px; }
/* Ce qui n'apparaît que sur téléphone : « Contact us » et « Report a problem » dans le pied de page du patient,
   quand la boîte « Need help? » du menu est cachée (Jo, 3 oct.) */
.seul-mobile { display: none; }
.p-footer .seul-mobile a { color: inherit; text-decoration: underline; }

/* ---------- Éléments communs ---------- */
h1.page { font-size: 24px; font-weight: 700; margin: 0; color: var(--title); position: relative; }
/* Le sous-titre d'une page devient une info-bulle : un « i » à côté du titre, le texte au survol ou au toucher
   (Jo, 1er oct. : un visuel plus épuré). Le texte s'ouvre sous le titre, à partir de sa gauche. */
h1.page:has(.info-bulle) { margin-bottom: 20px; }
.info-bulle { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 8px; vertical-align: 2px;
  border-radius: 50%; color: var(--soft); cursor: help; outline: none; }
.info-bulle:hover, .info-bulle:focus { color: var(--blue); }
.info-bulle .i { width: 18px; height: 18px; }
.info-texte { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: max-content; max-width: min(440px, 100%);
  padding: 9px 12px; border-radius: 8px; background: #0f1728; color: #fff; font-size: 13.5px; font-weight: 500; line-height: 1.45;
  opacity: 0; visibility: hidden; transition: opacity .15s; }
.info-bulle:hover .info-texte, .info-bulle:focus .info-texte { opacity: 1; visibility: visible; }
.sub { color: var(--muted); margin: 8px 0 20px; font-size: 15.5px; }
.card { background: var(--card); border-radius: 14px; padding: 20px; }
.card + .card { margin-top: 18px; }
.card-h { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 18px; font-weight: 700; color: var(--title); }
.card-h .ic { width: 38px; height: 38px; border-radius: 50%; background: var(--ic-bg); color: var(--navy); display: grid; place-items: center; flex: none; }
.card-h .ic .i { width: 20px; height: 20px; }
/* Le sablier « pas encore confirmé », en tête des cartes « Not confirmed yet » (pro) et « Waiting for your professional »
   (patient), visuel V3 : « Hour Glass Loading » de chitta shanmukha (LottieFiles, Lottie Simple License), figé et recoloré */
.card-h .ic.sablier::before { content: ""; width: 16px; height: 21px; background: url("../img/sablier.svg") center / contain no-repeat; }
/* Le même sablier dans l'agenda (pro-citas.html), devant le nom d'un RDV que le patient n'a pas encore confirmé, et dans la
   légende : plus net, avec son sable, immobile (ce qui attend l'autre personne ne bouge pas, règle du 1er oct.) */
.ev-wait .i { display: none; }
.ev-wait::before { content: ""; display: block; width: 14px; height: 18px; flex: none; background: url("../img/sablier.svg") center / contain no-repeat; }
/* La veille, sans réponse du patient (ticket #168) : seulement le sablier qui coule, l'animation de LottieFiles recolorée
   (chargée seulement s'il y a un tel RDV). Elle ne fait que couler : on retourne le sablier à la fin de chaque boucle,
   au même rythme (3,75 s) ; retourné, le sable plein se retrouve en haut, l'image où l'animation recommence */
.fc .appt.veille .ev-wait::before { background-image: url("../img/sablier-anime.svg"); animation: av-retourne 3.75s linear infinite; }
@keyframes av-retourne { 0%, 86% { transform: rotate(0); } 100% { transform: rotate(180deg); } }
@media (prefers-reduced-motion: reduce) { .fc .appt.veille .ev-wait::before { background-image: url("../img/sablier.svg"); animation: none; } }
.card-h .right { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--soft); }
.card-note { color: var(--soft); font-size: 13.5px; margin: -8px 0 12px; line-height: 1.45; }
.link { color: var(--link); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.more .i { width: 16px; height: 16px; }

/* Les boutons au style de la charte (Jo, visuel V3) : mêmes tailles qu'avant, seulement l'allure : coins plus ronds,
   texte plus gras, une ombre douce sous le bouton plein, un contour net (une ombre intérieure, la bordure reste transparente) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 700; font-size: 14.5px; cursor: pointer; background: none; white-space: nowrap;
  transition: background .15s, box-shadow .15s, transform .15s;
}
.btn .i { width: 18px; height: 18px; }
.btn.primary { background: var(--navy); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--navy) 28%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--navy) 86%, #000); transform: translateY(-1px); }
.btn.outline { box-shadow: inset 0 0 0 1.5px #cfd8e6; color: var(--navy); background: var(--card); }
.btn.outline:hover { background: var(--card); box-shadow: inset 0 0 0 1.5px var(--navy); }
.btn.teal { box-shadow: inset 0 0 0 1.5px var(--teal); color: var(--teal); background: var(--card); }
.btn.teal:hover { background: #eef8f8; }
.btn.danger { box-shadow: inset 0 0 0 1.5px #f1c4bf; color: var(--red); background: var(--card); }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn.block { width: 100%; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--green-bg); color: var(--green); }
.chip.booked { background: #eaf0fb; color: #34508a; }  /* pris par le pro, le patient n'a pas eu à confirmer (Jo, 2 oct.) */
.chip.wait { background: var(--amber-bg); color: var(--amber); }
.chip.done { background: #eef1f5; color: var(--soft); }
.chip.flag { background: var(--red-bg); color: var(--red); }
/* « Reconfirmed » : le patient a répondu « Confirmo » au rappel 24 h (Jo, 7 oct.) ; une autre allure que « Confirmed » */
.chip.reconf { background: var(--card); color: var(--green); box-shadow: inset 0 0 0 1.5px currentColor; }
.chip.reconf::before { content: "✓✓"; letter-spacing: -3px; margin-right: 2px; font-weight: 700; }
/* L'info-bulle d'une pastille (Jo, 7 oct.) : ce qu'elle veut dire, au survol ou au toucher ; dans le style du « i » des titres */
.chip[data-tip] { position: relative; cursor: help; outline: none; }
.chip[data-tip]::after { content: attr(data-tip); position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  width: max-content; max-width: min(260px, var(--tip-max, 260px)); white-space: normal; padding: 8px 11px; border-radius: 8px; background: #0f1728;
  color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.4; text-align: left; letter-spacing: 0;
  opacity: 0; visibility: hidden; transition: opacity .15s; pointer-events: none; }
.chip[data-tip]:hover::after, .chip[data-tip]:focus::after { opacity: 1; visibility: visible; }
/* Elle s'ouvre du côté où il y a de la place (Jo, 8 oct. : sur téléphone, elle sortait de l'écran par la gauche) ;
   le côté et la largeur permise viennent de placerBulle() (portal.js, et patient/base.html) */
.chip[data-tip].tip-g::after { left: 0; right: auto; }
/* La fenêtre « Invite » (portal.js, inviter(), Jo, 9 oct.) : un choix par ligne, et le message prérempli en dessous */
.inv-l { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; color: var(--text);
  text-decoration: none; box-shadow: inset 0 0 0 1px var(--line); transition: background .15s; }
.inv-l:hover { background: var(--hover, var(--tint)); }
.inv-l .i { width: 22px; height: 22px; flex: none; color: var(--navy); }
.inv-l b { display: block; font-size: 15px; }
.inv-l small { display: block; margin-top: 1px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.inv-msg { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 13px; line-height: 1.45;
  overflow-wrap: anywhere; }
/* Le menu du clic droit (portal.js, menu()) */
.ctx-menu { position: fixed; z-index: 70; min-width: 220px; max-width: 300px; padding: 5px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(15, 40, 90, .18); }
.ctx-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none;
  color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; outline: none; }
.ctx-menu button:hover, .ctx-menu button:focus { background: var(--hover); }
.ctx-menu button:disabled { color: var(--soft); cursor: default; background: none; }
.ctx-menu button.danger { color: var(--red); }
.ctx-menu .i { width: 16px; height: 16px; flex: none; color: var(--soft); }
.ctx-menu button.danger .i { color: var(--red); }
.ctx-menu .ctx-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.ctx-menu .ctx-titre { padding: 6px 10px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .i { width: 13px; height: 13px; }
.type-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.t-primera { --tc: var(--teal); }
.t-seguimiento { --tc: var(--blue); }
.t-motivo { --tc: var(--violet); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 14px; }
.input, select.input, textarea.input {
  height: 42px; border: 1px solid #d3dae5; border-radius: 6px; padding: 0 12px; background: var(--card); width: 100%;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus { outline: 2px solid #bcd0f5; border-color: var(--link); }
/* Heure en 24 h (<av-heure>, portal.js) : la liste des heures et celle des minutes, dans un seul champ */
av-heure { display: flex; align-items: center; gap: 1px; cursor: pointer; }
av-heure.input { padding: 0 12px 0 7px; }
av-heure.input:focus-within { outline: 2px solid #bcd0f5; border-color: var(--link); }
av-heure select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 4px 5px; border-radius: 4px; cursor: pointer; }
av-heure select:focus { outline: none; background: #e3ecfb; }
av-heure .i { margin-left: auto; width: 17px; height: 17px; color: var(--soft); }
av-heure[disabled], av-heure[disabled] select { cursor: default; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

/* ---------- Fenêtre modale ---------- */
.m-overlay { position: fixed; inset: 0; background: rgba(9, 20, 45, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.m-box { background: var(--card); border-radius: 12px; width: 100%; max-width: 500px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 50px rgba(9, 20, 45, .25); }
.m-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.m-head h3 { margin: 0; font-size: 20px; color: var(--title); }
.m-close { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--soft); padding: 4px; }
.m-body { padding: 16px 24px 8px; line-height: 1.5; }
.m-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 24px 22px; flex-wrap: wrap; }
.m-actions .left { margin-right: auto; }

.opts { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }
.opt { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; cursor: pointer; }
.opt:hover { border-color: #c4cfdf; }
.opt input { margin: 3px 0 0; accent-color: var(--navy); width: 17px; height: 17px; flex: none; }
.opt b { display: block; font-size: 15px; }
.opt span { color: var(--soft); font-size: 13.5px; }
.opt:has(input:checked) { border-color: var(--navy); background: var(--tint); }
.warn { background: var(--amber-bg); color: #7a3e06; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.summary { display: flex; align-items: center; gap: 10px; background: var(--tint); border-radius: 8px; padding: 10px 12px; font-weight: 600; color: var(--navy); margin-bottom: 14px; }
.summary .i { width: 18px; height: 18px; }

/* ---------- Message éphémère ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 10px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(9, 20, 45, .25); transition: all .25s; z-index: 60; max-width: calc(100vw - 32px);
  display: flex; gap: 10px; align-items: center;
  /* Un texte seulement : un toucher le traverse. Disparu, le message reste dans la page, invisible et par-dessus les
     fenêtres : sur téléphone, il prenait le toucher du bouton « Cancel » de New appointment (Jo, 6 oct.) */
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Un bouton dans le message (« Undo », ticket #171) : lui seul prend le clic, et seulement tant que le message se voit */
.toast-act { margin-left: 6px; padding: 4px 11px; border: 0; border-radius: 6px; background: rgba(255, 255, 255, .16); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; }
.toast-act:hover { background: rgba(255, 255, 255, .28); }
.toast.show .toast-act { pointer-events: auto; }
.toast .i { width: 18px; height: 18px; color: #7fe0c4; }

/* ---------- Écrans étroits ---------- */
@media (max-width: 980px) {
  .p-header { padding: 0 16px; }
  .p-home, .p-bell span, .p-user .name { display: none; }
  .p-bell { padding-right: 16px; }
  .p-user { padding-left: 16px; }
  .p-layout { grid-template-columns: 1fr; align-content: start; }  /* sinon le menu s'étire sur les pages courtes */
  .p-side { padding: 10px 16px; overflow-x: auto; }
  .p-nav { flex-direction: row; gap: 6px; }
  .p-nav a { height: 40px; white-space: nowrap; font-size: 14.5px; gap: 8px; padding: 0 12px; }
  .p-nav .sep, .p-help { display: none; }
  .seul-mobile { display: inline; }
  .content { padding: 20px 16px 28px; }
  .p-footer { flex-wrap: wrap; padding: 20px 16px; gap: 16px; }
}

/* ---------- Portail admin ---------- */
/* Pas de bandeau sous l'en-tête, comme dans les espaces pro et patient : le menu et la page montent (Jo, 4 oct.) */
body[data-role="admin"] .p-side, body[data-role="admin"] .content { padding-top: 12px; }
.chip.st-found { background: #eef1f5; color: #4a5568; }
.chip.st-verified { background: #e8eefd; color: #1d4fd8; }
.chip.st-invited { background: var(--amber-bg); color: var(--amber); }
.chip.st-registered { background: var(--green-bg); color: var(--green); }
.chip.st-removed { background: var(--red-bg); color: var(--red); }
.chip.muted { background: #f1f3f7; color: var(--soft); font-weight: 500; }
/* Le rappel 24 h d'un RDV, sur les accueils du pro et du patient (ticket #146) : discret, sous le RDV */
.rap { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; color: var(--soft); }
.rap svg { width: 13px; height: 13px; flex: none; }
.rap.ok { color: var(--green); }
.rap.ko { color: var(--red); }
.yes { color: var(--green); display: inline-flex; }
.yes .i { width: 18px; height: 18px; stroke-width: 2.4; }
.no { color: #b7c0cd; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; color: var(--soft); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: #fafbfd; }
.tbl tr.sel { background: #f3f6fd; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl input[type=checkbox], .ck { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
.page-head { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.err { background: var(--red-bg); color: var(--red); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }

/* ---------- Bandeau (démo, bêta) ---------- */
.p-banner { background: var(--amber-bg); color: var(--amber); border-bottom: 1px solid #f5dcb5; padding: 10px 24px; font-size: 14.5px; font-weight: 600; text-align: center; }
.p-banner a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.p-notice { position: relative; padding-right: 48px; background: #eaf1fd; color: var(--navy); border-bottom: 0; border-top: 1px solid #cddcf5; }
.p-notice-x { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px;
  padding: 0; border: 0; border-radius: 8px; background: none; color: var(--navy); cursor: pointer; }
.p-notice-x:hover { background: rgba(13, 58, 154, .1); }
.p-notice-x .i { width: 16px; height: 16px; }
.p-notice a { color: var(--blue); font-weight: 700; }

/* Message d'erreur (enregistrement refusé) */
.toast.error { background: var(--red); }

/* Un élément masqué reste masqué, même avec un display défini ailleurs */
[hidden] { display: none !important; }
.toast.error .i { color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; }

/* Menu de langue */
.av-lang { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); }
.av-lang .i { width: 18px; height: 18px; }
.av-lang select { border: 1.5px solid #cdd6e3; border-radius: 8px; background: var(--card); color: var(--navy); font-weight: 600; font-size: 14px; padding: 6px 8px; cursor: pointer; }
@media (max-width: 700px) { .av-lang .i { display: none; } .p-bell span { display: none; } }

/* Téléphone : l'en-tête et les titres de carte tiennent dans 375 px de large */
select.input { max-width: 100%; }
@media (max-width: 480px) {
  .p-header { padding: 0 12px; }
  .p-right .av-lang { margin-right: 8px !important; }  /* écrase la marge écrite par portal.js */
  .av-lang select { font-size: 13px; padding: 5px 4px; }
  .p-bell { padding-right: 10px; }
  .p-user { padding-left: 10px; gap: 6px; }
  .p-user .avatar { width: 36px; height: 36px; font-size: 13px; }
  .card-h { flex-wrap: wrap; }
}

/* Le dossier patient (js/dossier.js, Jo, 1er oct.) : la fiche à gauche, les notes en blocs datés à droite, ouvrable de partout */
/* « Appointment types » : le nom, qui le fait (#93), la durée et le prix tiennent sur une ligne, même en français */
.m-overlay.types .m-box { max-width: 640px; }
/* La liste en grille : chaque colonne tombe pile d'une ligne à l'autre (le point, le nom, les pastilles, la durée, les
   boutons) ; « solo », un cabinet d'une personne, sans la colonne des pastilles */
.tl { display: grid; align-items: stretch; grid-template-columns: auto minmax(80px, 1fr) auto auto auto auto; }
.tl.solo { grid-template-columns: auto minmax(80px, 1fr) auto auto auto; }
.tl .t-dur-sous { display: none; }
/* La fiche d'un type, ouverte sous sa ligne dans « My information » (Jo, 16 oct.) : enregistrée toute seule */
.tl .t-fiche { margin: 0 0 12px; padding: 14px 16px 12px; border-radius: 12px; background: var(--tint); }
.tl .t-fiche .row { margin-bottom: 0; }
.tl [data-code] > div { cursor: default; }
.card .tl .trow > div:not(.t-fiche) { cursor: pointer; }
@media (max-width: 560px) {
  .tl .t-lbl { display: none; }  /* la fenêtre, et la carte de « My information » (16 oct.) */
  /* Téléphone : la durée et le prix sous le nom, une colonne de moins */
  .tl { grid-template-columns: auto minmax(0, 1fr) auto auto auto; }
  .tl.solo { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .tl .t-dur { display: none !important; }
  .tl .t-dur-sous { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
}
.m-overlay.dossier .m-box { max-width: 1040px; height: min(88vh, 860px); display: flex; flex-direction: column; overflow: hidden; }
.m-overlay.dossier .m-body { flex: 1; min-height: 0; padding-bottom: 0; }
.dos-grid { display: grid; grid-template-columns: 290px 1fr; gap: 22px; height: 100%; min-height: 0; }
.dos-fiche { overflow: auto; padding-right: 6px; font-size: 14.5px; }
.dos-fiche .kv { line-height: 1.9; color: var(--muted); margin-bottom: 8px; overflow-wrap: anywhere; }
.dos-fiche .kv .i { width: 16px; height: 16px; vertical-align: -3px; margin-right: 8px; }
.dos-fiche .sec { font-weight: 700; margin: 14px 0 6px; color: var(--title); }
.dos-fiche .muted { color: var(--soft); font-size: 13.5px; }
.dos-fiche .hist { list-style: none; margin: 0; padding: 0; }
.dos-fiche .hist li { padding: 9px 0; border-top: 1px solid var(--line); }
.dos-fiche .hist li:first-child { border-top: 0; }
.dos-fiche .hist .h1 { display: flex; gap: 8px; align-items: center; font-weight: 600; flex-wrap: wrap; }
.dos-fiche .hist .h1 .type-dot { background: var(--tc); }
.dos-fiche .hist li.annule .h1 { color: var(--soft); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.dos-fiche .hist p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.dos-flag { color: var(--red); }
.dos-arch { color: var(--soft); }
/* Ranger le patient (Jo, 1er oct.) : bloquer, archiver, supprimer, discrets sous le drapeau */
.dos-ranger { display: flex; flex-wrap: wrap; gap: 0 16px; font-size: 13.5px; }
.dos-ranger:empty { display: none; }
.dos-ranger .link { color: var(--soft); font-weight: 500; }
.dos-ranger .link:hover { color: var(--title); }
.dos-fiche .kv .dos-ranger .i { width: 14px; height: 14px; margin-right: 5px; }
.dos-main { display: flex; flex-direction: column; min-height: 0; }
.dos-h { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; }
.dos-h h4 { margin: 0; font-size: 17px; color: var(--title); }
.dos-h .btn { margin-left: auto; }
.dos-notes { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 2px 4px 16px 2px; }
.dos-vide { color: var(--soft); font-size: 14.5px; padding: 24px 4px; text-align: center; border: 1.5px dashed var(--line); border-radius: 10px; }
.nb { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--card); flex: none; }
.nb header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.nb-date { font-size: 15px; color: var(--title); }
.nb-date::first-letter { text-transform: uppercase; }
.nb-act { margin-left: auto; display: flex; gap: 2px; opacity: .55; }
.nb:hover .nb-act, .nb.edit .nb-act { opacity: 1; }
.nb-act button { border: 0; background: none; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; color: var(--soft); display: grid; place-items: center; }
.nb-act button:hover { background: #eef2f8; color: var(--navy); }
.nb-act button[data-act="del"]:hover { background: var(--red-bg); color: var(--red); }
.nb-act .i { width: 17px; height: 17px; }
.nb-c, .nb-ed { line-height: 1.6; font-size: 15px; color: var(--title); overflow-wrap: anywhere; }
.nb-c { cursor: text; border-radius: 6px; margin: 0 -6px; padding: 2px 6px; }
.nb-c:hover { background: #fafbfd; }
.nb-c ul, .nb-c ol, .nb-ed ul, .nb-ed ol { margin: 4px 0; padding-left: 26px; }
.nb-meta { color: var(--soft); font-size: 12.5px; margin-top: 6px; }
.nb-meta:empty { display: none; }
.nb.edit { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(29, 79, 216, .08); }
.nb-jour { width: auto; height: 34px; padding: 0 10px; font-size: 14.5px; font-weight: 600; }
.nb-ed { min-height: 110px; max-height: 50vh; overflow: auto; padding: 10px 2px; outline: 0; }
.nb-ed:empty::before { content: attr(data-vide); color: var(--soft); pointer-events: none; }
.nb footer { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.nb footer .btn { margin-left: auto; }
.dos-tools { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 4px 6px; border-radius: 8px; background: #f5f7fb; }
.dos-tools button { border: 0; background: none; min-width: 32px; height: 32px; border-radius: 6px; cursor: pointer; color: var(--title); font: inherit; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 6px; }
.dos-tools button:hover { background: #e8edf6; }
.dos-tools button.on { background: #dfe7f5; color: var(--navy); }
.dos-tools button .i { width: 17px; height: 17px; }
.dos-tools .dos-col span { width: 16px; height: 16px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.dos-sep { width: 1px; height: 20px; background: #dde3ee; margin: 0 6px; }
.dos-status { font-size: 13px; color: var(--soft); display: inline-flex; align-items: center; gap: 4px; }
.dos-status .i { width: 14px; height: 14px; }
.dos-status.saved { color: var(--green); }
.dos-status.error { color: var(--red); font-weight: 600; }
.c-red { color: #c62828; } .c-blue { color: #1d4fd8; } .c-green { color: #2e7d32; } .c-orange { color: #b45309; }
/* L'icône du dossier (dossier.icone) : pleine et bleue avec le nombre de notes, vide et grise sans notes */
.dos-ico { position: relative; border: 0; background: none; width: 40px; height: 36px; border-radius: 8px; cursor: pointer; color: #a3adbd; display: inline-grid; place-items: center; vertical-align: middle; }
.dos-ico:hover { background: #eef2f8; color: var(--navy); }
.dos-ico .i { width: 24px; height: 24px; }
.dos-ico.plein { color: var(--navy); }
.dos-ico.plein .i path:first-child { fill: rgba(29, 79, 216, .14); }
.dos-ico span { position: absolute; top: 1px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
/* Une note partagée avec le patient (Q8) : l'interrupteur « Visible to the patient », et le bloc teinté de vert-bleu */
.nb header { flex-wrap: wrap; }
.nb-share { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 5px 9px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.nb-share:hover { background: #eef2f8; color: var(--text); }
.nb-share + .nb-act { margin-left: 0; }
.nb-share .sw { position: relative; width: 28px; height: 16px; border-radius: 8px; background: #cfd6e2; flex: none; transition: background .15s; }
.nb-share .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.nb-share.on { color: var(--teal); }
.nb-share.on .sw { background: var(--teal); }
.nb-share.on .sw::after { transform: translateX(12px); }
.nb.partagee { border-color: #a9d6d6; background: #f5fbfb; }
.nb.partagee.edit { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 118, 118, .1); }
@media (max-width: 760px) {
  .m-overlay.dossier { padding: 0; }
  .m-overlay.dossier .m-box { height: 100%; max-height: none; border-radius: 0; }
  .m-overlay.dossier .m-body { overflow: auto; padding: 12px 14px 0; }
  .dos-grid { grid-template-columns: 1fr; height: auto; gap: 18px; }
  .dos-fiche { overflow: visible; padding-right: 0; }
  .dos-main { order: -1; }
  .dos-notes { overflow: visible; }
  .nb-act { opacity: 1; }
  .dos-sep { margin: 0 2px; }
}

/* « Communication preferences » (js/communications.js, Jo, 5 oct.) : une ligne par canal, son adresse, son état */
.comms { max-width: 680px; }
.comms-intro { color: var(--soft); font-size: 14px; margin: -4px 0 14px; }
.canal { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.canal-ico { width: 36px; height: 36px; border-radius: 50%; background: var(--ic-bg, #e6edfb); color: var(--navy); display: grid; place-items: center; flex: none; }
.canal-ico svg { width: 19px; height: 19px; }
.canal-txt { flex: 1; min-width: 0; }
.canal-nom { font-weight: 700; font-size: 16px; color: var(--navy); }
.canal-adr { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; margin-top: 2px; }
.canal-etat { font-size: 13px; color: var(--soft); margin-top: 4px; }
.canal-etat::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #b8c0cc; vertical-align: 1px; }
.canal-etat.vert { color: var(--teal); }
.canal-etat.vert::before { background: var(--teal); }
.canal-etat.orange { color: #b45309; }
.canal-etat.orange::before { background: #ea7a18; }
.canal.bientot .canal-ico, .canal.bientot .canal-nom, .canal.bientot .canal-adr { opacity: .55; }
.canal-bientot { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--tint); color: var(--soft); font-size: 12px; font-weight: 600; vertical-align: 2px; }
.tgl { position: relative; flex: none; width: 44px; height: 26px; margin: 11px 2px 0; border: 0; border-radius: 13px; background: #cfd6e2; cursor: pointer; transition: background .15s; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.tgl[aria-checked="true"] { background: var(--teal); }
.tgl[aria-checked="true"]::after { transform: translateX(18px); }
.tgl:disabled { cursor: default; opacity: .45; }
.tgl[aria-busy="true"] { opacity: .6; }
.tgl:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
/* « Verify » (ticket #190) : un petit bouton au bout de l'adresse, puis la case du code sous la ligne. Les jetons
   (--link, --tint, --card) suivent le pro, le patient et le thème sombre */
.canal-verif { display: inline-block; margin-left: 6px; padding: 1px 11px; border: 1.5px solid var(--link); border-radius: 999px; background: transparent; color: var(--link); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.6; cursor: pointer; vertical-align: 1px; }
.canal-verif:hover { background: var(--hover); }
.canal-verif[aria-busy="true"] { opacity: .6; cursor: progress; }
.canal-verif:focus-visible, .canal-code-autre:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.canal-ok { display: inline-block; margin-left: 6px; color: var(--teal); font-size: 13px; font-weight: 700; white-space: nowrap; }
.canal-code { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--tint); font-size: 13.5px; color: var(--muted); }
.canal-code-l { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 8px; }
.canal-code input { width: 9ch; padding: 6px 8px; border: 1.5px solid var(--line-2, var(--line)); border-radius: 8px; background: var(--card); color: var(--text); font: inherit; font-size: 18px; font-weight: 700; letter-spacing: .16em; text-align: center; }
.canal-code input:focus { outline: none; border-color: var(--link); }
.canal-code .canal-verif { margin-left: 0; }
.canal-code-autre { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.canal-code-err { color: var(--red); font-size: 13px; margin-top: 6px; }
.canal-code-err:empty { display: none; }
.comms-rappel, .comms-alerte { display: flex; gap: 10px; align-items: flex-start; border-radius: 10px; padding: 10px 12px; margin: 0 0 6px; font-size: 14px; }
.comms-rappel { background: var(--tint); color: var(--navy); }
.comms-rappel small { display: block; color: var(--soft); font-size: 12.5px; margin-top: 2px; }
.comms-alerte { background: #fff4e5; color: #b45309; font-weight: 600; }
.comms-rappel svg, .comms-alerte svg, .comms-bas svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.comms-note { font-size: 13px; color: var(--soft); margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); }
.comms-bas { display: flex; gap: 8px; align-items: flex-start; max-width: 680px; font-size: 13px; color: var(--soft); margin: 12px 4px 0; }
.comms-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
               background: #1d2433; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; transition: opacity .2s, transform .2s; max-width: 90vw; }
.comms-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Téléphone, sous 700 px (Jo, 6 oct., ticket #160) ----------
   Rien ici ne touche l'ordinateur : tout est dans des blocs « max-width », sauf le nom court des onglets, caché partout. */
.court, .av-fab, .av-plus { display: none; }
@media (max-width: 700px) {
  /* Le « + » qui flotte en bas à droite et le menu « ⋯ » en haut à droite (portal.js, actionsTelephone) : la rangée de
     boutons de la page (data-actions-mobile) se cache, et l'agenda ou la liste commence juste sous le titre */
  body .actions[data-actions-mobile], body [data-actions-mobile] > .btn { display: none; }  /* body : plus fort que le style de la page */
  main.content { position: relative; }
  main.content:has(> .av-plus) h1.page { padding-right: 46px; }
  .av-fab {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 36;
    width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--navy); color: #fff; cursor: pointer;
    box-shadow: 0 6px 18px rgba(9, 20, 45, .3);
  }
  .av-fab .i { width: 28px; height: 28px; stroke-width: 2.4; }
  .av-plus { display: block; position: absolute; top: 10px; right: 6px; z-index: 30; }
  .av-plus-b { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: none;
    color: var(--navy); cursor: pointer; }
  .av-plus.open .av-plus-b, .av-plus-b:active { background: rgba(29, 79, 216, .1); }
  .av-plus-b .i { width: 26px; height: 26px; stroke-width: 2.6; }
  .av-plus-m { display: none; position: absolute; right: 0; top: calc(100% + 4px); min-width: 230px; padding: 6px; flex-direction: column;
    background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(9, 20, 45, .18); }
  .av-plus.open .av-plus-m { display: flex; }
  .av-plus-m button { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border: 0; border-radius: 8px;
    background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 500; text-align: left; white-space: nowrap; cursor: pointer; }
  .av-plus-m button:active { background: var(--hover, #f2f5fa); }
  .av-plus-m .i { width: 20px; height: 20px; color: var(--navy); }
  /* Les messages passent au-dessus du « + » */
  body.espace-pro:has(.av-fab) .toast { bottom: calc(146px + env(safe-area-inset-bottom)); }

  /* Le menu devient une barre d'onglets en bas de l'écran, comme une appli, dans les espaces pro et patient (le portail
     admin garde ses onglets en haut). Seuls les liens qui ont un nom court y vont (data-court) ; les autres
     (Communication preferences, Subscription, Log out) restent dans le menu du compte, en haut à droite. */
  body.espace-pro, body.espace-patient { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  body.espace-pro .p-side, body.espace-patient .p-side {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; overflow: visible;
    padding: 0 4px env(safe-area-inset-bottom); background: var(--card); border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(9, 20, 45, .06);
  }
  body.espace-pro .p-nav, body.espace-patient .p-nav { gap: 0; }
  body.espace-pro .p-nav a, body.espace-patient .p-nav a {
    position: relative; flex: 1 1 auto; min-width: 0; height: 62px; padding: 7px 2px 5px; border-radius: 0;  /* auto : un nom long (« Appointments ») prend plus de place */
    flex-direction: column; justify-content: center; gap: 3px; background: none; color: var(--soft); font-size: 0;
  }
  body.espace-pro .p-nav a:not([data-court]), body.espace-patient .p-nav a:not([data-court]) { display: none; }
  body.espace-pro .p-nav a:hover, body.espace-patient .p-nav a:hover { background: none; }
  body.espace-pro .p-nav a.active, body.espace-patient .p-nav a.active { background: none; color: var(--navy); }
  body.espace-pro .p-nav a.active::before, body.espace-patient .p-nav a.active::before {
    content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--navy);
  }
  body.espace-pro .p-nav a .i, body.espace-patient .p-nav a .i { width: 24px; height: 24px; }
  body.espace-pro .p-nav .court, body.espace-patient .p-nav .court {
    display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600;
  }
  body.espace-pro .p-nav a .a-faire, body.espace-patient .p-nav a .a-faire {
    position: absolute; top: 5px; left: calc(50% + 5px); margin: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px;
  }
  /* Ce qui flotte en bas de l'écran passe au-dessus de la barre : le bouton « Bug » (plus petit), les messages */
  body.espace-pro .avb-btn, body.espace-patient .avb-btn { bottom: calc(74px + env(safe-area-inset-bottom)); left: 12px; width: 44px; height: 44px; }
  /* Le dock, au-dessus de la barre d'onglets ; le « + » reste à droite */
  .av-dock { left: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); gap: 8px; }
  .av-dock-aide { width: 44px; height: 44px; }
  .av-dock-aide .i { width: 22px; height: 22px; }
  body.espace-pro .toast, body.espace-patient .toast,
  body.espace-pro .comms-toast, body.espace-patient .comms-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* Le haut de l'écran plus serré (Jo, 6 oct.) : l'en-tête passe de 68 à 54 px, l'avatar et le logo rapetissent un peu */
  .p-header { height: 54px; }
  .p-logo { font-size: 19px; gap: 6px; }
  .p-logo img { height: 26px; }
  body.espace-pro .p-logo::after { font-size: 10px; padding: 2px 6px; }
  .p-user .avatar { width: 32px; height: 32px; font-size: 12px; }
  .av-lang select { padding-top: 4px; padding-bottom: 4px; }

  /* La liste de la cloche, accrochée à la cloche, débordait à gauche (l'avatar est encore à droite) : sur téléphone, elle
     prend la largeur de l'écran, juste sous l'en-tête, et s'arrête au-dessus de la barre d'onglets (Jo, 7 oct.) */
  .p-nlist { position: fixed; left: 8px; right: 8px; top: 62px; width: auto; max-width: none;
    max-height: calc(100vh - 62px - 80px - env(safe-area-inset-bottom)); }

  /* Les bandeaux du haut (démo, mois gratuit) plus serrés */
  .p-banner { padding: 5px 12px; font-size: 13px; }

  /* Un peu plus de place pour le contenu : les titres et les cartes. « clip » : si un élément dépasse encore, il est
     coupé au lieu d'élargir la page (une page plus large que l'écran se zoome, et la barre du bas se met à flotter) */
  .content { padding: 12px 12px 24px; overflow-x: clip; }
  h1.page { font-size: 22px; }
  h1.page:has(.info-bulle) { margin-bottom: 12px; }
  .card { padding: 16px; }
  .card-h { font-size: 16.5px; gap: 10px; margin-bottom: 12px; }
  .card-h .ic { width: 30px; height: 30px; }  /* la pastille ronde du titre, plus petite */
  .card-h .ic .i { width: 16px; height: 16px; }
  .card-h .ic.sablier::before { width: 13px; height: 17px; }
  .card-h .a-faire { flex: none; }
}
/* À 360 px, l'en-tête dépassait de 4 px, et toute la page glissait de côté : la flèche sous l'avatar part (l'avatar
   ouvre toujours le menu du compte), le trait à côté aussi */
@media (max-width: 400px) {
  .p-user > .i { display: none; }
  button.p-user { border-left: 0; padding-left: 6px; }
}
/* Sous 420 px, sans « PRO » : l'en-tête marine le dit déjà */
@media (max-width: 420px) { body.espace-pro .p-logo::after { display: none; } }

/* Le plan gratuit et ses suggestions (ticket #199, js/gratuit.js) : calmes, dans la couleur des pros, jamais en alarme */
.gr-apercu { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--tint); border: 1px dashed var(--blue); color: var(--title);
  border-radius: 12px; padding: 9px 12px; margin: 0 0 14px; font-size: 13.5px; line-height: 1.45; }
.gr-apercu > svg { width: 18px; height: 18px; flex: none; color: var(--blue); }
.gr-apercu span { flex: 1; min-width: 200px; }
.gr-carte { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; background: var(--tint); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px;
  font-size: 13.5px; color: var(--title); line-height: 1.45; }
.gr-carte .gr-txt { flex: 1; min-width: 200px; }
.gr-carte .gr-txt b { font-weight: 700; }
.gr-carte .gr-txt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.gr-carte .gr-act { display: flex; gap: 6px; flex-wrap: wrap; }
.gr-sans { display: inline-flex; align-items: center; gap: 4px; color: var(--soft); font-size: 12.5px; cursor: pointer; }
.gr-sans svg { width: 13px; height: 13px; flex: none; }
.gr-sans:hover { color: var(--blue); }
.gr-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; padding: 12px 2px 4px; align-items: start; }
.gr-col { display: flex; flex-direction: column; gap: 8px; }
.gr-seul-col { max-width: 460px; margin: 0 auto; }
.gr-plans.gr-seul { grid-template-columns: minmax(0, 1fr); }
.gr-seul-txt { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
/* « Everything unlocked, for free. Enjoy! » et le compte à rebours de l'early access (Jo, 14 oct.) */
.gr-fete { margin: 14px 0 0; text-align: center; font-size: 17px; font-weight: 700; color: var(--title); }
.gr-rebours { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px auto 0; width: fit-content;
  padding: 5px 12px; border-radius: 999px; background: var(--chip, rgba(37, 99, 235, .08)); color: var(--muted); font-size: 13px; }
.gr-rebours b { color: var(--title); }
.gr-rebours svg { width: 15px; height: 15px; flex: none; }
.gr-plan { position: relative; display: flex; flex-direction: column; gap: 6px; border: 1.5px solid #cfd8e6; border-radius: 14px; padding: 14px 14px 12px;
  background: var(--card); box-shadow: 0 1px 3px rgba(15, 23, 40, .06); transition: border-color .15s, box-shadow .15s; }
.gr-plan.choix { cursor: pointer; }
.gr-plan.choix:hover { border-color: #9db5e4; box-shadow: 0 2px 8px rgba(13, 58, 154, .10); }
.gr-plan.choix:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gr-plan.choisi { border: 2px solid var(--blue); box-shadow: 0 0 0 4px var(--tint), 0 2px 8px rgba(13, 58, 154, .12); padding: 13.5px 13.5px 11.5px; }
.gr-plan.conseil { background: var(--tint); }
.gr-plan.actuel { border-color: var(--green); }
.gr-plan.actuel.choisi { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.gr-reco { position: absolute; top: -10px; left: 12px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .2px;
  padding: 3px 9px; border-radius: 999px; }
.gr-coche { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cfd8e6; background: var(--card);
  display: flex; align-items: center; justify-content: center; color: transparent; }
.gr-coche svg { width: 13px; height: 13px; }
.gr-plan.choisi .gr-coche { background: var(--blue); border-color: var(--blue); color: #fff; }
.gr-plan.actuel.choisi .gr-coche { background: var(--green); border-color: var(--green); }
.gr-plan.choix .gr-tete { padding-right: 30px; }
.gr-ici { align-self: center; font-size: 12.5px; font-weight: 700; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: 4px 12px; }
.gr-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gr-tete b { color: var(--title); font-size: 15.5px; }
.gr-plan .gr-prix { font-weight: 800; color: var(--title); text-align: right; white-space: nowrap; }
.gr-plan .gr-prix small { font-weight: 500; color: var(--soft); }
.gr-plan ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gr-plan ul.sans { list-style: none; padding-left: 0; color: var(--soft); }
.gr-plan ul.sans li::before { content: "✕ "; color: var(--red); font-weight: 700; }
.m-actions .btn.gr-meme { opacity: .65; }
.m-box.gr-large { max-width: 880px; width: calc(100vw - 32px); }
.m-box.gr-large .m-body { max-height: 72vh; overflow: auto; }
.gr-pack { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.gr-pack svg { width: 15px; height: 15px; flex: none; }
/* Les options sous les forfaits : des lignes en pointillé, pas des cartes (Jo, 14 oct.) */
.gr-opts-lbl { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.gr-opts-lbl::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.gr-opt { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 6px; border: 1px dashed var(--line-2, #c3cad6);
  border-radius: 10px; font-size: 13px; }
.gr-opt > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.gr-opt-txt { flex: 1; min-width: 0; line-height: 1.45; }
.gr-opt-txt b { color: var(--title); }
.gr-opt-txt span { color: var(--muted); }
.gr-opt-solde { color: var(--link); font-size: 12px; font-weight: 600; margin-top: 2px; }
.gr-opt-prix { white-space: nowrap; font-weight: 600; color: var(--title); }
.gr-opt-prix small { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) { .gr-opt { flex-wrap: wrap; } .gr-opt-txt { flex-basis: calc(100% - 28px); } .gr-opt-prix { margin-left: 28px; } }
.gr-regle { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; }
/* Le compteur des messages, dans « Communication preferences » (étape 7a) */
.gr-solde { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--line-2, #c3cad6);
  border-radius: 10px; font-size: 13px; line-height: 1.45; }
.gr-solde > svg { width: 18px; height: 18px; flex: none; color: var(--muted); margin-top: 1px; }
.gr-solde b { display: block; color: var(--title); }
.gr-solde small { display: block; color: var(--muted); font-size: 12.5px; margin: 2px 0 4px; }
.gr-verrou { display: inline-flex; width: 14px; height: 14px; color: var(--soft); vertical-align: -2px; margin-left: 4px; }
.gr-verrou svg { width: 14px; height: 14px; }
.ev-sans { display: inline-flex; flex: none; margin-right: 3px; vertical-align: -1px; }
.ev-sans .gr-sans svg { width: 13px; height: 13px; }
/* Le badge du forfait, après « PRO » dans l'en-tête marine (Jo, 14 oct., ticket #199) : un clic dit ce qu'il comprend */
.p-plan { margin-left: 2px; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; line-height: 1; padding: 5px 9px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #fff; cursor: pointer; white-space: nowrap; }
.p-plan:hover { background: rgba(255, 255, 255, .1); }
.p-plan.beta { border-color: rgba(127, 224, 217, .55); color: #b9f0ec; }
.p-plan.trial { border-color: rgba(127, 224, 217, .8); background: rgba(127, 224, 217, .16); color: #fff; }
.p-plan.free { border-color: rgba(255, 196, 120, .7); color: #ffd9a8; }
.p-plan.paid { border-color: rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .75); }
.p-plan-m { display: none !important; }
/* Sur téléphone, le badge reste dans l'en-tête (Jo, 14 oct.) : plus petit, et sous 440 px le mot « agenviva » laisse
   sa place, le « A » du logo suffit */
@media (max-width: 560px) { .p-header .p-plan { font-size: 11px; padding: 4px 8px; margin-left: 6px; white-space: nowrap; } }
@media (max-width: 440px) { .p-header .p-logo > span { display: none; } .p-header .p-plan { margin-left: 8px; } }
/* La langue en globe sur téléphone (Jo, 16 oct. : sur son S21, l'avatar sortait de l'écran à droite et la page se
   dézoomait) : un rond avec le globe, le menu de la langue invisible par-dessus (un toucher l'ouvre, comme avant). Pour
   l'espace pro (js/portal.js) comme pour le portail patient (agenviva/langues.menu_html) */
@media (max-width: 700px) {
  .p-header { gap: 10px; }
  .p-right .av-lang { position: relative; flex: none; width: 36px; height: 36px; padding: 0; justify-content: center;
    margin-right: 8px !important; border: 1.5px solid rgba(11, 42, 94, .25); border-radius: 50%; }
  .p-right .av-lang svg { display: block; width: 18px; height: 18px; }
  .p-right .av-lang select { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
  body.espace-pro .p-right .av-lang { border-color: rgba(255, 255, 255, .3); }
}

/* Les forfaits sur téléphone (Jo, 14 oct. : « impressionne-moi ») : un carrousel qu'on glisse au doigt, une carte à la fois,
   les voisines qui dépassent ; des points dessous ; la carte au centre est celle qu'on choisit (js/gratuit.js) */
@media (max-width: 560px) {
  .gr-plans:not(.gr-seul) { position: relative; display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; gap: 10px; padding: 14px 34px 6px; transition: height .25s ease;
    margin: 0 -24px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .gr-plans:not(.gr-seul)::-webkit-scrollbar { display: none; }
  .gr-plans:not(.gr-seul) > .gr-col { flex: 0 0 100%; min-width: 0; max-width: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
  .gr-plans:not(.gr-seul) .gr-plan { transition: transform .25s ease, opacity .25s ease; }
  .gr-plans:not(.gr-seul) .gr-col:not(.au-centre) .gr-plan { transform: scale(.94); opacity: .7; }
  .gr-dots { display: flex; justify-content: center; gap: 6px; margin: 4px 0 2px; }
  .gr-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--line-2, #c3cad6); cursor: pointer;
    transition: width .25s ease, background .25s ease; }
  .gr-dots button.on { width: 22px; background: var(--link); }
}
.gr-dots:not(:empty) { min-height: 8px; }
@media (min-width: 561px) { .gr-dots { display: none; } }
@media (prefers-reduced-motion: reduce) { .gr-plans .gr-plan, .gr-dots button { transition: none !important; } }

/* ---------- Les tâches (Jo, 17 oct., ticket #202 ; js/taches.js) : une case ronde, le texte, puis l'échéance, le patient,
   pour qui ; une tâche automatique a sa petite étiquette « Auto ». Partout pareil : le résumé, le dossier, l'agenda ---------- */
.tk-l { display: grid; gap: 2px; }
.tk { display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px 8px 4px; border-radius: 10px; }
.tk:hover { background: var(--hover); }
.tk-ok { flex: none; width: 22px; height: 22px; margin-top: 1px; padding: 0; border-radius: 50%; border: 2px solid #b8c2d3;
  background: var(--card); color: transparent; display: grid; place-items: center; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.tk-ok .i { width: 13px; height: 13px; stroke-width: 3; }
.tk-ok:hover { border-color: var(--green); color: var(--green); }
.tk.fait .tk-ok { background: var(--green); border-color: var(--green); color: #fff; }
.tk-c { flex: 1; min-width: 0; cursor: pointer; outline: none; }
.tk-c:focus-visible { box-shadow: 0 0 0 2px #bcd0f5; border-radius: 6px; }
.tk-t { font-size: 15px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.tk.fait .tk-t { text-decoration: line-through; color: var(--soft); }
.tk-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 3px; font-size: 13px; color: var(--soft); }
.tk-m:empty { display: none; }
.tk-m .i { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.tk-d.jour { color: var(--navy); font-weight: 600; }
.tk-d.retard { color: var(--red); font-weight: 600; }
.tk-p { color: var(--link); text-decoration: none; }
.tk-p:hover { text-decoration: underline; }
.tk-pour { display: inline-flex; align-items: center; gap: 5px; }
.tk-auto { padding: 0 7px; border-radius: 999px; background: var(--ic-bg); color: var(--navy); font-size: 11.5px; font-weight: 600; cursor: help; }
.tk-vide { padding: 6px 4px; color: var(--soft); font-size: 14.5px; }
.tk-plus { margin-left: auto; }
.tk-form .tk-opt { font-weight: 400; color: var(--soft); }
.tk-jours { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-jours .input { width: auto; flex: 1 1 160px; }
.tk-note { margin: 4px 0 0; color: var(--soft); font-size: 13px; }
.tk-fen .m-box { max-width: 560px; }
.tk-barre { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tk-barre .seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg); gap: 2px; }
.tk-barre .seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.tk-barre .seg button.on { background: var(--card); color: var(--title); font-weight: 600; box-shadow: 0 1px 2px rgba(11, 42, 94, .12); }
.tk-tout { max-height: 60vh; overflow: auto; }
/* L'agenda : la pastille des tâches d'un jour, sur l'en-tête du jour (vues jour et semaine) ou sur la case (vue mois) */
.tk-jour { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 0 6px; height: 18px; border-radius: 999px;
  border: 0; background: var(--ic-bg); color: var(--navy); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; vertical-align: 1px; }
.tk-jour .i { width: 11px; height: 11px; stroke-width: 2.6; }
.tk-jour.retard { background: var(--red-bg); color: var(--red); }
.tk-jour:hover { filter: brightness(.95); }
/* Le dossier : les tâches du patient, sous « Next appointment » */
.dos-fiche .tk { padding: 6px 4px 6px 0; }
.dos-h .dos-tk { margin-left: auto; }
.dos-h .dos-tk + .btn { margin-left: 0; }
.dos-fiche .tk-vide { font-size: 14px; padding: 2px 0; }
.dos-fiche .tk-t { font-size: 14.5px; }
