/* =============================================================================
   Synoptik — interface de l'app (nouvelle charte)

   Socle : ../commun/radiologik.css (jetons des deux thèmes, composants). Ici :
   la disposition propre à l'app — trois volets sur ordinateur (dictée |
   compte-rendu | points à vérifier), onglets sur téléphone — et ses éléments.
   Aucune couleur en dur : uniquement les jetons var(--…) du socle. Aucun
   style inline dans la page ni posé par le JS (CSP sans 'unsafe-inline').
   ============================================================================= */

[hidden] {
  display: none !important;
}

/* --- Vues ------------------------------------------------------------------ */

.vue-generer {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Trois colonnes : dictée | compte-rendu | points à vérifier. Écran moyen :
   dictée et points à vérifier empilés à gauche, le compte-rendu à droite.
   Les volets latéraux ne prennent leur largeur entière que si le compte-rendu
   garde au moins 480 px (écran de 1280 px : environ 340 et 320 px). */
.volets {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(480px, 1fr) minmax(260px, 400px);
  grid-template-areas: "dictee cr verif";
  align-items: stretch;
  gap: 16px;
  padding: 16px;
}

.volet {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.volet--dictee {
  grid-area: dictee;
}

.volet--cr {
  grid-area: cr;
}

.volet--verif {
  grid-area: verif;
}

@media (min-width: 721px) and (max-width: 1279px) {
  .volets {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "dictee cr"
      "verif cr";
  }
}

.onglets-generer {
  display: none;
}

.carte__entete {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 10px;
}

.carte__titre {
  margin-right: auto;
  font-size: 15px;
}

.rangee {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* --- Dictée ---------------------------------------------------------------- */

.dictee {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}

.dictee__selections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dictee__texte {
  min-height: 200px;
}

.dictee__selections .champ {
  padding-inline: 10px 4px;
  font-size: 14px;
}

/* « Générer » et « CR normal » (sans IA) côte à côte, l'un sous l'autre si la place manque. */
.dictee__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dictee__generer {
  flex: 2 1 220px;
}

.dictee__normal {
  flex: 1 1 140px;
}

.dictee__sans-ia {
  margin-left: 6px;
  font-family: var(--police-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.dictee__effacer {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  font-size: 13px;
}

/* --- Examen de suivi (volet repliable de la dictée) ------------------------ */

.suivi {
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
}

.suivi__resume {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.suivi[open] > .suivi__resume {
  border-bottom: 1px solid var(--carte-bord);
}

.suivi__corps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
}

.suivi__iupd .suivi__corps {
  padding: 0;
}

.suivi__comparatif {
  min-height: 90px;
  font-size: 13.5px;
}

.suivi__mesures,
.suivi__iupd,
.suivi__lesions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suivi-lesion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--carte-bord);
}

.suivi-lesion__tete {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  gap: 8px;
  align-items: center;
}

.suivi-lesion__retirer {
  min-height: 32px;
  font-size: 18px;
}

.suivi-lesion__mesures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.suivi-lesion__temps {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.suivi-lesion__axes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}

/* Six champs de mesure par lésion en Lugano : marges réduites et sans flèches,
   sinon « 45,5 » s'affiche « 45, » dans un volet de dictée de 360 px. */
.suivi-lesion .champ[type="number"] {
  padding-left: 6px;
  padding-right: 6px;
  text-align: right;
  appearance: textfield;
}

.suivi-lesion .champ[type="number"]::-webkit-inner-spin-button,
.suivi-lesion .champ[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.suivi__resultat p + p {
  margin-top: 4px;
}

.suivi__apercu {
  margin-top: 8px;
  font-size: 13px;
}

.suivi__apercu summary {
  cursor: pointer;
  color: var(--accent-texte);
}

.suivi__apercu ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-family: var(--police-cr);
}

.chargement {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chargement__roue {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid var(--champ-bord);
  border-top-color: var(--accent-texte);
  border-radius: 50%;
  animation: tourner 0.8s linear infinite;
}

@keyframes tourner {
  to {
    transform: rotate(360deg);
  }
}

.liste-identifiants {
  margin: 8px 0 10px;
  padding-left: 18px;
  font-family: var(--police-mono);
  font-size: 12.5px;
}

.encart--bloc {
  display: block;
}

.encart--bloc[hidden] {
  display: none;
}

.liste-identifiants--choix {
  padding-left: 0;
  list-style: none;
}

.liste-identifiants--choix label {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 2px 0;
}

.encart p + p {
  margin-top: 6px;
}

/* --- Compte-rendu ---------------------------------------------------------- */

.cr-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--carte-bord);
}

.cr-entete__titre {
  margin-right: auto;
  font-size: 15px;
}

.cr-entete__examen {
  font-weight: 400;
  color: var(--texte-attenue);
}

.cr-outils {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* « Modifier » reste enfoncé pendant l'édition du CR (un clic l'applique). */
#modifyBtn[aria-pressed="true"] {
  background: var(--nav-actif);
  color: var(--accent-texte);
}

.taille-texte {
  display: flex;
}

.taille-texte .bouton {
  border-radius: var(--rayon) 0 0 var(--rayon);
  font-size: 13px;
}

.taille-texte .taille-texte__plus {
  margin-left: -1px;
  border-radius: 0 var(--rayon) var(--rayon) 0;
  font-size: 15px;
}

.menu {
  position: relative;
}

.menu__liste {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  border-radius: 8px;
}

.menu__choix {
  min-height: 40px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: var(--rayon);
  color: var(--texte);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.menu__choix:hover,
.menu__choix:focus-visible {
  background: var(--nav-actif);
}

.cr-corps {
  flex: 1;
  padding: 30px 48px;
}

.cr-vide {
  max-width: 34em;
}

/* Le CR : une ligne de texte par élément ; taille réglable (A− / A+). */
.cr {
  max-width: 46em;
  overflow-wrap: anywhere;
}

.cr[data-taille="1"] { font-size: 14px; }
.cr[data-taille="2"] { font-size: 15px; }
.cr[data-taille="3"] { font-size: 16px; }
.cr[data-taille="4"] { font-size: 17.5px; }
.cr[data-taille="5"] { font-size: 19px; }

.cr-ligne {
  margin: 0;
  white-space: pre-wrap;
}

.cr-ligne--titre {
  margin-bottom: 14px;
  font-size: 1.12em;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.cr-ligne--section {
  margin-top: 4px;
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.cr-ligne--sous-titre {
  font-weight: 600;
}

.cr-ligne--vide {
  height: 0.8em;
}

/* Rédaction en cours (flux) : curseur au bout du texte ; outils, pied et
   encart n'apparaissent qu'une fois le CR complet. */
.volet--cr[aria-busy="true"] .cr::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent-texte);
  animation: clignoter 1s steps(2, start) infinite;
}

@keyframes clignoter {
  to {
    visibility: hidden;
  }
}

.cr-edition {
  min-height: 420px;
  font-family: var(--police-cr);
  line-height: 1.75;
  white-space: pre-wrap;
}

/* Surlignage des extraits et repères numérotés (affichage seulement : copie,
   exports et historique gardent le texte brut). */
.surligne {
  background: none;
  color: inherit;
  border-radius: 3px;
}

.surligne--ajout {
  background: var(--surligne-ajout);
  padding: 1px 0;
}

.surligne--defaut {
  border-bottom: 2px dotted var(--surligne-defaut);
  border-radius: 0;
}

.surligne--preciser {
  border-bottom: 2px solid var(--repere-preciser);
  border-radius: 0;
}

.surligne--classification {
  outline: 1px dashed var(--repere-ajout);
  outline-offset: 1px;
}

.surligne--contradiction {
  background: var(--erreur-fond);
  color: var(--erreur-texte);
  outline: 1px solid var(--erreur-bord);
}

.surligne.est-actif {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.cr .repere {
  margin-left: 3px;
}

.repere--contradiction {
  background: var(--erreur-texte);
  color: var(--erreur-fond);
}

.repere--omission {
  background: transparent;
  color: var(--erreur-texte);
  box-shadow: inset 0 0 0 1px var(--erreur-texte);
}

.repere--classification {
  background: transparent;
  color: var(--repere-ajout);
  box-shadow: inset 0 0 0 1px var(--repere-ajout);
}

.cr.sans-reperes .surligne {
  background: none;
  color: inherit;
  border-bottom: 0;
  outline: 0;
}

.cr.sans-reperes .repere {
  display: none;
}

.cr-pied {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--carte-bord);
}

.liens-site__titre,
.cr-types__titre {
  margin-bottom: 6px;
  font-family: var(--police-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

/* « Corriger par une consigne » : champ et bouton côte à côte, puis les
   lignes modifiées (retirées barrées, ajoutées en vert) avant « Appliquer ». */
.correction {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.correction__saisie {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.correction__consigne {
  flex: 1;
  min-width: 0;
  resize: vertical;
}

.correction__apercu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
}

.correction__titre {
  font-family: var(--police-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.correction__diff {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.5;
}

.correction__ligne {
  padding: 2px 8px;
  border-radius: 4px;
}

.correction__ligne del,
.correction__ligne ins {
  text-decoration: none;
}

.correction__ligne--retire {
  background: var(--erreur-fond);
  color: var(--erreur-texte);
}

.correction__ligne--retire del {
  text-decoration: line-through;
}

.correction__ligne--ajoute {
  background: var(--ok-fond);
  color: var(--ok-texte);
}

.correction__ligne--egal,
.correction__ligne--saut {
  color: var(--texte-attenue);
}

/* CR types fournis au modèle : un titre par ligne, encart ambre quand aucun
   ne correspond à l'examen. */
.cr-types__titre {
  font-weight: 400;
}

.cr-types__liste {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
}

.cr-types__note {
  margin-top: 4px;
}

.cr-types__alerte {
  margin-top: 8px;
  font-size: 13px;
}

.cr-types__entete,
.cr-types__ligne {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.cr-types__changer,
.choix-cr-type .bouton {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  font-size: 13px;
}

/* « Changer » : un autre CR type (même région d'abord, ou recherche dans
   toute la base), puis nouvelle génération. */
.choix-cr {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
}

.choix-cr__liste {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
}

.choix-cr__groupe {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choix-cr__legende {
  margin-bottom: 4px;
  padding: 0;
  font-family: var(--police-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.choix-cr__choix {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 2px 6px;
  border-radius: var(--rayon);
  font-size: 13.5px;
  cursor: pointer;
}

.choix-cr__choix:hover {
  background: var(--champ);
}

.choix-cr__choix:has(input:disabled) {
  color: var(--texte-attenue);
  cursor: default;
}

.choix-cr__actuel {
  margin-left: auto;
  font-family: var(--police-mono);
  font-size: 11px;
}

/* Dictée : CR type imposé par « Changer », gardé pour les générations suivantes. */
.choix-cr-type {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
}

.liens-site__liste {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lien-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px 10px;
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
  font-size: 13px;
  text-decoration: none;
}

.lien-site:hover {
  border-color: var(--accent-texte);
}

.lien-site__type {
  font-family: var(--police-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

/* Fiches et calculateurs suggérés pendant la dictée : une page par ligne dans
   le volet de droite (la note d'attente leur cède la place) ; sous la dictée,
   sur téléphone seulement, en étiquettes. */
.verif .liens-site__liste {
  flex-direction: column;
}

.volet--verif[data-suggestions] .verif__vide {
  display: none;
}

/* Calculs tirés des mesures dictées (wash-out, volume) : une carte par calcul,
   résultat dans la police du CR, puis « Ajouter à la dictée ». */
.calculs-dictee__liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calcul-dictee {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
  font-size: 13px;
}

.calcul-dictee__titre {
  font-family: var(--police-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.calcul-dictee__resultat {
  font-family: var(--police-cr);
}

.calcul-dictee__detail,
.calcul-dictee__note {
  font-size: 12px;
  color: var(--texte-attenue);
  overflow-wrap: anywhere;
}

.calcul-dictee__note {
  color: var(--alerte-texte);
}

.calcul-dictee__ajouter {
  align-self: flex-start;
  min-height: 34px;
  margin-top: 4px;
  font-size: 12.5px;
}

/* Avis « correct / à corriger » */
.avis {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avis__ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.avis__titre {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--texte-attenue);
}

.avis__verdicts {
  display: flex;
  gap: 8px;
}

.retour-btn {
  min-height: 36px;
}

.retour-btn[data-verdict="correct"][aria-pressed="true"] {
  background: var(--ok-fond);
  border-color: var(--ok-texte);
  color: var(--ok-texte);
}

.retour-btn[data-verdict="a_corriger"][aria-pressed="true"] {
  background: var(--alerte-fond);
  border-color: var(--alerte-bord);
  color: var(--alerte-texte);
}

.retour-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.avis__pied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.retour-status.est-erreur,
.compteur.est-erreur {
  color: var(--erreur-texte);
}

.barre-valider {
  display: none;
}

/* --- Points à vérifier ----------------------------------------------------- */

.verif {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.relire {
  min-height: 36px;
  color: var(--accent-texte);
}

.verif__statut {
  padding: 8px 12px;
  background: var(--element);
  border-color: var(--carte-bord);
  color: var(--texte-attenue);
  font-size: 12.5px;
}

.verif__statut.est-erreur {
  background: var(--erreur-fond);
  border-color: var(--erreur-bord);
  color: var(--erreur-texte);
}

.verif__liste {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.verif-rubrique {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
}

.verif-rubrique__titre {
  font-size: 13px;
  font-weight: 600;
}

/* CR normal (sans IA) : une case par ligne du CR type, par section et par
   paragraphe ; lignes proposées ou à compléter atténuées tant qu'elles sont décochées. */
.cr-normal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-normal__liste {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cr-normal__liste.est-inactif {
  opacity: 0.55;
}

.cr-normal__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cr-normal__titre {
  font-family: var(--police-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.cr-normal__paragraphe {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cr-normal__ligne {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--police-cr);
  font-size: 13px;
  line-height: 1.5;
}

.cr-normal__ligne .case {
  flex-shrink: 0;
  margin-top: 2px;
}

.cr-normal__ligne:has(.case:not(:checked)) .cr-normal__texte {
  color: var(--texte-attenue);
}

.cr-normal__corps {
  min-width: 0;
}

label.cr-normal__texte {
  cursor: pointer;
}

.cr-normal__etiquette {
  margin-left: 6px;
  font-family: var(--police-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-texte);
}

.cr-normal__condition {
  display: block;
  font-family: var(--police-texte);
  font-size: 12px;
  color: var(--texte-attenue);
}

.cr-normal__blanc {
  display: inline-block;
  width: 6em;
  min-height: 0;
  margin: 0 2px;
  padding: 1px 6px;
  font-size: 13px;
  line-height: 1.5;
}

/* Trois dimensions dans une case (« 45 x 15 x 14 ») ; volume calculé, sans case. */
.cr-normal__blanc--dimensions {
  width: 9em;
}

.cr-normal__calcul {
  font-variant-numeric: tabular-nums;
}

.cr-normal__choix {
  display: inline-block;
  width: auto;
  /* Longues options (« de la carotide commune, du bulbe et… ») : jamais plus large que le volet. */
  max-width: 100%;
  min-height: 0;
  margin: 0 2px;
  padding: 1px 4px;
  font-size: 13px;
}

/* Variantes d'une phrase : état, ajouts, champs et alertes, en retrait sous la phrase. */
.cr-normal__variante {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 2px 0 6px 26px;
  font-family: var(--police-texte);
  font-size: 12.5px;
}

.cr-normal__champs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-left: 26px;
}

.cr-normal__variante > .cr-normal__champ--libelle {
  margin-left: 0;
}

.cr-normal__champ--libelle {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  max-width: 100%;
  min-width: 0;
}

.cr-normal__libelle {
  color: var(--texte-attenue);
}

.cr-normal__ajout .cr-normal__ligne {
  font-family: var(--police-texte);
  font-size: 12.5px;
}

.cr-normal__alerte,
.cr-normal__manque,
.cr-normal__note {
  margin: 0 0 0 26px;
  font-size: 12px;
}

.cr-normal__alerte {
  color: var(--alerte-texte);
}

.cr-normal__manque,
.cr-normal__note {
  color: var(--texte-attenue);
}

.cr-normal__variante > .cr-normal__note {
  margin-left: 0;
}

/* Femme | Homme : CR type selon le sexe (fieldset sans cadre). */
.cr-normal__sexes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}


.cr-normal__sexes .bouton[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent-texte);
}

/* Un point : libellé (lien vers son extrait dans le CR) puis ses actions
   (vu, retirer ou corriger). */
.verif-point {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.verif-point__lien {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 2px 0;
  background: transparent;
  border: 0;
  color: var(--texte);
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
}

button.verif-point__lien {
  cursor: pointer;
}

button.verif-point__lien:hover .verif-point__texte {
  text-decoration: underline;
}

.verif-point .repere {
  flex-shrink: 0;
  vertical-align: baseline;
}

.verif-point__actions {
  display: flex;
  flex-shrink: 0;
  gap: 2px;
}

.verif-action {
  width: 30px;
  min-height: 30px;
  border-color: transparent;
  color: var(--texte-attenue);
}

.verif-action:hover {
  color: var(--texte);
}

.verif-action[aria-pressed="true"] {
  border-color: var(--champ-bord);
  background: var(--nav-actif);
  color: var(--accent-texte);
}

/* Point vu : atténué, plus surligné dans le CR ni compté. */
.verif-point.est-vu .verif-point__texte {
  color: var(--texte-attenue);
}

.verif-point.est-vu .repere {
  background: transparent;
  color: var(--texte-attenue);
  box-shadow: inset 0 0 0 1px var(--champ-bord);
}

.verif__legende {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.verif__legende span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.verif__annuler {
  align-self: flex-start;
  min-height: 34px;
  font-size: 12.5px;
}

.verif-point__corps {
  min-width: 0;
}

.verif-point__raison {
  display: block;
  color: var(--texte-attenue);
  font-size: 12.5px;
}

.verif-point__relu {
  margin-left: 6px;
  font-family: var(--police-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-texte);
}

.verif-ajouter {
  align-self: flex-start;
  min-height: 34px;
  margin-left: 26px;
  font-size: 12.5px;
}

/* Point à préciser : phrase toute prête (police du CR), un champ à la place de
   chaque valeur à fournir, puis « Rajouter ». */
.verif-rajout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 26px;
  padding: 10px 12px;
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
  font-size: 13px;
}

.verif-rajout__variante {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.verif-rajout__choix {
  display: inline-flex;
  flex-shrink: 0;
}

.verif-rajout__phrase {
  font-family: var(--police-cr);
  line-height: 2;
}

.verif-rajout__blanc {
  display: inline-block;
  width: 6em;
  min-height: 0;
  margin: 0 2px;
  padding: 1px 6px;
  font-size: 13px;
  line-height: 1.5;
}

@supports (field-sizing: content) {
  .verif-rajout__blanc {
    width: auto;
    min-width: 5em;
    max-width: 100%;
    field-sizing: content;
  }
}

/* « Remplacer » : la phrase du CR qui part, barrée (police du CR). */
.verif-rajout__apercu {
  margin: 0;
  color: var(--texte-attenue);
  font-size: 12.5px;
}

.verif-rajout__visee {
  font-family: var(--police-cr);
  color: var(--texte);
  text-decoration: line-through;
  text-decoration-color: var(--erreur-texte);
}

.verif-rajout__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.verif-rajout__bouton,
.verif-rajout__dictee {
  min-height: 34px;
  font-size: 12.5px;
}

.verif-rajout__alerte {
  margin-left: 26px;
  color: var(--alerte-texte);
}

.verif__case {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Pages : historique, dashboard, compte --------------------------------- */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page--large {
  max-width: 1100px;
}

.page__titre {
  margin-right: auto;
  font-size: 22px;
}

.page__entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.page__vide {
  padding: 28px 0;
  text-align: center;
}

.bloc {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
}

.formulaire {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.formulaire__deux {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.filtre {
  max-width: 260px;
}

.historique {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.historique__entree {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  color: var(--texte);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.historique__entree:hover {
  border-color: var(--accent-texte);
}

.historique__haut {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.historique__etiquettes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.etiquette-cr {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--nav-actif);
  font-size: 12px;
}

.etiquette-cr--a-corriger {
  background: var(--alerte-fond);
  color: var(--alerte-texte);
}

.etiquette-cr--correct {
  background: var(--ok-fond);
  color: var(--ok-texte);
}

.historique__date {
  font-family: var(--police-mono);
  font-size: 11.5px;
  color: var(--texte-attenue);
}

.historique__demande {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--texte-attenue);
  font-size: 13.5px;
}

.detail {
  margin-top: 8px;
}

.detail__demande {
  padding: 14px 20px 0;
}

.detail__cr {
  padding: 18px 20px;
  font-size: 15.5px;
}

.detail__avis {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--carte-bord);
}

.bouton--danger {
  color: var(--erreur-texte);
}

/* Dashboard */
.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.tuile {
  padding: 14px 16px;
}

.tuile__libelle {
  font-size: 12.5px;
  color: var(--texte-attenue);
}

.tuile__valeur {
  font-size: 24px;
  font-weight: 600;
}

.tuile__detail {
  font-family: var(--police-mono);
  font-size: 11.5px;
  color: var(--texte-attenue);
}

.tableau-defilant {
  overflow-x: auto;
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tableau th,
.tableau td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--carte-bord);
  text-align: left;
  vertical-align: top;
}

.tableau th {
  font-size: 12px;
  font-weight: 500;
  color: var(--texte-attenue);
}

.tableau .sans-retour {
  white-space: nowrap;
}

.tableau .vide {
  color: var(--texte-attenue);
}

.retour-admin {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-top: 8px;
}

.retour-admin__haut {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--police-mono);
  font-size: 11.5px;
  color: var(--texte-attenue);
}

.retour-admin__note {
  white-space: pre-wrap;
}

.retour-admin summary {
  cursor: pointer;
  color: var(--accent-texte);
  font-size: 13px;
}

.retour-admin h4 {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--texte-attenue);
}

.retour-admin pre {
  margin: 4px 0 0;
  white-space: pre-wrap;
  font-family: var(--police-cr);
  font-size: 13px;
}

/* Compte */
.avatar {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--champ-bord);
  border-radius: 50%;
  background: var(--carte);
  color: var(--texte);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
}

.avatar--grand {
  width: 44px;
  height: 44px;
  font-size: 17px;
}

.compte-identite {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.compte-identite > div {
  flex: 1 1 220px;
}

.compte-colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 16px;
}

.preferences .champ {
  max-width: 480px;
}

/* Roue dentée de l'en-tête du téléphone : la barre du bas a déjà ses 5 entrées pour l'administrateur. */
.entete-tel__reglages {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--texte-attenue);
}

.entete-tel__reglages:hover,
.entete-tel__reglages[aria-current="page"] {
  color: var(--texte);
}

/* Préférences : style de rédaction du CR, un groupe de choix par réglage. */
.style-cr {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.style-cr__reglages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.style-cr__titre {
  margin: 0 0 6px;
  font-weight: 600;
}

.style-cr__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
}

.style-cr__exemple {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--carte-bord);
  font-family: var(--police-cr);
  font-size: 13px;
}

/* Préférences : papiers à en-tête de l'export Word. */
.preference {
  display: flex;
  gap: 8px;
  align-items: center;
}

.papiers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Choix de la mise en page : la liste, et une seule feuille A4 réduite, celle qui est cochée. */
.mises-en-page {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mises-en-page__grille {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: start;
  gap: 20px;
}

.mises-en-page__liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.mise-en-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
  cursor: pointer;
}

.mise-en-page:has(input:checked) {
  border-color: var(--accent-texte);
  box-shadow: inset 0 0 0 1px var(--accent-texte);
}

.mise-en-page:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.mise-en-page__tete {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mise-en-page__nom {
  font-weight: 600;
}

/* Exactement la feuille réduite : mêmes réductions que BASE_APERCU (js/choix-mise-en-page.js, test). */
.mise-en-page__cadre {
  display: block;
  justify-self: center;
  box-sizing: content-box;
  width: calc(21cm * 0.7);
  height: calc(29.7cm * 0.7);
  overflow: hidden;
  border: 1px solid var(--carte-bord);
  border-radius: 2px;
}

@media (max-width: 1000px) {
  .mises-en-page__grille {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .mise-en-page__cadre {
    width: calc(21cm * 0.36);
    height: calc(29.7cm * 0.36);
  }
}

@media (max-width: 359px) {
  .mise-en-page__cadre {
    width: calc(21cm * 0.3);
    height: calc(29.7cm * 0.3);
  }
}

.mise-en-page__feuille {
  display: block;
}

.papiers code {
  font-family: var(--police-mono);
}

.papiers__liste {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.papiers__ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  padding: 6px 12px;
  background: var(--champ);
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
}

.papiers__nom {
  flex: 1 1 160px;
  overflow-wrap: anywhere;
}

.papiers__ligne .bouton,
.dialogue .bouton {
  min-height: 44px;
}

/* Préférences : CR types personnels (« Mes CR types »). */
.mes-cr-types__examen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 12px;
  max-width: 720px;
}

.champ.mes-cr-types__texte {
  max-width: none;
  font-family: var(--police-cr);
  font-size: 14px;
}

.mes-cr-types__remplace {
  flex-basis: 100%;
}

.mes-cr-types__apercu {
  flex-basis: 100%;
  margin: 4px 0 0;
  white-space: pre-wrap;
  font-family: var(--police-cr);
  font-size: 13px;
}

/* Sous le CR : mention d'un CR type personnel. */
.cr-types__perso {
  font-family: var(--police-mono);
  font-size: 11px;
  color: var(--texte-attenue);
}

/* Fenêtre d'export (zone patient). */
.dialogue {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  background: var(--carte);
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon-carte);
  color: var(--texte);
}

.dialogue::backdrop {
  background: var(--voile);
}

/* Import de CR types Word (Mes CR types) : fenêtre large, plein écran sur téléphone ;
   une ligne par fichier, en grille sur ordinateur, en carte sur téléphone. */
.dialogue--large {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
}

.import {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.import__lignes {
  margin: 0;
  padding: 0;
  list-style: none;
}

.import__entetes,
.import__ligne {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 6px 12px;
  align-items: start;
}

.import__entetes {
  font-family: var(--police-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--texte-attenue);
}

.import__ligne {
  padding: 10px 0;
  border-top: 1px solid var(--carte-bord);
  font-size: 13.5px;
}

.import__case {
  padding-top: 12px;
}

.import__fichier,
.import__etat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.import__remplace {
  min-width: 0;
  padding-top: 10px;
  overflow-wrap: anywhere;
}

/* Nom sur deux lignes : un titre long reste lisible en entier. */
.import .import__nom {
  min-height: 0;
  padding: 6px 10px;
  resize: none;
  font-size: 13.5px;
  line-height: 1.35;
}

.import .bouton--lien {
  min-height: 32px;
  padding: 0 4px;
}

.import__apercu,
.import__choix {
  grid-column: 2 / -1;
}

.import__apercu {
  max-height: 320px;
  margin: 0;
  padding: 8px 10px;
  overflow-y: auto;
  background: var(--champ);
  border-radius: var(--rayon);
  white-space: pre-wrap;
  font-family: var(--police-cr);
  font-size: 13px;
}

.import__pastille {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.import__pastille--ok {
  background: var(--ok-fond);
  color: var(--ok-texte);
}

.import__pastille--alerte {
  background: var(--alerte-fond);
  color: var(--alerte-texte);
}

.import__pastille--erreur {
  background: var(--erreur-fond);
  color: var(--erreur-texte);
}

.import__pastille--neutre {
  background: var(--champ);
  color: var(--texte-attenue);
}

.import__erreur {
  color: var(--erreur-texte);
}

@media (max-width: 720px) {
  .dialogue--large {
    width: 100vw;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .import__entetes {
    display: none;
  }

  .import__ligne {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .import__remplace,
  .import__etat {
    grid-column: 2;
  }

  .import__remplace {
    padding-top: 0;
  }
}

.champ-et-bouton {
  display: flex;
  gap: 8px;
}

.champ-et-bouton .champ {
  flex: 1;
  min-width: 0;
}

/* --- Connexion ------------------------------------------------------------- */

.auth {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: var(--fond);
}

.auth__boite {
  width: 100%;
  max-width: 448px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
}

/* Largeur de la boîte : le sous-titre de la marque tient sur une ligne. */
.auth__marque {
  justify-content: center;
  margin-bottom: 8px;
  font-size: 28px;
}

.auth__titre {
  font-size: 16px;
  text-align: center;
}

.auth .bouton--lien {
  border: 0;
}

/* --- Message bref ---------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  width: max-content; /* sinon limité à la moitié de l'écran (left: 50 %) */
  max-width: calc(100% - 32px);
  transform: translateX(-50%);
  font-size: 13.5px;
}

.toast__action {
  min-height: 30px;
  margin-left: 8px;
  padding: 0 10px;
  border-color: currentColor;
  color: inherit;
  font-size: 13px;
}

/* --- Téléphone : onglets Dictée / Compte-rendu / À vérifier ---------------- */

@media (max-width: 720px) {
  .vue-generer {
    min-height: 0;
  }

  .choix-cr__choix,
  .cr-types__changer,
  .choix-cr-type .bouton {
    min-height: 44px;
  }

  .onglets-generer {
    display: grid;
    position: sticky;
    top: 56px;
    z-index: 5;
    padding: 0 8px;
  }

  .onglets-generer .repere {
    vertical-align: baseline;
  }

  .volets {
    display: block;
    padding: 12px;
  }

  .volet--dictee,
  .volet--verif {
    min-height: calc(100dvh - 56px - 48px - var(--hauteur-barre-bas) - 24px);
  }

  .vue-generer:not([data-onglet="dictee"]) .volet--dictee,
  .vue-generer:not([data-onglet="cr"]) .volet--cr,
  .vue-generer:not([data-onglet="verif"]) .volet--verif {
    display: none;
  }

  .lignes--app-gauche,
  .lignes--app-droite,
  .halo--app-droite {
    display: none !important;
  }

  .dictee {
    padding: 16px;
  }

  .dictee__texte {
    min-height: 190px;
  }

  .cr-entete {
    padding: 10px 14px;
  }

  /* Stylo seul : la barre d'outils du CR tient sur une ligne (mot gardé pour
     les lecteurs d'écran). */
  #modifyBtn {
    width: 40px;
    padding: 0;
  }

  #modifyBtn .bouton__libelle {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .cr-corps {
    padding: 20px 18px;
  }

  #validateBtn,
  .raccourci {
    display: none;
  }

  .barre-valider:not([hidden]) {
    display: flex;
    position: sticky;
    bottom: calc(var(--hauteur-barre-bas) + env(safe-area-inset-bottom));
    padding: 10px 12px;
    background: var(--barre);
    border-top: 1px solid var(--barre-bord);
    border-radius: 0 0 var(--rayon-carte) var(--rayon-carte);
  }

  .barre-valider .bouton {
    flex: 1;
  }

  .page {
    padding: 20px 12px 32px;
  }

  .toast {
    bottom: calc(var(--hauteur-barre-bas) + 16px);
  }

  /* Phrase à compléter : pas de zoom du navigateur sur le champ (16 px). */
  .verif-rajout__blanc {
    min-height: 36px;
    font-size: 16px;
  }

  /* Cibles tactiles de 44 px. */
  .verif-action,
  .toast__action,
  .verif__annuler,
  .verif-rajout__bouton,
  .verif-rajout__dictee {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Lignes de fond : chaque écran a son motif (celui du téléphone ne s'affiche
   pas sur ordinateur, et inversement). */
@media (min-width: 721px) {
  .lignes--tel-dictee {
    display: none !important;
  }

  /* Sur ordinateur, les suggestions et les calculs sont dans le volet de droite. */
  .suggestions--tel,
  .calculs-dictee--tel {
    display: none;
  }
}

/* --- Impression de la page (le PDF passe par sa propre fenêtre) ------------- */

@media print {
  .volet--dictee,
  .volet--verif,
  .cr-outils,
  .cr-pied,
  .onglets-generer,
  .barre-valider,
  .toast {
    display: none !important;
  }
}
