/* EMS Formation : complète app.css (thèmes clair / sombre, marque EMS ou Key Code). */
@font-face { font-family: "Inter EMS"; src: url("../fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter EMS"; src: url("../fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* marque Key Code (partenaire) */
body[data-brand="keycode"] { --brand: #2f74c8; --brand-text: #5b9bea; --brand-soft: rgba(47, 116, 200, .18); --bg: #090d13; --panel: #10161f; --panel-2: #161e2a; --panel-3: #1d2734; --line: #1f2a38; --line-strong: #33425a; }
body[data-brand="keycode"][data-theme="light"] { --brand: #12508f; --brand-text: #12508f; --brand-soft: #e3edf9; --bg: #eef2f7; --panel: #fff; --panel-2: #f4f7fb; --panel-3: #e9eef5; --line: #dbe3ee; --line-strong: #bccadb; }

body.lms .side-app { text-transform: none; letter-spacing: 0; }
.lang-switch { display: flex; gap: 4px; justify-content: center; }
.lang-switch button { border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted); border-radius: 6px; padding: 3px 8px; font-size: 11px; font-weight: 700; cursor: pointer; }
.lang-switch button.on { background: var(--brand-soft); color: var(--ink); border-color: var(--brand); }
.side-foot .lang-switch { justify-content: flex-start; }

/* accueil */
.lms-banner { display: flex; align-items: center; gap: 14px; background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.lms-banner.soft { background: var(--panel); border-color: var(--line); }
.lms-banner svg { width: 26px; height: 26px; color: var(--brand-text); }
.lms-course h3 { font-size: 16px; }
.lms-code { display: inline-block; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 6px; }

/* modules */
.lms-mods { display: flex; flex-direction: column; gap: 8px; }
.lms-mod { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
.lms-mod.locked { opacity: .6; }
.lms-mod-kind { flex: none; width: 92px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 5px 6px; border-radius: 6px; background: var(--panel-3); color: var(--muted); }
.lms-mod-kind.cours { background: var(--brand-soft); color: var(--brand-text); }
.lms-mod-kind.note { background: var(--warn-soft); color: var(--warn); }
.lms-mod-kind.preparation { background: var(--info-soft); color: var(--info); }

/* listes simples */
.lms-list { display: flex; flex-direction: column; }
.lms-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.lms-row:last-child { border-bottom: 0; }
.lms-row > svg { color: var(--muted); }

/* questionnaires */
.lms-q { padding: 14px 0; border-bottom: 1px solid var(--line); }
.lms-q:last-of-type { border-bottom: 0; }
.lms-q-title { font-weight: 600; margin-bottom: 8px; }
.lms-stars button { border: 0; background: none; font-size: 30px; line-height: 1; color: var(--line-strong); cursor: pointer; padding: 0 2px; }
.lms-stars button.on { color: var(--warn); }
.lms-opt { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.lms-opt input { width: 17px; height: 17px; accent-color: var(--brand); }

/* émargement */
.lms-sign canvas { max-width: 100%; }

/* messages */
.lms-msg { max-width: 78%; margin: 4px 0; align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px 12px 12px 4px; padding: 8px 12px; }
.lms-msg.me { align-self: flex-end; background: var(--brand-soft); border-color: transparent; border-radius: 12px 12px 4px 12px; }
.lms-msg-head { font-size: 11px; color: var(--faint); margin-bottom: 2px; }
.lms-shell .chat-log { flex: 1; }

/* assistant */
.ai-card { display: flex; flex-direction: column; height: calc(100vh - 150px); padding: 0; overflow: hidden; }
.ai-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg.user { justify-content: flex-end; }
.ai-msg .avatar { background: var(--brand); color: #fff; }
.ai-bubble { max-width: 80%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.ai-msg.user .ai-bubble { background: var(--brand-soft); border-color: transparent; }
.ai-text p { margin: 0 0 8px; }
.ai-text p:last-child { margin-bottom: 0; }
.ai-text ul { margin: 0 0 8px; padding-left: 20px; }
.ai-cite { display: inline-block; font-size: 10px; font-weight: 700; background: var(--brand); color: #fff; border-radius: 4px; padding: 0 4px; margin: 0 1px; vertical-align: super; cursor: help; }
.ai-sources { margin-top: 8px; font-size: 12px; }
.ai-sources summary { cursor: pointer; color: var(--muted); }
.ai-source { margin-top: 6px; padding-left: 8px; border-left: 2px solid var(--line-strong); }

/* lecteur de module */
.lms-player { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.lms-p-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); color: var(--ink); }
.lms-p-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lms-p-sub { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.lms-p-state { display: flex; gap: 6px; }
.lms-player iframe { flex: 1; border: 0; width: 100%; background: #fff; }
.lms-player.chromeless .lms-p-bar { display: none; }
body.lms-playing .toasts { z-index: 90; }

/* suivi (formateur) */
.lms-matrix th.num { min-width: 52px; }

/* téléphone et tablette : menu en tiroir (bouton ☰ de l'en-tête) ; téléphone : barre d'onglets en bas */
.lms-menu-btn, .lms-voile, .lms-tabs { display: none; }
.lms-plus-groupe { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-s, 8px); overflow: hidden; margin-bottom: 10px; }
.lms-plus-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; text-align: left; font-size: 15px; cursor: pointer; }
.lms-plus-row:last-child { border-bottom: 0; }
.lms-plus-row svg { width: 20px; height: 20px; color: var(--faint); }
.lms-plus .me { display: flex; align-items: center; gap: 10px; }
.lms-plus .me > div:last-child { display: block !important; }
.lms-plus .lang-switch { justify-content: flex-start; }
@media (max-width: 900px) {
  .lms-shell { grid-template-columns: 1fr; }
  .lms-shell .side { display: none; }
  .lms-menu-btn { display: inline-flex; flex: 0 0 auto; margin-right: 8px; }
  .lms-shell .topbar { align-items: center; }
  .lms-shell.menu-ouvert .side { display: flex; position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 200; overflow-y: auto; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .lms-shell.menu-ouvert .lms-voile { display: block; position: fixed; inset: 0; z-index: 199; background: rgba(0,0,0,.4); }
  /* le tiroir ouvert garde le nom des rubriques (app.css réduit le menu aux icônes sous 900 px) */
  .lms-shell .side .side-app, .lms-shell .side .nav-item > span:not(.badge), .lms-shell .side .me > div:last-child, .lms-shell .side .sync span { display: initial; }
  .lms-shell .side .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .lms-shell .side .side-foot { align-items: stretch; padding: 12px; }
  .lms-shell .side .side-actions { flex-direction: row; }
  .lms-shell .side .side-foot .sync { font-size: 12px; justify-content: flex-start; }
  .ai-bubble { max-width: 95%; }
}
@media (max-width: 600px) {
  .lms-shell .grid.g2, .lms-shell .grid.g3 { grid-template-columns: 1fr; }
  .lms-shell .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* chiffres clés : 2 × 2 plutôt qu'empilés */
}
@media (max-width: 760px) {
  /* téléphone : plus de tiroir, une barre d'onglets en bas avec le nom de chaque rubrique */
  .lms-shell .lms-menu-btn, .lms-shell.menu-ouvert .side, .lms-shell.menu-ouvert .lms-voile { display: none; }
  .lms-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--panel); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); height: calc(60px + env(safe-area-inset-bottom)); }
  .lms-tab { flex: 1; min-width: 0; border: 0; background: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; position: relative; cursor: pointer; padding: 0 2px; }
  .lms-tab > span:not(.badge) { max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-align: center; line-height: 1.15; font-size: 10.5px; }   /* libellé sur 2 lignes plutôt que « Mes docum… » */
  .lms-tab svg { width: 23px; height: 23px; }
  .lms-tab.on { color: var(--brand-text, var(--brand)); }
  .lms-tab .badge.count { position: absolute; top: 5px; left: calc(50% + 6px); font-size: 10px; padding: 0 5px; }
  .lms-shell .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .lms-shell .topbar { padding: 12px 14px 8px; }
  .lms-shell .topbar h1 { font-size: 19px; }
  /* en-tête : titre et raccourcis des logiciels sur la 1re ligne, actions de l'écran en dessous, alignées à gauche */
  .lms-shell .topbar { flex-wrap: wrap; row-gap: 8px; }
  .lms-shell .topbar > div:not(.topbar-actions):not(.raccourcis-apps) { flex: 1 1 0; min-width: 0; }
  .lms-shell .topbar .raccourcis-apps { order: 1; margin-left: auto; border-left: 0; padding-left: 0; }
  .lms-shell .topbar .topbar-actions { order: 2; flex: 1 1 100%; width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: wrap; }
  .lms-shell .content { padding: 12px 12px 24px; }
}

/* Réglages dans la barre latérale (langue, brouillage) et sur l'écran de connexion */
.lms-reglages { display: flex; flex-direction: column; gap: 4px; }
.lms-reglages .lms-reglage-titre { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.lms-reglages select.input { font-size: 12px; padding: 4px 8px; }

/* Onglet « Machines » du formateur (js/lms/machines.js) : mosaïque des écrans en direct */
.mach-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 14px; }
.mach-tuile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.mach-tuile:hover { border-color: var(--brand); }
.mach-tuile.on { border-color: var(--ok); }
.mach-tuile.ko { cursor: default; opacity: .75; }
.mach-ecran { aspect-ratio: 16 / 10; background: #000; display: flex; align-items: center; justify-content: center; }
.mach-ecran video { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.mach-pied { display: flex; align-items: center; gap: 8px; padding: 8px 10px; min-width: 0; }
.mach-pied b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mach-etat { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .mach-grille { grid-template-columns: 1fr; } }
/* la protection des cours bloque la souris sur les vidéos : la prise en main d'une machine doit, elle, la recevoir */
.lms-protege .bd-fenetre .bd-video { pointer-events: auto; }
/* téléphone, tablette : le doigt pilote la machine (appui = clic, glisser = déplacer) au lieu de faire défiler ou zoomer la page */
.bd-fenetre .bd-video { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* lecteur : navigation d'un module à l'autre (précédent, liste, suivant) */
.lms-p-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.lms-p-nav:empty { display: none; }
.lms-p-select { max-width: 260px; padding: 4px 8px; height: 30px; font-size: 13px; }
@media (max-width: 760px) {
  .lms-p-bar { flex-wrap: wrap; gap: 6px; padding: 6px 10px; }
  .lms-p-nav { order: 5; flex: 1 1 100%; }
  .lms-p-select { flex: 1; max-width: none; }
}
/* plafond du formateur : ligne du module où il en est, modules verrouillés côté élève */
.lms-plafond-ligne td { background: var(--brand-soft); }
.lms-lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; text-align: right; }
.lms-lock svg { width: 14px; height: 14px; flex: 0 0 auto; }
.lms-msg-ferme { display: flex; align-items: center; gap: 6px; }
.lms-msg-ferme svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* bulle de l'assistant (élève) : au-dessus de tous les écrans et du lecteur de module */
body.vue-assistant .ai-bulle { display: none; }
.ai-bulle { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.ai-bulle > * { pointer-events: auto; }
.ai-bulle-btn { width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); cursor: pointer; }
.ai-bulle-btn svg { width: 26px; height: 26px; }
/* conduite de la formation (js/conduite.js) : minuteur, alerte de pause, déroulé du jour */
.cd-tete { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 10px; }
.cd-chrono { border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 240px; background: var(--panel-2); }
.cd-chrono .cd-label { font-size: 13px; color: var(--muted, #8a93a0); }
.cd-chrono .cd-temps { font-size: 40px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-chrono .cd-sous { font-size: 12px; color: var(--muted, #8a93a0); }
.cd-chrono.bientot { border-color: #e0a100; } .cd-chrono.bientot .cd-temps { color: #e0a100; }
.cd-chrono.depasse { border-color: var(--brand); } .cd-chrono.depasse .cd-temps { color: var(--brand); }
.cd-chrono.pause .cd-temps { color: #e0a100; }
.cd-objectif { flex: 1; min-width: 220px; font-size: 13px; }
.cd-alerte { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 1px solid #e0a100; background: rgba(224, 161, 0, .12); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
.cd-alerte.maintenant { border-color: var(--brand); background: rgba(246, 0, 0, .10); }
.cd-liste { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cd-ligne { display: flex; gap: 10px; align-items: center; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.cd-ligne:last-child { border-bottom: 0; }
.cd-ligne .cd-heure { font-variant-numeric: tabular-nums; color: var(--muted, #8a93a0); min-width: 46px; }
.cd-ligne.pause { background: rgba(224, 161, 0, .08); font-style: italic; }
.cd-ligne.fait { opacity: .55; }
.cd-ligne.actif { background: rgba(246, 0, 0, .10); font-weight: 600; }
/* questions toutes prêtes de la bulle d'aide à l'inscription */
.ai-bulle-pistes { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.ai-bulle-piste { border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; text-align: left; }
.ai-bulle-piste:hover { border-color: var(--brand); }
.ai-bulle.open .ai-bulle-btn { background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); }
.ai-bulle-panel { width: min(380px, calc(100vw - 24px)); height: min(520px, calc(100vh - 110px)); background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.ai-bulle-panel[hidden] { display: none; }
.ai-bulle-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ai-bulle-ctx { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-bulle-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-bulle-log .ai-bubble { max-width: 92%; }
.ai-bulle-log p { margin: 0 0 6px; }
.ai-bulle-log p:last-child { margin-bottom: 0; }
.ai-bulle-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.ai-bulle-input textarea { flex: 1; resize: none; min-height: 40px; }
body.lms-playing .ai-bulle { bottom: 14px; right: 14px; }
@media (max-width: 760px) {
  .ai-bulle { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.lms-playing .ai-bulle { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .ai-bulle-panel { height: min(480px, calc(100vh - 170px)); }
}
body.ai-bulle-on .lms-shell .content { padding-bottom: 84px; }

/* Onglet « Projection » du formateur (js/lms/projection.js) : écrans en vignettes, grand aperçu, barre des sources */
.pj { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pj .pj-carte { padding: 14px; min-width: 0; margin: 0; }
.pj-machines.pj-carte { padding: 14px; min-width: 0; margin-top: 14px; }
.pj-carte-tete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; min-width: 0; }
.pj-carte-tete h3 { margin: 0; font-size: 15px; }
.pj-carte-tete .faint { font-size: 12px; }
.pj-ecrans { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pj-ecran { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; text-align: left; padding: 10px 12px; min-height: 76px;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--radius); color: var(--ink); cursor: pointer; font: inherit; transition: border-color .15s, transform .1s; }
.pj-ecran:hover { border-color: var(--line-strong); }
.pj-ecran:active { transform: scale(.98); }
.pj-ecran.on { border-color: var(--brand); background: var(--brand-soft); }
.pj-ecran.off { opacity: .8; }
.pj-ecran.flash { animation: pj-flash .6s ease; }
@keyframes pj-flash { 0% { box-shadow: 0 0 0 0 var(--brand); } 100% { box-shadow: 0 0 0 10px transparent; } }
.pj-ecran-num { position: absolute; top: 8px; right: 10px; font: 700 11px/1 system-ui, sans-serif; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 4px; padding: 3px 5px; }
.pj-ecran-num:empty { display: none; }
.pj-ecran-nom { display: flex; align-items: center; gap: 6px; max-width: calc(100% - 30px); min-width: 0; }
.pj-ecran-nom svg { width: 16px; height: 16px; flex: none; }
.pj-ecran-nom b, .pj-ecran-quoi { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pj-ecran-etat { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pj-ecran-quoi { font-size: 12px; color: var(--muted); }
.pj-ecran.on .pj-ecran-quoi { color: var(--ink); }
.pj-ecran-vide { grid-column: 1 / -1; font-size: 12px; }
/* écrans indépendants (1.91.20) : image de ce qu'affiche chaque écran, ses commandes, renommer, copier */
.pj-ecrans { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pj-ecran { padding: 8px; gap: 5px; }
.pj-ecran:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pj-mini-cadre { position: relative; width: 100%; }
.pj-mini { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-s); overflow: hidden; display: flex; align-items: center; justify-content: center; color: #aab0b9; }
.pj-mini > img, .pj-mini > video { width: 100%; height: 100%; object-fit: contain; }
.pj-mini > canvas { max-width: 100%; max-height: 100%; background: #fff; }
.pj-mini .pj-apercu-web { transform-origin: 0 0; }
.pj-mini-mot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; font-size: 11px; text-align: center; max-width: 100%; }
.pj-mini-mot svg { width: 22px; height: 22px; opacity: .8; }
.pj-mini-mot span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-mini-cadre .pj-ecran-num { top: 6px; right: 6px; color: #fff; background: rgba(0,0,0,.6); border-color: rgba(255,255,255,.35); }
.pj-mini-direct { position: absolute; top: 9px; left: 8px; }
.pj-ecran-tete { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; }
.pj-ecran-tete .pj-ecran-nom { flex: 1; max-width: none; }
.pj-ecran-outil { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; padding: 0; }
.pj-ecran-outil svg { width: 15px; height: 15px; }
.pj-ecran-outil:hover { color: var(--ink); border-color: var(--line-strong); background: var(--panel); }
.pj-ecran-etat span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pj-ecran-etat { max-width: 100%; }
.pj-ecran-cmd { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: 100%; }
.pj-ecran-cmd .btn.small { padding: 4px 8px; min-height: 28px; font-size: 12px; }
.pj-ecran-cmd .btn.on { border-color: var(--brand); background: var(--brand-soft); }
.pj-ecran-cmd .pj-stop { color: var(--bad); }
.pj-ecran-cmd .pj-ecran-outil { margin-left: auto; }
.pj-copie-liste { display: flex; flex-direction: column; gap: 6px; }
.pj-copie-liste .btn { justify-content: flex-start; }
.pj-ajout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pj-ajout-lien { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pj-qr { width: 150px; height: 150px; flex: none; background: #fff; border-radius: 8px; padding: 4px; }
.pj-qr:empty { display: none; }
.pj-qr svg { width: 100%; height: 100%; display: block; }
.pj-adresse { font-size: clamp(22px, 3vw, 30px); font-weight: 700; letter-spacing: .02em; margin: 6px 0; word-break: break-all; color: var(--ink); }
.pj-ajout-code { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj .pj-code-saisie, .pj-code-saisie { font-size: 26px; font-weight: 700; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; max-width: 220px; }
.pj-ajout-res:empty { display: none; }
@media (max-width: 720px) { .pj-ajout { grid-template-columns: minmax(0, 1fr); } .pj-qr { width: 120px; height: 120px; } }
.pj-principal { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1180px) { .pj-principal { grid-template-columns: minmax(0, 1fr); } }
.pj-apercu-titre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 100%; font-size: 15px; }
.pj-apercu { position: relative; }
.pj-apercu-ecran { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius-s); overflow: hidden; display: flex; align-items: center; justify-content: center; color: #c9ced6; }
.pj-apercu-ecran > img, .pj-apercu-ecran > video { width: 100%; height: 100%; object-fit: contain; }
.pj-apercu-ecran > canvas { max-width: 100%; max-height: 100%; background: #fff; }
.pj-apercu-vide { text-align: center; padding: 16px; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pj-apercu-vide p { margin: 0; }
.pj-apercu-vide .faint { font-size: 12px; color: #9aa1ab; }
/* aperçu tactile, téléphone : l'écran de 16/9 serait trop bas pour les boutons d'ouverture */
@media (max-width: 560px) { .pj-apercu-ecran:has(.pj-apercu-vide .btn) { aspect-ratio: auto; min-height: 200px; } }
.pj-apercu-web { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; overflow: hidden; transform-origin: 0 0; background: #fff; pointer-events: none; }
.pj-apercu-web iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 720px; border: 0; background: #fff; }
.pj-apercu-tag { position: absolute; left: 8px; top: 8px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 16px); font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.6); padding: 4px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-rouge { width: 8px; height: 8px; border-radius: 50%; background: #e21820; flex: none; display: inline-block; animation: pj-direct 1.6s infinite; }
@keyframes pj-direct { 0% { box-shadow: 0 0 0 0 rgba(226,24,32,.6); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pj-commandes { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; }
.pj-commandes:empty { display: none; }
.pj-groupe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.pj-fin { margin-left: auto; }
.pj-page { font-variant-numeric: tabular-nums; font-weight: 600; padding: 0 6px; }
.pj .btn.pj-gros { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.pj .btn.ghost.pj-gros { border-color: var(--line-strong); background: var(--panel-2); color: var(--ink); }
.pj .btn.on { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.btn.busy { opacity: .7; cursor: progress; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pj-tourne .7s linear infinite; }
@keyframes pj-tourne { to { transform: rotate(360deg); } }
.pj-sources { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.pj-source { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; min-width: 0;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--radius-s); color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; text-align: center; }
.pj-source svg { width: 22px; height: 22px; }
.pj-source span:not(.pj-rouge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-source:hover { color: var(--ink); border-color: var(--line-strong); }
.pj-source.on { color: var(--ink); border-color: var(--brand); background: var(--brand-soft); }
.pj-source .pj-rouge { position: absolute; top: 6px; right: 6px; }
.pj-detail { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj-ligne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.pj-ligne > .input { flex: 1 1 220px; min-width: 0; width: auto; max-width: 100%; }
.pj-depot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--radius); }
.pj-depot.on { border-color: var(--brand); background: var(--brand-soft); }
.pj-etapes { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-favoris { display: flex; flex-direction: column; gap: 10px; }
.pj-fav-titre { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.pj-fav-liste { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-fav { display: inline-flex; align-items: stretch; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.pj-fav-go { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; border: 0; background: none; color: var(--ink); padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.pj-fav-go span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-fav-go svg { width: 14px; height: 14px; flex: none; }
.pj-fav-go:hover { background: var(--brand-soft); }
.pj-fav-x { border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); padding: 0 8px; cursor: pointer; display: inline-flex; align-items: center; }
.pj-fav-x svg { width: 12px; height: 12px; }
.pj-fav-x:hover { color: var(--bad); }
.pj-note { font-size: 12px; }
.pj-touches { width: 100%; border-collapse: collapse; }
.pj-touches td { padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pj-touches td:first-child { white-space: nowrap; width: 1%; padding-right: 14px; }
.pj-touches kbd { display: inline-block; font: 600 12px/1 system-ui, sans-serif; padding: 4px 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--panel-2); margin: 2px 4px 2px 0; }
.pj-machines .mach-grille { margin-top: 10px; }
.mach-tuile.projetee { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
/* tablette, écran tactile : boutons et vignettes plus grands */
@media (pointer: coarse) {
  .pj .btn.pj-gros { min-height: 48px; padding: 10px 16px; font-size: 15px; }
  .pj-source { min-height: 76px; font-size: 13px; }
  .pj-ecran { min-height: 86px; }
  .pj-fav-go { padding: 10px 14px; }
  .pj-fav-x { padding: 0 12px; }
}
@media (max-width: 560px) {
  .pj-sources { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pj-ecrans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-fin { margin-left: 0; }
  .pj .btn { white-space: normal; text-align: left; }
  .pj-touches td:first-child { white-space: normal; }
}
@media (max-width: 360px) { .pj-ecrans { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .pj-ecrans { grid-template-columns: minmax(0, 1fr); } .pj-mini { aspect-ratio: auto; height: 120px; } }
@media (pointer: coarse) { .pj-ecran-outil { width: 38px; height: 38px; } .pj-ecran-cmd .btn.small { min-height: 38px; padding: 6px 12px; font-size: 13px; } }

/* visite guidée (didacticiel) du parcours d'inscription : voile, trou de surbrillance et bulle pas-à-pas */
.lms-guide-back { position: fixed; inset: 0; z-index: 9000; background: rgba(15, 23, 42, .55); }
.lms-guide-hole { position: fixed; display: none; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); background: transparent; pointer-events: none; transition: all .25s ease; }
.lms-guide-bulle { position: fixed; z-index: 9001; background: var(--fond, #fff); color: var(--texte, #0f172a); border-radius: 12px; padding: 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); max-width: calc(100vw - 32px); }
.lms-guide-step { font-size: 12px; color: var(--brand, #2563eb); font-weight: 700; margin-bottom: 4px; }
.lms-guide-titre { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.lms-guide-txt { font-size: 14px; line-height: 1.45; margin-bottom: 14px; }
.lms-guide-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------------------------------------------------------- « Mes notes » : carnet de l'élève (js/lms/carnet.js) */
.cn-info { margin-bottom: 14px; }
.cn-corps { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.cn-cote { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 0; max-height: calc(100vh - 160px); overflow: auto; }
.cn-cote-titre { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); margin: 2px 6px 6px; }
.cn-cote .cn-som-l { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-s); }
.cn-cote .cn-som-l.on { background: var(--brand-soft); }
.cn-cote .cn-som-l:hover { background: var(--panel-2); }
.cn-cote .cn-som-l.on:hover { background: var(--brand-soft); }
.cn-som-btn { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: baseline; background: none; border: 0; color: var(--ink); text-align: left; padding: 6px; cursor: pointer; font: inherit; font-size: 13.5px; }
.cn-cote .n1 .cn-som-btn { font-weight: 700; }
.cn-cote .n2 .cn-som-btn { padding-left: 18px; font-size: 13px; color: var(--muted); }
.cn-cote .n3 .cn-som-btn { padding-left: 30px; font-size: 12.5px; color: var(--faint); }
.cn-som-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-som-num { color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
.cn-ranger { display: flex; flex: none; }
.cn-ranger button { background: none; border: 0; color: var(--muted); cursor: pointer; width: 24px; height: 26px; border-radius: 4px; font-size: 14px; }
.cn-ranger button:hover { background: var(--panel-3); color: var(--ink); }
.cn-page { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 22px 22px; min-width: 0; }
.cn-haut { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cn-etat { font-size: 12.5px; }
.cn-titre { width: 100%; font-size: 26px; font-weight: 700; background: none; border: 0; color: var(--ink); outline: none; padding: 8px 0 12px; font-family: inherit; }
.cn-blocs { display: flex; flex-direction: column; gap: 4px; }
.cn-bloc { display: flex; align-items: flex-start; gap: 6px; }
.cn-bloc > :first-child { flex: 1; min-width: 0; }
.cn-outils { display: flex; opacity: 0; flex: none; }
.cn-bloc:hover .cn-outils, .cn-bloc:focus-within .cn-outils { opacity: 1; }
@media (hover: none) { .cn-outils { opacity: .6; } }
.cn-outils button { background: none; border: 0; color: var(--faint); cursor: pointer; width: 26px; height: 28px; border-radius: 4px; font-size: 14px; }
.cn-outils button:hover { background: var(--panel-2); color: var(--ink); }
.cn-ta { width: 100%; resize: none; overflow: hidden; background: none; border: 0; color: var(--ink); font: inherit; font-size: 15px; line-height: 1.55; padding: 4px 0; outline: none; border-radius: 4px; }
.cn-ta:focus { background: var(--panel-2); }
.cn-ta.cn-h2 { font-size: 20px; font-weight: 700; margin-top: 10px; }
.cn-ta.cn-h3 { font-size: 16.5px; font-weight: 700; margin-top: 4px; }
.cn-puces { display: flex; gap: 6px; }
.cn-puce { color: var(--muted); padding-top: 4px; }
.cn-figure { margin: 6px 0; }
.cn-img { max-width: 100%; max-height: 480px; border-radius: var(--radius-s); display: block; background: var(--panel-2); min-height: 40px; }
.cn-legende { width: 100%; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 0; outline: none; }
.cn-ajout { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
/* lecture (formateur) */
.cn-fenetre { max-height: 70vh; overflow: auto; }
.cn-lecture { line-height: 1.55; }
.cn-titre-carnet { font-size: 26px; margin: 0 0 4px; }
.cn-sous { color: var(--muted); margin-bottom: 16px; }
.cn-sommaire { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; margin-bottom: 20px; }
.cn-sommaire h2 { font-size: 15px; margin: 0 0 6px; }
.cn-sommaire .cn-som-l { display: flex; gap: 8px; color: var(--ink); text-decoration: none; padding: 2px 0; }
.cn-sommaire .n1 { font-weight: 700; }
.cn-sommaire .n2 { padding-left: 18px; }
.cn-sommaire .n3 { padding-left: 36px; font-size: .94em; }
.cn-note-lue { margin-bottom: 26px; }
.cn-note-titre { display: flex; gap: 10px; font-size: 21px; margin: 0 0 2px; border-bottom: 2px solid var(--line-strong); padding-bottom: 4px; }
.cn-date { color: var(--faint); font-size: 12px; margin-bottom: 8px; }
.cn-h2 { font-size: 17px; margin: 14px 0 4px; }
.cn-h3 { font-size: 15px; margin: 10px 0 4px; }
.cn-p { margin: 4px 0; white-space: pre-wrap; }
.cn-liste { margin: 4px 0 4px 20px; padding: 0; }
.cn-figure figcaption { color: var(--muted); font-size: 13px; margin-top: 4px; }
@media (max-width: 820px) {
  .cn-corps { grid-template-columns: 1fr; }
  .cn-cote { position: static; max-height: 260px; }
  .cn-page { padding: 12px 14px 16px; }
  .cn-titre { font-size: 21px; }
}
