:root {
  --fond: #F3F6F7; --surface: #FFFFFF; --texte: #14232B; --doux: #5B6B74; --trait: #DCE3E7;
  --primaire: #2563EB; --primaire-fonce: #1D4ED8; --primaire-pale: #EFF6FF;
  --danger: #B42318; --danger-pale: #FDECEA; --ok-pale: #E3F4EA; --ok: #17663A;
  --rayon: 12px; --ombre: 0 1px 2px rgba(20, 35, 43, .06), 0 4px 14px rgba(20, 35, 43, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primaire); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 16px; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: .95rem; margin: 18px 0 6px; }
p { margin: 0 0 12px; }
code { background: var(--fond); padding: 2px 6px; border-radius: 6px; font-size: 1rem; }
.muted { color: var(--doux); }
.small { font-size: .85rem; }
.strong { font-weight: 650; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--trait); display: flex; align-items: center; gap: 24px; padding: 12px 24px; flex-wrap: wrap; }
.brand, .login-brand { font-weight: 800; font-size: 1.15rem; color: var(--texte); text-decoration: none; letter-spacing: -.01em; }
.brand span, .login-brand span { color: var(--primaire); }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.mainnav a { padding: 8px 12px; border-radius: 8px; color: var(--doux); text-decoration: none; font-weight: 600; }
.mainnav a:hover { background: var(--fond); color: var(--texte); }
.mainnav a.on { background: var(--primaire-pale); color: var(--primaire-fonce); }
.userbox { display: flex; align-items: center; gap: 12px; }
.uname { color: var(--doux); font-size: .9rem; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 24px 48px; flex: 1; }
.foot { text-align: center; color: var(--doux); font-size: .8rem; padding: 16px 24px 24px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.back { margin-bottom: 8px; font-size: .9rem; }

.card { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; margin-bottom: 20px; }
.card.narrow { max-width: 560px; }
.card.empty { text-align: center; color: var(--doux); padding: 40px 20px; }
.card.creds { border-color: var(--primaire); background: var(--primaire-pale); }

.btn { display: inline-block; font: inherit; font-weight: 650; padding: 9px 16px; border-radius: 9px; border: 1px solid var(--trait); background: var(--surface); color: var(--texte); cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { border-color: var(--doux); }
.btn-primary { background: var(--primaire); border-color: var(--primaire); color: #FFFFFF; }
.btn-primary:hover { background: var(--primaire-fonce); border-color: var(--primaire-fonce); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #FFFFFF; }
.btn-block { display: block; width: 100%; }
.link-danger { background: none; border: 0; padding: 0; font: inherit; font-size: .85rem; color: var(--danger); cursor: pointer; text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .45); outline-offset: 2px; }

label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=tel], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--texte); background: #FFFFFF; border: 1px solid #B9C4CA; border-radius: 9px; padding: 9px 12px; }
textarea { resize: vertical; }
.hint { color: var(--doux); font-size: .82rem; margin: 4px 0 0; }
fieldset { border: 0; border-top: 1px solid var(--trait); margin: 0 0 8px; padding: 16px 0 8px; }
fieldset:first-of-type { border-top: 0; padding-top: 0; }
legend { font-weight: 750; padding: 0 8px 0 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.input-btn { display: flex; gap: 8px; }
.actions { display: flex; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
form .btn-primary { margin-top: 16px; }
.actions .btn-primary { margin-top: 0; }
.stack { margin-bottom: 10px; }
form.inline { display: inline; margin-left: auto; }

.flash { border-radius: 9px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; }
.flash-ok { background: var(--ok-pale); color: var(--ok); }
.flash-err { background: var(--danger-pale); color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-t { font-size: 1rem; font-weight: 700; line-height: 1.3; min-height: 2.1rem; }
.stat-l { color: var(--doux); font-size: .85rem; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1; min-width: 220px; }
.filters select { width: auto; }
.table-wrap { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); overflow-x: auto; box-shadow: var(--ombre); }
.table { width: 100%; border-collapse: collapse; min-width: 820px; }
.table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); padding: 12px 14px; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td .small { display: block; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.badge-ok { background: var(--ok-pale); color: var(--ok); }
.badge-off { background: #E9EDF0; color: var(--doux); }
.badge-type { background: var(--primaire-pale); color: var(--primaire-fonce); }

.cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.fiche { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.fiche dt { color: var(--doux); font-size: .88rem; }
.fiche dd { margin: 0; overflow-wrap: anywhere; }
.note-form { border-bottom: 1px solid var(--trait); padding-bottom: 20px; margin-bottom: 20px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--primaire-pale); padding: 2px 0 14px 14px; }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-body { margin: 6px 0 0; overflow-wrap: anywhere; }
.plain { list-style: none; margin: 0; padding: 0; color: var(--doux); font-size: .92rem; }
.plain li { padding: 3px 0; }
details.danger { margin-top: 14px; border-top: 1px solid var(--trait); padding-top: 12px; }
details.danger summary { cursor: pointer; color: var(--danger); font-weight: 600; font-size: .9rem; }

body.public .wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--trait); border-radius: 16px; box-shadow: var(--ombre); padding: 32px 28px; }
.login-card h1 { font-size: 1.35rem; margin-top: 8px; }
.login-card .small { margin: 16px 0 0; }
body.public .flash { width: 100%; max-width: 420px; }
.login-card .flash { max-width: none; }

.hello { margin-bottom: 20px; }
.hello h1 { font-size: 2rem; margin-bottom: 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tile { margin: 0; }
.tile-wide { grid-column: 1 / -1; }
.big { font-size: 1.25rem; font-weight: 750; }

.actions-ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; }
.inline-form .btn-primary { margin-top: 0; }
.btn-xl { font-size: 1.15rem; padding: 14px 26px; }
.presence { display: inline-block; font-size: .8rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: #E9EDF0; color: var(--doux); vertical-align: middle; }
.presence.on { background: var(--ok-pale); color: var(--ok); }
.seance-etat { font-weight: 600; padding: 10px 14px; border-radius: 9px; background: #E9EDF0; }
.seance-etat.ok { background: var(--ok-pale); color: var(--ok); }
.seance-etat.err { background: var(--danger-pale); color: var(--danger); }
.seance-etat.att { background: var(--primaire-pale); color: var(--primaire-fonce); }
.wrap:has(.scene) { max-width: none; padding-top: 16px; padding-bottom: 16px; }
.wrap:has(.scene) .page-head { margin-bottom: 10px; }
.wrap:has(.scene) .seance-etat { margin-bottom: 10px; padding: 7px 14px; }
.scene { position: relative; background: #0E1519; border-radius: var(--rayon); height: calc(100vh - 235px); min-height: 380px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 12px; }
.scene video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000000; cursor: zoom-in; }
.scene-plein { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.scene.en-plein { height: 100vh; width: 100vw; border-radius: 0; margin: 0; background: #000000; }
.scene.en-plein video { cursor: zoom-out; }
.scene.en-plein .scene-plein { opacity: .55; }
.scene.en-plein .scene-plein:hover, .scene.en-plein .scene-plein:focus-visible { opacity: 1; }
.scene-attente { text-align: center; color: #FFFFFF; padding: 40px 20px; }
.scene-attente .muted { color: #B6C2C9; }
.seance-patient .actions-ligne { margin: 16px 0; }
.seance-patient .btn-primary { margin-top: 0; }
.etapes { margin: 0 0 12px; padding-left: 22px; }
.etapes li { padding: 3px 0; }
.appel { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-color: var(--primaire); background: var(--primaire-pale); }
.appel[hidden], .scene video[hidden], .scene-attente[hidden] { display: none; }
.appel h2, .appel p { margin: 0; }

.btn-small { padding: 4px 11px; font-size: .88rem; }
.controle { border-color: var(--primaire); }
.controle .etapes li { padding: 6px 0; }
.controle .btn-primary { margin-top: 0; }
.controle-saisie { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.controle-saisie input { width: 230px; font-family: Consolas, Menlo, monospace; font-size: 1.2rem; letter-spacing: .12em; }
.code-geant { display: inline-block; font-family: Consolas, Menlo, monospace; font-size: 2.4rem; font-weight: 700; letter-spacing: .18em; background: var(--primaire-pale); color: var(--primaire-fonce); padding: 6px 18px; border-radius: 10px; vertical-align: middle; user-select: all; }
kbd { display: inline-block; font: inherit; font-size: .85rem; font-weight: 600; background: var(--fond); border: 1px solid #B9C4CA; border-bottom-width: 2px; border-radius: 6px; padding: 0 6px; }

.scene:focus { outline: none; }
.scene.controle-actif { outline: 4px solid var(--danger); outline-offset: -4px; }
.scene.controle-actif video { cursor: default; }
.app-seul { display: none; }
.dans-app .app-seul { display: block; }
.dans-app .navigateur-seul { display: none; }
.telecharger { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.telecharger h2, .telecharger p { margin: 0; }
.telecharger p { color: var(--doux); max-width: 640px; }

.table-wrap.plat { border: 0; box-shadow: none; border-radius: 0; }
.table-wrap.plat .table { min-width: 0; }
.table-wrap.plat th { white-space: normal; }
.table-wrap.plat th, .table-wrap.plat td { padding: 10px 8px; }
.table-wrap.plat td:first-child { min-width: 190px; }
.table-wrap.plat td .small { display: block; }
.badge-neuf { background: #FFF1D6; color: #8A5300; }
.exos { list-style: none; margin: 0; padding: 0; }
.exo-ligne { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--trait); }
.exo-ligne:first-child { border-top: 0; padding-top: 0; }
.exo-ligne p { margin: 0 0 3px; }
.exo { max-width: 980px; margin: 0 auto; }
.exo-type { color: var(--primaire-fonce); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.exo-consigne { font-size: 1.05rem; }
.exo-message { background: var(--primaire-pale); border-radius: 9px; padding: 10px 14px; }
.exo-compteurs { display: flex; gap: 24px; flex-wrap: wrap; color: var(--doux); margin: 14px 0 10px; }
.exo-compteurs strong { color: var(--texte); font-variant-numeric: tabular-nums; margin-left: 4px; }
.exo-zone { position: relative; }
.exo-zone.termine { opacity: .45; pointer-events: none; }
.frappe-texte { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); padding: 22px 24px; font: 500 1.7rem/2.1 Consolas, "Courier New", monospace; letter-spacing: .02em; cursor: text; overflow-wrap: anywhere; }
.frappe-texte.actif { border-color: var(--primaire); }
.car { border-radius: 4px; padding: 2px 1px; }
.car.ok { color: #6B7A82; }
.car.courant { outline: 3px solid var(--primaire); outline-offset: 1px; background: var(--primaire-pale); }
.car.faux { background: var(--danger-pale); color: var(--danger); outline-color: var(--danger); }
.frappe-saisie { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; padding: 0; border: 0; resize: none; }
.souris-terrain { position: relative; height: 430px; background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); overflow: hidden; cursor: crosshair; }
.souris-cible { position: absolute; border-radius: 50%; border: 0; background: var(--primaire); box-shadow: 0 0 0 6px var(--primaire-pale); cursor: pointer; }
.raccourci-carte { background: var(--surface); border: 2px solid var(--trait); border-radius: var(--rayon); padding: 36px 24px; text-align: center; }
.raccourci-carte:focus { border-color: var(--primaire); outline: none; }
.raccourci-nom { font-size: 1.7rem; font-weight: 750; margin-bottom: 14px; }
.raccourci-touches { font-size: 1.3rem; }
.raccourci-touches kbd { font-size: 1.3rem; padding: 6px 14px; }
.raccourci-retour { min-height: 1.5rem; font-weight: 650; margin: 16px 0 0; }
.raccourci-retour.ok, .objectif.ok { color: var(--ok); }
.raccourci-retour.err, .objectif.err { color: var(--danger); }
.objectif { font-weight: 650; }
.exo-bilan { background: var(--surface); border: 1px solid var(--primaire); border-radius: var(--rayon); padding: 20px; margin-top: 20px; }
body.cadre { background: var(--surface); }
body.cadre .wrap { padding: 16px; }
body.cadre .foot { display: none; }

.cols.egal { grid-template-columns: 1fr 1fr; }
.courbe { width: 100%; height: auto; display: block; }
.courbe .grille { stroke: var(--trait); stroke-width: 1; }
.courbe .axe { fill: var(--doux); font-size: 11px; }
.courbe .ligne { fill: none; stroke: var(--primaire); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.courbe .point { fill: var(--primaire); stroke: var(--surface); stroke-width: 2; }
.courbe .valeur { fill: var(--texte); font-size: 13px; font-weight: 700; }
.barres { list-style: none; margin: 0; padding: 0; }
.barres li { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 10px; padding: 3px 0; }
.barre-nom { font: 600 1rem Consolas, Menlo, monospace; }
.barre-piste { background: var(--fond); border-radius: 4px; height: 14px; }
.barre { display: block; height: 14px; background: var(--primaire); border-radius: 0 4px 4px 0; }
.barre-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--doux); }
.rapport-entete { margin-bottom: 16px; }
.rapport-marque { display: none; font-weight: 800; font-size: 1.1rem; margin: 0 0 6px; }
.rapport-marque span { color: var(--primaire); }
label.en-ligne { margin: 0; align-self: center; }
label.case { font-weight: 500; display: flex; gap: 6px; align-items: center; }
.filters input[type=date] { width: auto; }
@media print {
  .topbar, .foot, .no-print, .flash { display: none !important; }
  body { background: #FFFFFF; font-size: 12px; }
  .wrap { max-width: none; padding: 0; }
  .card, .stat, .table-wrap { box-shadow: none; break-inside: avoid; }
  .rapport-marque { display: block; }
  .table { min-width: 0 !important; }
  .barre, .courbe .ligne, .courbe .point { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Outils de seance ---------- */
.chrono { background: var(--primaire-pale); color: var(--primaire-fonce); font-variant-numeric: tabular-nums; }
.outils { background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); margin-bottom: 10px; }
.outils summary { cursor: pointer; padding: 10px 16px; font-weight: 650; color: var(--titre); }
.outils-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; padding: 4px 16px 16px; }
.outils h2 { font-size: .95rem; margin-bottom: 8px; }
.outils .actions-ligne { margin-top: 8px; }
.outils .btn-primary { margin-top: 0; }
.exo-cadre { position: fixed; inset: 16px; z-index: 30; background: var(--surface); border: 2px solid var(--primaire); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 30, 60, .35); display: flex; flex-direction: column; overflow: hidden; }
.exo-cadre-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--primaire-pale); }
.exo-cadre iframe { flex: 1; width: 100%; border: 0; }
label.accord { margin-top: 14px; }
.filters .btn-primary { margin-top: 0; }

/* ---------- Habillage aux couleurs d'ErgoConnect ---------- */
:root { --titre: #17325C; --fond: #F3F6FB; --trait: #DCE5F2; --rayon: 14px; --ombre: 0 1px 2px rgba(23, 50, 92, .05), 0 8px 24px rgba(23, 50, 92, .07); }
body { background: linear-gradient(180deg, #EAF1FC 0, var(--fond) 320px) no-repeat var(--fond); }
h1, h2, h3, legend { color: var(--titre); }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
.topbar { box-shadow: 0 1px 0 var(--trait), 0 6px 18px rgba(23, 50, 92, .05); border-bottom: 0; position: sticky; top: 0; z-index: 20; }
.brand, .login-brand { display: inline-flex; align-items: flex-end; gap: 8px; }
.brand img, .login-brand img { display: block; width: auto; }
.brand span, .login-brand span { font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--primaire); padding-bottom: 3px; }
.mainnav a { border-radius: 999px; padding: 8px 16px; }
.mainnav a.on { background: var(--primaire); color: #FFFFFF; }
.btn { border-radius: 10px; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn-primary { box-shadow: 0 4px 12px rgba(37, 99, 235, .28); }
.card { border-color: transparent; }
.stat { position: relative; border-color: transparent; box-shadow: var(--ombre); padding: 18px 18px 16px 22px; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #17325C, var(--primaire)); }
.stat-n { color: var(--titre); }
.table-wrap { border-color: transparent; }
.table th { background: #F7FAFE; }
.table tbody tr:hover td { background: #F7FAFE; }
.badge-type { background: var(--primaire-pale); color: var(--primaire-fonce); }
.hero { background: linear-gradient(120deg, #17325C 0, #1D4ED8 60%, #3B82F6 100%); color: #FFFFFF; border-radius: 20px; padding: 28px 30px; margin-bottom: 22px; box-shadow: 0 14px 34px rgba(29, 78, 216, .25); display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.hero h1 { color: #FFFFFF; font-size: 2rem; margin: 0 0 4px; }
.hero p { margin: 0; color: #DCE9FF; }
.hero .btn { border-color: transparent; }
.hero .btn-primary { background: #FFFFFF; color: var(--primaire-fonce); box-shadow: none; }
.hero .btn-primary:hover { background: var(--primaire-pale); }
.tile { border-top: 4px solid var(--primaire); }
.tile h2 { display: flex; align-items: center; gap: 10px; }
.pastille { display: inline-flex; width: 34px; height: 34px; border-radius: 10px; background: var(--primaire-pale); color: var(--primaire); align-items: center; justify-content: center; flex: none; }
.pastille svg { width: 20px; height: 20px; }
.appel { background: linear-gradient(120deg, #FFF7E6, #FFFFFF); border: 2px solid #F5B942; }
.appel h2 { color: #7A4B00; }
body.public { background: linear-gradient(140deg, #17325C 0, #1D4ED8 55%, #60A5FA 100%) fixed; }
body.public .foot { color: #DCE9FF; }
.login-card { border: 0; border-radius: 20px; padding: 36px 32px; box-shadow: 0 24px 60px rgba(8, 20, 50, .35); }
.login-brand { margin: 0 0 14px; }
.frappe-texte, .souris-terrain, .raccourci-carte { border-color: var(--trait); box-shadow: var(--ombre); }
.exo-ligne.fait .strong { color: var(--doux); }
.rapport-marque img { display: block; }

.tile-feuilles { margin-top: 20px; }
input[type=file] { width: 100%; font: inherit; padding: 7px; border: 1px dashed #B9C4CA; border-radius: 9px; background: #FFFFFF; }

@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .cols, .cols.egal, .tiles, .row2, .row3, .outils-grille { grid-template-columns: 1fr; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 1.6rem; }
  .wrap { padding: 20px 16px 40px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .uname { display: none; }
  .mainnav { order: 3; flex-basis: 100%; }
  .userbox { margin-left: auto; }
}

/* ---------- Feuilles : depot multiple, partage, recherche ---------- */
.depot-suivi { list-style: none; margin: 14px 0 0; padding: 0; }
.depot-suivi li { padding: 6px 0; border-top: 1px solid var(--trait); }
.ok-texte { color: var(--ok); font-weight: 600; }
.err-texte { color: var(--danger); font-weight: 600; }
.feuille { border-top: 1px solid var(--trait); padding: 14px 0; list-style: none; }
.feuille:first-child { border-top: 0; padding-top: 0; }
.feuille .exo-ligne { border-top: 0; padding: 0; }
.partage { margin-top: 8px; }
.partage summary, .famille summary { cursor: pointer; font-weight: 600; color: var(--primaire-fonce); }
.partage summary { font-size: .9rem; }
.partage form { margin-top: 10px; padding: 14px; background: var(--primaire-pale); border-radius: 12px; }
.coches { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin-bottom: 10px; }
.coche { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.coche input { width: auto; margin: 0; }
.recherche { max-width: 320px; margin: 0; }

/* ---------- Exercices : familles repliables, recherche, filtres ---------- */
.filtres { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
.filtres label { margin-top: 0; }
.filtres input, .filtres select { margin: 0; }
.famille { padding: 0; }
.famille > summary { padding: 16px 20px; font-size: 1.1rem; color: var(--titre); display: flex; align-items: center; gap: 10px; }
.famille > summary .badge { margin-left: auto; }
.famille > .table-wrap { margin: 0 20px 16px; }
.seance-choix { display: grid; grid-template-columns: 1fr; gap: 8px; }
.envoi-feuille { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40; background: var(--surface); border: 2px solid var(--primaire); border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 30, 60, .35); padding: 16px 20px; display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); }
.envoi-feuille p { margin: 0; }
@media (max-width: 760px) { .filtres { grid-template-columns: 1fr; } .envoi-feuille { flex-direction: column; align-items: stretch; } }
.outils select[size] { height: auto; padding: 4px; margin-top: 6px; }
.outils select[size] option { padding: 3px 6px; }
.outils input[type=search] { margin: 0; }
.famille > summary { list-style: none; }
.famille > summary::-webkit-details-marker { display: none; }
.famille > summary::before { content: "\25B8"; color: var(--primaire); width: 14px; }
.famille[open] > summary::before { content: "\25BE"; }
.utilite { display: block; font-size: .88rem; color: var(--texte); margin: 2px 0; max-width: 70ch; }
.exo-cadre-tete p { margin: 4px 0 0; max-width: 90ch; }
.exo-cadre-tete .badge { margin-left: 8px; }
.apercu-note { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.exo-cadre iframe[hidden] { display: none; }
.mention, .exo-ligne p.mention { color: var(--danger); font-weight: 800; font-size: 1.02rem; margin: 2px 0 4px; }
.partage .coche, form > .coche { margin: 8px 0 4px; }

/* ---------- Dossiers de feuilles, apercu Word ---------- */
.fil { margin: 0 0 12px; color: var(--doux); }
.fil strong { color: var(--titre); }
.dossiers { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dossier { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px 46px; position: relative; text-decoration: none; background: var(--primaire-pale); border: 1px solid var(--trait); border-radius: 12px; color: var(--texte); }
.dossier:hover { border-color: var(--primaire); }
.dossier-icone { position: absolute; left: 14px; top: 16px; width: 22px; height: 16px; background: var(--primaire); border-radius: 2px 4px 4px 4px; }
.dossier-icone::before { content: ""; position: absolute; left: 0; top: -4px; width: 10px; height: 5px; background: var(--primaire); border-radius: 3px 3px 0 0; }
.dossier-outils { margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--trait); align-items: flex-start; }
.dossier-outils .partage { margin-top: 6px; }
.partages-faits { list-style: none; margin: 10px 0 0; padding: 0; }
.partages-faits li { padding: 4px 0; }
.partages-faits .link-danger { margin-left: 10px; }
.apercu-word { flex: 1; overflow: auto; background: #E9EDF3; padding: 12px; }
.apercu-word .docx-wrapper { background: transparent; padding: 8px 0; }
.apercu-attente { text-align: center; margin: 8px 0; }
.bloc-repliable > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bloc-repliable > summary::-webkit-details-marker { display: none; }
.bloc-repliable > summary h2 { margin: 0; }
.bloc-repliable[open] > summary { margin-bottom: 14px; }
.repli-aide { font-size: .85rem; font-weight: 700; color: var(--primaire-fonce); border: 1px solid var(--trait); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.bloc-repliable:not([open]) .repli-aide { font-size: 0; }
.bloc-repliable:not([open]) .repli-aide::after { content: "Afficher"; font-size: .85rem; }
.tile-feuilles, .bloc-repliable { margin-top: 20px; }
.actions-ligne .recherche { width: 280px; max-width: 100%; }
.coche-lot { width: auto; margin: 0 6px 0 0; vertical-align: middle; }
.lot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--trait); }
.lot label { margin: 0; }

/* ---------- Grille de competences ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.onglets { display: flex; gap: 8px; margin: 0 0 16px; flex-wrap: wrap; }
.onglet { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--trait); background: var(--surface); text-decoration: none; font-weight: 700; color: var(--titre); }
.onglet.on { background: var(--primaire); border-color: var(--primaire); color: #FFFFFF; }
.grille-section { padding: 0; overflow: hidden; }
.grille { width: 100%; }
.grille thead th { background: #A9C4F5; color: #14232B; font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; }
.grille th:first-child, .grille td:first-child { width: 30%; }
.grille th:last-child, .grille td:last-child { width: 36%; }
.grille td input[type=text] { margin: 0; }
.grille td .link-danger { margin-left: 8px; }
.choix-etat { white-space: nowrap; }
.etat { display: inline-block; margin: 2px 2px 2px 0; font-weight: 600; cursor: pointer; }
.etat input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.etat span { display: inline-block; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--trait); background: var(--surface); font-size: .82rem; color: var(--doux); }
.etat input:focus-visible + span { outline: 2px solid var(--primaire); outline-offset: 2px; }
.etat-travaille input:checked + span { background: var(--primaire-pale); border-color: var(--primaire); color: var(--primaire-fonce); }
.etat-a_retravailler input:checked + span { background: #FFF1D6; border-color: #D9A441; color: #8A5300; }
.etat-acquis input:checked + span { background: var(--ok-pale); border-color: var(--ok); color: var(--ok); }
.etat-vide input:checked + span { background: #E9EDF0; color: var(--texte); }
tr.etat-acquis td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
tr.etat-a_retravailler td:first-child { box-shadow: inset 4px 0 0 #D9A441; }
tr.etat-travaille td:first-child { box-shadow: inset 4px 0 0 var(--primaire); }
.barre-enregistrer { position: sticky; bottom: 0; background: var(--fond); padding: 12px 0; text-align: right; border-top: 1px solid var(--trait); z-index: 5; }
.barre-enregistrer .btn-primary { margin: 0; }
@media (max-width: 860px) { .choix-etat { white-space: normal; } .grille th:first-child, .grille td:first-child, .grille th:last-child, .grille td:last-child { width: auto; } }
@media print {
  .grille td input[type=text] { border: 0; padding: 0; background: none; }
  .etat { display: none; }
  .etat:has(input:checked) { display: inline; }
  .etat.etat-vide:has(input:checked) { display: none; }
  .etat span { border: 0; padding: 0; background: none !important; color: #000 !important; font-size: 12px; }
  .grille thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Jeux (clavier et souris) ---------- */
.jeu-terrain { position: relative; height: 440px; background: linear-gradient(180deg, #EAF1FC, #FFFFFF); border: 2px solid var(--trait); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); outline: none; user-select: none; touch-action: none; }
.jeu-terrain:focus { border-color: var(--primaire); }
.jeu-terrain.faute { border-color: var(--danger); }
.jeu-voile { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .7); z-index: 5; }
.bulle { position: absolute; top: 0; min-width: 56px; height: 56px; padding: 0 14px; border-radius: 28px; background: var(--primaire); color: #FFFFFF; font: 800 1.6rem/56px Consolas, "Courier New", monospace; text-align: center; box-shadow: 0 6px 14px rgba(37, 99, 235, .3); }
.bulle .fait { color: #BBD2FF; }
.bulle.visee { background: var(--titre); }
.bulle.eclatee { transform: scale(1.5); opacity: 0; transition: transform .25s, opacity .25s; }
.bulle.perdue { background: var(--danger); opacity: 0; transition: opacity .25s; }
.jeu-mot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.mot-image { font-size: 7rem; line-height: 1; }
.mot-modele { margin: 0; font: 700 1.6rem Consolas, "Courier New", monospace; letter-spacing: .3em; color: var(--doux); }
.mot-cases { display: flex; gap: 8px; }
.mot-cases.faute .courante { border-color: var(--danger); background: var(--danger-pale); }
.mot-case { width: 54px; height: 64px; border: 2px solid var(--trait); border-radius: 10px; background: var(--surface); font: 800 2rem/60px Consolas, "Courier New", monospace; text-align: center; text-transform: lowercase; }
.mot-case.courante { border-color: var(--primaire); box-shadow: 0 0 0 4px var(--primaire-pale); }
.jeu-attrape { cursor: crosshair; }
.attrape-objet { position: absolute; border: 0; background: none; padding: 0; line-height: 1; cursor: pointer; }
.glisser-boites { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 12px; }
.glisser-boite { flex: 1; height: 150px; border: 4px dashed; border-radius: 16px; background: rgba(255, 255, 255, .8); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; font-weight: 800; font-size: 1.1rem; }
.glisser-boite.faute { background: var(--danger-pale); }
.glisser-pastille { position: absolute; border-radius: 50%; cursor: grab; box-shadow: 0 6px 14px rgba(20, 35, 43, .25); z-index: 2; }
.glisser-pastille.tenue { cursor: grabbing; transform: scale(1.08); }
.chemin-dessin { width: 100%; height: 100%; display: block; }
.chemin-depart { cursor: pointer; }
.jeu-chemin.en-route .chemin-route { stroke: #A9C4F5; }
.jeu-chemin .chemin-pion { pointer-events: none; }
#creer-pluie input[type=number] { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--trait); border-radius: 10px; background: var(--surface); }
#creer-pluie .row3 { align-items: end; }
#creer-pluie .row3 .coche { margin: 0 0 12px; }
#creer-pluie [hidden] + div { grid-column: auto; }
