/* Interface du site pilote (phase 4). Design : doc 07 (paysage, tablette d'abord, boutons ≥ 44 px ;
   #0F1B2D barres, #0B7A6E action principale, #F59E0B Conclure et questions du patient, #F3F6F9 fond hors du box ;
   Inter pour le texte, Space Grotesk pour les titres, servies localement). Sobre : un outil médical, pas de décor. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }

:root {
  --nuit: #0F1B2D; --nuit-2: #1E2E44; --nuit-3: #2A3B55; --vert: #0B7A6E; --vert-fonce: #075C53; --vert-pale: #E6F4F1;
  --ambre: #F59E0B; --ambre-fonce: #B45309; --ambre-pale: #FEF3C7; --fond: #F3F6F9; --blanc: #FFFFFF;
  --texte: #0F1B2D; --texte-2: #4A5A70; --texte-3: #66758A; --bord: #D5DDE6; --bord-2: #E6EBF1; --rouge: #B42318;
  --r-s: 8px; --r: 12px; --r-l: 16px; --ombre: 0 8px 28px rgba(15, 27, 45, .18);
  --titre: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.45; color: var(--texte); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fond); }
body.app { overflow: hidden; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.app #app { height: 100%; }
h1, h2, h3 { font-family: var(--titre); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
.cache { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- boutons : 44 px au moins, états visibles (survol, appui, focus clavier, désactivé) --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--bord); background: var(--blanc); color: var(--texte);
  font-family: inherit; font-weight: 500; font-size: 15px; line-height: 1.2; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background-color .12s, border-color .12s, transform .06s, box-shadow .12s; text-decoration: none; }
.btn:hover { border-color: #AEBBCB; background: #F8FAFC; }
.btn:active { transform: translateY(1px); background: #EEF2F6; }
.btn:focus-visible, .onglet:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(11, 122, 110, .45); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: default; transform: none; }
.btn.principal { background: var(--vert); border-color: var(--vert); color: var(--blanc); font-weight: 600; }
.btn.principal:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn.principal:active { background: #064C45; }
.btn.ambre { background: var(--ambre); border-color: var(--ambre); color: var(--nuit); font-weight: 600; }
.btn.ambre:hover { background: #E8930A; }
.btn.discret { background: transparent; border-color: transparent; color: var(--texte-2); }
.btn.discret:hover { background: rgba(15, 27, 45, .06); }
.btn.grand { min-height: 52px; padding: 0 24px; font-size: 16px; border-radius: var(--r-l); }
.btn.icone { width: 44px; padding: 0; }
.btn svg { flex: none; }

/* --- accueil (hors du box : fond clair) --- */
.ecran { height: 100%; display: flex; flex-direction: column; overflow: auto; }
.barre { flex: none; height: 64px; background: var(--nuit); color: var(--blanc); display: flex; align-items: center; gap: 32px; padding: 0 28px; }
.marque { display: flex; align-items: center; gap: 10px; font-family: var(--titre); font-weight: 700; font-size: 19px; }
.nav { display: flex; gap: 4px; height: 100%; }
.nav a { display: flex; align-items: center; padding: 0 14px; color: #B8C4D4; text-decoration: none; font-size: 15px; border-bottom: 3px solid transparent; min-height: 44px; }
.nav a[aria-current="page"] { color: var(--blanc); border-bottom-color: var(--vert); }
.nav a:hover { color: var(--blanc); }
.accueil > aside { align-self: start; }
.accueil { flex: 1; display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px; padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; align-content: start; }
.carte { background: var(--blanc); border: 1px solid var(--bord-2); border-radius: var(--r-l); padding: 20px; }
.etiquette { font-size: 13px; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: .04em; }
.niveaux { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.niveau { justify-content: flex-start; text-align: left; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; min-height: 56px; }
.niveau small { font-size: 12.5px; color: var(--texte-3); font-weight: 400; }
.niveau[aria-pressed="true"] { border: 2px solid var(--vert); background: var(--vert-pale); color: var(--vert-fonce); padding: 9px 13px; }
.niveau[aria-pressed="true"] small { color: var(--vert-fonce); }
.entete-liste { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.entete-liste h1 { font-size: 28px; }
.sous { font-size: 14px; color: var(--texte-2); }
.patients { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.carte-patient { display: flex; flex-direction: column; gap: 14px; }
.identite { display: flex; gap: 14px; align-items: center; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #DCE4ED; color: var(--texte-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-family: var(--titre); }
.identite b { display: block; font-size: 17px; }
.station-ligne { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border-radius: var(--r);
  background: var(--fond); border: 1px solid transparent; font: inherit; font-size: 15px; color: inherit; text-align: left; width: 100%; }
button.station-ligne { cursor: pointer; background: var(--vert-pale); border-color: #BFE3DC; transition: background-color .12s, transform .06s; }
button.station-ligne:hover { background: #D6EEE9; }
button.station-ligne:active { transform: translateY(1px); }
.station-ligne .action { color: var(--vert-fonce); font-weight: 600; white-space: nowrap; }
.station-ligne.verrou { color: var(--texte-3); }
.station-ligne .meta { font-size: 13px; color: var(--texte-2); display: block; margin-top: 2px; }
.note-bas { margin-top: 16px; font-size: 13px; color: var(--texte-3); }

/* --- fiche d'ouverture --- */
.ouverture { flex: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .9fr); gap: 24px; padding: 28px; max-width: 1180px; width: 100%; margin: 0 auto; align-content: start; }
.ouverture h1 { font-size: 26px; margin-bottom: 4px; }
.lignes-fiche { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px 16px; margin-top: 20px; font-size: 16px; }
.lignes-fiche dt { color: var(--texte-2); font-size: 14px; font-weight: 600; padding-top: 2px; }
.lignes-fiche dd { margin: 0; }
.motif { font-size: 19px; line-height: 1.4; font-style: italic; }
.consigne { margin-top: 20px; padding: 16px 18px; background: var(--fond); border-radius: var(--r); font-size: 15.5px; }
.cote-fiche { display: flex; flex-direction: column; gap: 16px; }
.progression { height: 8px; border-radius: 4px; background: var(--bord-2); overflow: hidden; margin: 10px 0 6px; }
.progression > i { display: block; height: 100%; width: 0; background: var(--vert); transition: width .25s; }
.chargement-texte { font-size: 13.5px; color: var(--texte-2); }
.pastille { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--vert-pale); color: var(--vert-fonce); font-size: 13px; font-weight: 600; }

/* --- box : la scène 3D occupe l'écran, les barres et les panneaux s'ouvrent par-dessus --- */
.box { position: fixed; inset: 0; background: #2b3038; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#scene { position: absolute; inset: 0; }
#scene canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.box-haut { position: absolute; left: 0; right: 0; top: 0; height: 60px; background: rgba(15, 27, 45, .94); color: var(--blanc);
  display: flex; align-items: center; gap: 12px; padding: 0 12px 0 20px; z-index: 5; }
.box-haut .nom { font-weight: 600; font-size: 16px; white-space: nowrap; }
.info { font-size: 14px; color: #B8C4D4; white-space: nowrap; font-variant-numeric: tabular-nums; }
.info b { color: var(--blanc); font-weight: 600; }
.horloge { padding: 6px 10px; border-radius: var(--r-s); background: var(--nuit-2); }
.espace { flex: 1; }
.box-haut .btn.discret { color: #D4DCE6; }
.box-haut .btn.discret:hover { background: rgba(255, 255, 255, .08); }
.box-haut .icone-son { min-width: 44px; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; }
.box-haut .icone-son[data-etat="coupe"] { color: #FCA5A5; background: rgba(185, 28, 28, .22); }

.scope { position: absolute; left: 12px; top: 72px; width: 120px; z-index: 4; background: #0B1220; border: 1px solid #1E2A3D; border-radius: var(--r-l);
  padding: 12px; display: flex; flex-direction: column; gap: 10px; color: var(--blanc); font-variant-numeric: tabular-nums; }
.scope .titre { font-size: 11px; color: #94A3B8; letter-spacing: .08em; font-weight: 600; }
.mesure .lib { font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.mesure .val { font-size: 24px; font-weight: 700; line-height: 1.1; }
.mesure .val small { font-size: 12px; font-weight: 500; opacity: .8; margin-left: 2px; }
.mesure.vide .val { color: #475569 !important; }
.mesure.fc { color: #4ADE80; } .mesure.pa { color: #F87171; } .mesure.fr { color: #FDE047; } .mesure.spo2 { color: #60A5FA; } .mesure.temp { color: #E2E8F0; }
.mesure.pa .val { font-size: 19px; }
.scope .aide { font-size: 11px; color: #94A3B8; line-height: 1.3; }
.mesure.nouvelle .val { animation: eclat 1.2s ease-out; }
@keyframes eclat { 0% { text-shadow: 0 0 14px currentColor; } 100% { text-shadow: none; } }

.menu { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 72px; z-index: 5; background: rgba(15, 27, 45, .95); border-radius: var(--r-l);
  display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.onglet { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--nuit-2); color: var(--blanc); font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer; touch-action: manipulation; transition: background-color .12s, transform .06s; }
.onglet:hover { background: var(--nuit-3); }
.onglet:active { transform: translateY(1px); }
.onglet[aria-pressed="true"] { background: var(--vert); }
.onglet:disabled { opacity: .4; cursor: default; }
.onglet.indice { background: transparent; border-color: #475569; color: #E2E8F0; font-weight: 500; }
.onglet.indice:hover { background: rgba(255, 255, 255, .06); }
.onglet .compte { font-size: 12px; color: #94A3B8; font-weight: 500; }

.panneau { position: absolute; right: 12px; top: 72px; bottom: 96px; width: min(500px, 43vw); z-index: 4; background: var(--blanc); border-radius: var(--r-l);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--ombre); }
.panneau-tete { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--bord-2); min-height: 56px; }
.panneau-tete h2 { font-size: 17px; }
.panneau-tete .etat-modele { font-size: 12.5px; color: var(--texte-3); }
.panneau-corps { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.vide-etape { padding: 24px 20px; color: var(--texte-2); font-size: 15px; }

/* interrogatoire */
.rubriques { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--bord-2); }
.rubrique { padding: 4px 9px; border-radius: 6px; background: var(--fond); color: var(--texte-2); font-size: 12.5px; line-height: 1.35; }
.rubrique.faite { background: var(--vert-pale); color: var(--vert-fonce); }
.rubrique.faite::before { content: '✓ '; }
.rubrique.partielle { background: #EEF7F5; color: var(--vert-fonce); }
.rubrique.partielle::before { content: '◐ '; }
.fil { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; user-select: text; -webkit-user-select: text; }
.fil .debut-fil { color: var(--texte-3); font-size: 14px; text-align: center; margin: auto 0; padding: 12px; }
.bulle { max-width: 86%; padding: 10px 14px; font-size: 15px; line-height: 1.45; border-radius: 14px; }
.bulle.moi { align-self: flex-end; background: var(--vert); color: var(--blanc); border-bottom-right-radius: 4px; }
.bulle.lui { align-self: flex-start; background: var(--fond); border-bottom-left-radius: 4px; }
.bulle.question { align-self: flex-start; background: var(--ambre-pale); border: 1px solid var(--ambre); }
.bulle .qui { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ambre-fonce); margin-bottom: 2px; }
.bulle.note { align-self: center; background: transparent; color: var(--texte-3); font-size: 13px; padding: 2px 8px; }
.question-en-cours { flex: none; margin: 0 12px 10px; padding: 12px 14px; border-radius: var(--r); background: var(--ambre-pale); border: 2px solid var(--ambre); }
.question-en-cours .qui { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ambre-fonce); display: flex; justify-content: space-between; }
.question-en-cours #reste { text-transform: none; font-variant-numeric: tabular-nums; }
.question-en-cours .texte { font-size: 16px; margin: 4px 0 10px; }
.choix-liste { display: flex; flex-direction: column; gap: 6px; }
.choix-liste .btn { justify-content: flex-start; text-align: left; padding: 10px 14px; line-height: 1.35; height: auto; }
.saisie-zone { flex: none; border-top: 1px solid var(--bord-2); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; background: #FBFCFD; }
.propositions { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; }
.question-proposee { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: var(--r); background: var(--fond); }
.question-proposee .btn { flex: 1 1 12em; justify-content: flex-start; text-align: left; padding: 9px 12px; line-height: 1.35; height: auto; font-size: 14.5px; }
.reformuler { color: var(--ambre-fonce); font-style: italic; font-size: 14.5px; padding: 6px 4px; }
.ligne-saisie { display: flex; gap: 8px; align-items: center; }
.champ { flex: 1; min-width: 0; height: 48px; border-radius: var(--r); border: 1px solid var(--bord); padding: 0 14px; font-family: inherit; font-size: 16px; color: var(--texte); background: var(--blanc); }
.champ::placeholder { color: #8795A8; }
.btn.micro[aria-pressed="true"] { background: var(--rouge); border-color: var(--rouge); color: var(--blanc); }
.attitudes { display: flex; flex-wrap: wrap; gap: 6px; }
.attitudes .btn { min-height: 40px; font-size: 14px; padding: 0 12px; }
.aide-saisie { font-size: 12.5px; color: var(--texte-3); }

/* sous-titres de la voix : sur la scène, au-dessus de la barre de menu */
.sous-titre { position: absolute; bottom: 100px; left: 148px; right: calc(min(500px, 43vw) + 36px); z-index: 4; display: flex; justify-content: center; pointer-events: none; }
.box.sans-panneau .sous-titre { right: 148px; }
.sous-titre span { max-width: 640px; background: rgba(11, 18, 32, .86); color: var(--blanc); padding: 10px 16px; border-radius: var(--r); font-size: 18px; line-height: 1.4; text-align: center; transition: opacity .3s; }
.sous-titre span.question { background: rgba(120, 72, 0, .92); box-shadow: inset 0 0 0 2px var(--ambre); }
.sous-titre.vide span { opacity: 0; }

/* bulle flottante (indice, messages) et dialogue modal */
.toast { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 8; width: min(520px, 80vw); background: var(--blanc); border-radius: var(--r-l);
  box-shadow: var(--ombre); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.toast .titre { font-weight: 700; font-family: var(--titre); }
.toast .boutons { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.voile { position: absolute; inset: 0; z-index: 10; background: rgba(15, 27, 45, .55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: var(--blanc); border-radius: var(--r-l); padding: 24px; width: min(520px, 100%); box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 16px; }
.modal h2 { font-size: 20px; }
.modal .boutons { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.attente-3d { position: absolute; inset: 0; z-index: 9; background: #2b3038; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #D4DCE6; font-size: 15px; }
.attente-3d .progression { width: 260px; background: #3A4352; }

/* erreurs (pour les essais sur iPad) */
#erreurs { position: fixed; left: 8px; bottom: 8px; z-index: 50; max-width: 70vw; font: 12px/1.35 ui-monospace, monospace; color: #fff; background: rgba(180, 35, 24, .92); border-radius: 6px; padding: 6px 8px; white-space: pre-wrap; }
#erreurs:empty { display: none; }

/* paysage d'abord : en portrait sur un petit écran, on demande de tourner la tablette */
.tourner { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  .tourner { display: flex; position: fixed; inset: 0; z-index: 60; background: var(--nuit); color: var(--blanc); align-items: center; justify-content: center; text-align: center; padding: 32px; font-size: 18px; }
}
@media (max-width: 1060px) {
  .box-haut .masquable { display: none; }
  .onglet { padding: 0 12px; font-size: 14px; }
  .accueil { grid-template-columns: 230px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* mesures de la frappe (?mesure=dialogue, retour iPad du 04/12) : outil de réglage, hors parcours */
.mesure-dialogue { position: fixed; left: 8px; top: 68px; z-index: 50; pointer-events: none; max-width: 56vw;
  background: rgba(15, 27, 45, .92); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 11px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.mesure-dialogue table { border-collapse: collapse; margin-top: 4px; }
.mesure-dialogue th, .mesure-dialogue td { padding: 1px 6px 1px 0; text-align: left; white-space: nowrap; }

/* --- étape B : examen, examens complémentaires, dossier --- */
.panneau .bloc { padding: 12px 16px; border-bottom: 1px solid var(--bord-2); display: flex; flex-direction: column; gap: 8px; }
.panneau .bloc:last-child { border-bottom: none; }
.btn.petit { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn[aria-pressed="true"] { background: var(--vert); border-color: var(--vert); color: var(--blanc); }
.btn.fait { background: var(--vert-pale); border-color: var(--vert-pale); color: var(--vert-fonce); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.bascule { display: flex; gap: 4px; }
.grille-outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.liste-zones-boutons, .liste-consignes { display: flex; flex-direction: column; gap: 6px; }
.liste-zones-boutons .btn, .liste-consignes .btn { justify-content: flex-start; text-align: left; height: auto; padding: 10px 14px; line-height: 1.35; }
.btn.consigne { font-size: 14.5px; }
.message-examen { color: var(--ambre-fonce); font-size: 15px; }
.constate { font-size: 15px; line-height: 1.45; }
.compteur { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
#en-cours { background: #FBFCFD; }
.sous-onglets { flex: none; display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--bord-2); }
.sous-onglet { min-height: 44px; padding: 0 16px; border: none; background: transparent; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--texte-2);
  border-bottom: 3px solid transparent; cursor: pointer; }
.sous-onglet[aria-selected="true"] { color: var(--vert-fonce); border-bottom-color: var(--vert); }
.liste-examens { display: flex; flex-direction: column; }
.ligne-examen { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--bord-2); font-size: 15px; }
.carte-examen { border: 1px solid var(--bord-2); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14.5px; line-height: 1.45; }
.tete-examen { display: flex; align-items: center; justify-content: space-between; }
.image-examen { width: 100%; display: block; background: #000; border-radius: 6px; }
.trace { overflow-x: auto; background: #fff; }
.trace svg { max-width: none; }
.choix-radio { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r); background: var(--fond); font-size: 14.5px; min-height: 44px; }
.zone-texte { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.4; }
.liste-soins { display: flex; flex-direction: column; gap: 8px; }
.liste-soins .btn { justify-content: space-between; min-height: 52px; font-size: 16px; }
.liste-dossier { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.4; }
.liste-dossier li { display: flex; gap: 10px; }
.liste-dossier .heure { flex: none; color: var(--texte-3); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 1px; }
/* message du stéthoscope (position, aide à l'installation) : sur la scène */
#message-foyer { position: absolute; left: 50%; bottom: 110px; transform: translateX(-50%); width: min(480px, 60%); z-index: 6; background: var(--blanc);
  border-radius: var(--r-l); box-shadow: var(--ombre); padding: 14px 16px; font-size: 15px; }
#message-foyer p { margin: 0 0 10px; }
#message-foyer .boutons { display: flex; flex-wrap: wrap; gap: 8px; }
#message-foyer button { flex: 1 1 200px; min-height: 44px; border-radius: var(--r); border: 1px solid var(--vert); background: var(--vert); color: var(--blanc); font: inherit; font-weight: 600; }
#message-foyer button.discret { flex: 0 0 90px; background: transparent; color: var(--texte-2); border-color: var(--bord); }

/* vues de la caméra et zoom (retour iPad du 04/12, F) */
.puces.vues .zoom { display: inline-flex; gap: 6px; margin-left: auto; }
.puces.vues .zoom .btn { min-width: 44px; font-size: 20px; font-weight: 600; }
#message-vue:empty { display: none; }
#message-vue { margin-top: 8px; }
#poses-bloc .btn { border-color: var(--ambre, #c97a00); }

/* Conclure, correction, mini-DP, pause (points 6 et 7 de la phase 4) */
.modal.conclusion { max-width: 720px; width: calc(100% - 32px); max-height: calc(100dvh - 48px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.modal.conclusion fieldset { border: 0; padding: 0; margin: 6px 0 0; }
.modal.conclusion textarea { width: 100%; }
.choix-liste { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.choix-case, .choix-radio { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--bord-2); border-radius: var(--r); background: var(--blanc); cursor: pointer; }
.choix-case input, .choix-radio input { width: 20px; height: 20px; flex: none; }
.ligne-diff { display: flex; flex-direction: column; gap: 6px; }
.ligne-diff .argument { height: 44px; }
.resultats { background: var(--fond); }
.resultats-corps { width: 100%; max-width: 860px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 14px; }
.resultats .carte ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.note-totale .note { font-size: 44px; font-family: var(--titre); margin: 4px 0; }
.note-totale .note b { color: var(--vert); }
.tete-partie { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tete-partie .points { font-weight: 700; }
.resultats ul.items { list-style: none; padding: 0; }
.items .item { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid var(--bord-2); }
.items .item .pts { color: var(--texte-2); font-variant-numeric: tabular-nums; }
.items .fait .statut { color: var(--vert); } .items .manque .statut { color: var(--rouge); } .items .tard .statut, .items .partiel .statut { color: var(--ambre-fonce); }
.source { display: block; font-size: 12.5px; color: var(--texte-3); margin-top: 2px; }
.penalite, .carte.penalites li { color: var(--rouge); }
.carte.grave { border-color: #F4C7C3; background: #FEF3F2; }
.frise-liste { list-style: none; padding: 0 !important; border-left: 3px solid var(--bord); margin-left: 6px !important; }
.frise-liste li { display: flex; gap: 10px; padding-left: 12px; position: relative; }
.frise-liste li::before { content: ''; position: absolute; left: -7px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--texte-3); }
.frise-liste li.communication::before { background: #6366F1; } .frise-liste li.interrogatoire::before { background: var(--vert); }
.frise-liste li.examen::before { background: #0EA5E9; } .frise-liste li.examens_complementaires::before, .frise-liste li.interpretation::before { background: var(--ambre); }
.frise-liste li.erreur { color: var(--rouge); }
.frise-liste .t { flex: none; width: 44px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.qrm { border: 1px solid var(--bord-2); border-radius: var(--r); padding: 12px; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.qrm legend { padding: 0 4px; }
.qrm .choix-case.bonne:has(input:disabled) { border-color: var(--vert); background: var(--vert-pale); }
.note-dp { font-weight: 700; font-size: 18px; }
.resultats .boutons.bas { justify-content: center; }

/* A1 : préparation du box au-dessus de tout (rien n'est touchable avant) ; son bloqué par la tablette */
.attente-3d.echec { background: rgba(43, 48, 56, .85); }
.activer-son { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); z-index: 8; min-height: 48px; padding: 0 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }

/* Test iPad n° 3 : page de note = écran 6 de la maquette (doc 07) ; Mini-DP et Correction et cours en pages, « Retour à la note » */
.resultats-corps { max-width: 1180px; padding: 24px 32px 40px; }
.page-colonne { max-width: 860px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.haut-page { display: flex; }
.page-note { display: flex; gap: 24px; align-items: flex-start; }
.carte-blanche { background: var(--blanc); border-radius: 16px; }
.conclusion-etudiant { width: 360px; flex: none; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.titre-conclusion { font-size: 13px; letter-spacing: .08em; color: var(--vert); }
.etiquette-champ { font-size: 13px; color: var(--texte-2); }
.champ-lu { min-height: 42px; border-radius: 10px; border: 1px solid #CBD5E1; padding: 10px 12px; font-size: 15px; line-height: 1.35; background: var(--blanc); overflow-wrap: anywhere; }
.champ-lu.haut { min-height: 72px; font-size: 14px; }
.champ-lu .vide { color: var(--texte-3); }
.rappel-conclure { font-size: 12px; color: var(--texte-2); line-height: 1.4; }
.note-droite { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bandeau-note { background: var(--nuit); color: var(--blanc); border-radius: 16px; padding: 20px 24px; display: flex; align-items: center; gap: 24px; }
.bandeau-note .note { font-family: var(--titre); font-size: 56px; font-weight: 700; line-height: 1; white-space: nowrap; margin: 0; }
.bandeau-note .note b { color: var(--blanc); font-weight: 700; }
.bandeau-note .note .sur { font-size: 24px; color: #94A3B8; }
.bandeau-texte { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.bandeau-texte b { font-size: 18px; } .bandeau-texte span { font-size: 14px; color: #B8C4D4; }
.pilule-station { padding: 8px 12px; border-radius: 10px; background: #134E48; color: #5EEAD4; font-size: 14px; font-weight: 600; white-space: nowrap; }
.deux-cartes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-parties, .a-retenir { padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.detail-parties .sommaire-partie { display: flex; justify-content: space-between; gap: 12px; padding: 0; border: 0; }
.a-retenir { line-height: 1.4; }
.a-retenir ul { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: column; gap: 9px; }
.a-retenir li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.a-retenir .ic { margin-top: 2px; }
.retenir-rouge { color: #B91C1C; } .retenir-ambre { color: #B45309; } .retenir-vert { color: var(--vert); } .retenir-gris { color: var(--texte-2); } .retenir-bonus { color: #0F766E; }
.frise-note { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.frise-note > b { font-size: 14px; }
.frise-ligne { position: relative; height: 56px; margin: 0 10px 0 0; }
.frise-ligne .trait { position: absolute; left: 0; right: -10px; top: 20px; height: 4px; background: #E2E8F0; border-radius: 2px; }
.frise-ligne .pt { position: absolute; top: 12px; width: 20px; height: 20px; border-radius: 10px; transform: translateX(-2px); }
.frise-ligne .pt.vert { background: var(--vert); } .frise-ligne .pt.ambre { background: var(--ambre); } .frise-ligne .pt.nuit { background: var(--nuit); }
.frise-ligne .lib { position: absolute; top: 38px; font-size: 12px; color: var(--texte-2); white-space: nowrap; }
.frise-ligne .lib.ambre { color: #B45309; }
.trois-boutons { display: flex; gap: 12px; }
.trois-boutons .btn.grand { flex: 1; min-height: 52px; border-radius: 12px; font-weight: 600; font-size: 16px; border-color: #CBD5E1; }
.trois-boutons .btn.principal { border-color: transparent; }
.trois-boutons .btn.grand svg { margin-right: 6px; vertical-align: -3px; }
.trois-boutons + .trois-boutons { margin-top: 10px; }
.items .item.bonus-possible .statut { color: #0F766E; font-weight: 700; }
.qrm .choix-case.fausse:has(input:disabled) { border-color: #F4C7C3; background: #FEF3F2; }
.reponse-qrm { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 10px; background: var(--fond); }
.reponse-qrm.juste b:first-child { color: var(--vert); } .reponse-qrm.moyen p:first-child b { color: #B45309; } .reponse-qrm.faux p:first-child b { color: #B91C1C; }
@media (max-width: 980px) {
  .page-note { flex-direction: column; } .conclusion-etudiant { width: 100%; }
  .resultats-corps { padding: 16px; }
}
@media (max-width: 700px) {
  .deux-cartes { grid-template-columns: 1fr; } .bandeau-note { flex-wrap: wrap; } .trois-boutons { flex-direction: column; }
}

/* B1 : rapport de l'auto-test (?autotest=1) ; réduit pendant le passage pour ne pas cacher le patient */
.autotest { position: fixed; z-index: 70; left: 50%; top: 6px; transform: translateX(-50%); width: min(980px, 96vw); background: var(--blanc); color: var(--texte);
  border-radius: var(--r); box-shadow: var(--ombre); padding: 8px 12px; font-size: 13px; }
.tete-autotest { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lignes-autotest { list-style: none; margin: 8px 0 0; padding: 0; max-height: 84vh; overflow: auto; columns: 2 420px; column-gap: 16px; }
.lignes-autotest li { break-inside: avoid; padding: 1px 0; line-height: 1.3; }
.lignes-autotest .vert { color: var(--vert-fonce); } .lignes-autotest .rouge { color: var(--rouge); font-weight: 600; } .lignes-autotest .info { color: var(--texte-3); }
.lignes-autotest .s { display: inline-block; min-width: 22px; color: var(--texte-3); }
.autotest.reduit .lignes-autotest { display: none; } .autotest.reduit { width: auto; }
/* synthèse de fin : tableau par session + rouges ; le détail ligne par ligne seulement sur demande */
.autotest .synthese-autotest:empty { display: none; }
.autotest:has(.synthese-autotest:not(:empty)) .lignes-autotest { display: none; }
.autotest.avec-detail .lignes-autotest { display: block; }
.table-autotest { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 13px; }
.table-autotest th, .table-autotest td { border-bottom: 1px solid var(--bord-2); padding: 4px 6px; text-align: left; white-space: nowrap; }
.table-autotest th { color: var(--texte-3); font-weight: 600; white-space: normal; }
.table-autotest .vert, .synthese-autotest .vert { color: var(--vert-fonce); } .table-autotest .rouge { color: var(--rouge); font-weight: 600; }
.rouges-autotest { margin: 4px 0 8px; padding-left: 18px; color: var(--rouge); } .nav-autotest { margin: 4px 0; color: var(--texte-3); font-size: 12px; }
