/* Cross 2026 — charte graphique (cf. ressources/CDC.md § 7). Polices et icônes embarquées : aucun CDN. */
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url('fonts/montserrat-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }

:root {
  --rose: #E63946;
  --rose-fonce: #c42a37;
  --rose-pale: #fdecee;
  --marine: #1D3557;
  --marine-pale: #e8edf5;
  --blanc: #FFFFFF;
  --gris: #E2E8F0;
  --gris-fond: #F1FAEE;
  --gris-texte: #5b6676;
  --vert: #2A9D8F;
  --orange: #f4a261;
  --titre: 'Montserrat', 'Poppins', system-ui, sans-serif;
  --corps: 'Inter', 'Roboto', system-ui, sans-serif;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--corps); color: var(--marine); background: #f6f8fb; line-height: 1.45; }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; margin: 0; line-height: 1.15; }
a { color: var(--rose); }

/* ---------- barre haute ---------- */
.barre { background: var(--marine); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.barre .blason { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 3px solid var(--rose); flex: none; display: grid; place-items: center; color: var(--rose); font-family: var(--titre); font-weight: 800; font-size: 11px; text-align: center; line-height: 1; overflow: hidden; }
.barre .blason img { width: 100%; height: 100%; object-fit: cover; }
.barre h1 { font-size: 1.05rem; letter-spacing: .02em; flex: 1; min-width: 180px; }
.barre h1 small { display: block; font-family: var(--corps); font-weight: 600; font-size: .72rem; color: #ffb3ba; letter-spacing: .08em; text-transform: uppercase; }

main { max-width: 1100px; margin: 0 auto; padding: 12px; }
body { overflow-x: hidden; }
.carte { background: #fff; border: 1px solid var(--gris); border-radius: var(--rayon); padding: 16px; box-shadow: 0 1px 2px rgba(29,53,87,.06); }
.carte + .carte { margin-top: 14px; }
.carte h2 { font-size: 1.05rem; margin-bottom: 10px; }
.muted { color: var(--gris-texte); font-size: .88rem; }

/* ---------- boutons ---------- */
.btn { appearance: none; border: 2px solid transparent; border-radius: 12px; padding: 12px 18px; font: 700 .95rem var(--corps); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; min-height: 48px; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-rose { background: var(--rose); color: #fff; }
.btn-rose:hover { background: var(--rose-fonce); }
.btn-marine { background: var(--marine); color: #fff; }
.btn-vert { background: var(--vert); color: #fff; }
.btn-contour { background: #fff; color: var(--marine); border-color: var(--gris); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-gros { width: 100%; justify-content: center; font-size: 1.1rem; min-height: 58px; }
select, input[type=text], input[type=password] { font: 600 1rem var(--corps); padding: 11px 12px; border: 2px solid var(--gris); border-radius: 10px; background: #fff; color: var(--marine); min-height: 48px; }
.ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- fiche A4 (aperçu écran + impression) ---------- */
.fiche { position: relative; width: 210mm; height: 297mm; background: #fff; color: #000; overflow: hidden; font-family: var(--corps); margin: 0 auto; }
.fiche > div { position: absolute; box-sizing: border-box; }
.fiche .repere { background: #000; }
.fiche .logo-place { display: grid; place-items: center; }
.fiche .logo-place img { width: 100%; height: 100%; object-fit: contain; }
.fiche .f-sur { font: 700 7.5pt var(--titre); letter-spacing: .12em; color: var(--rose); }
.fiche .f-titre { font: 800 12.5pt/1.1 var(--titre); color: var(--marine); }
.fiche .f-classe { font: 800 34pt/1 var(--titre); color: var(--marine); display: flex; align-items: center; border-bottom: 1.2mm solid var(--rose); }
.fiche .f-regle { font-size: 7.6pt; line-height: 1.3; color: #222; padding-top: 1mm; }
.fiche .f-qr svg { width: 100%; height: 100%; display: block; }
.fiche .th { font: 700 6.6pt var(--corps); color: var(--marine); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 1mm; border-bottom: .5mm solid var(--marine); }
.fiche .th-g { justify-content: flex-start; font-size: 8pt; padding-left: 1mm; }
.fiche .th-ent { font: 800 10pt var(--titre); }
.fiche .th-demi { font: 700 7.4pt var(--corps); color: #3a4663; }
.fiche .th-nc { color: var(--rose); font: 800 9.5pt var(--titre); }
.fiche .th-bas { align-items: flex-start; padding: 1mm 0 0; border-bottom: 0; border-top: .5mm solid var(--marine); }
.fiche .th-g.th-bas { align-items: flex-start; padding-left: 1mm; text-align: right; justify-content: flex-end; padding-right: 2mm; font-size: 8pt; }
.fiche .bande { background: #eef0f3; }
.fiche .td-num { font: 700 8pt var(--corps); display: flex; align-items: center; justify-content: center; color: var(--marine); }
.fiche .td-nom { display: flex; align-items: center; padding-left: 1mm; }
.fiche .td-nom span { white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; }
.fiche .boite { border: .55mm solid #000; background: #fff; }
.fiche .boite svg { display: block; width: 100%; height: 100%; }
.fiche .trait { background: #cfd4db; }
.fiche .f-pied { font-size: 6pt; color: #555; text-align: center; }

.apercu { overflow: auto; background: #dfe5ee; border-radius: var(--rayon); padding: 14px; }
.apercu .fiche { zoom: .62; box-shadow: 0 4px 18px rgba(29,53,87,.25); margin-bottom: 14px; }

@page { size: A4 portrait; margin: 0; }
@media print {
  html, body { background: #fff !important; }
  body * { visibility: hidden; }
  .zone-impression, .zone-impression * { visibility: visible; }
  .zone-impression { position: absolute; left: 0; top: 0; }
  .apercu { padding: 0; background: none; overflow: visible; }
  .apercu .fiche { zoom: 1; box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- scan : saisie tactile ---------- */
.zone-camera { position: relative; background: #0b1424; border-radius: var(--rayon); overflow: hidden; }
.zone-camera video, .zone-camera canvas { width: 100%; display: block; max-height: 70vh; object-fit: contain; }
.etat-qr { position: absolute; top: 10px; left: 10px; background: rgba(29,53,87,.9); color: #fff; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.etat-qr.ok { background: var(--vert); }
.bandeau { padding: 12px 14px; border-radius: 12px; font-weight: 600; margin: 10px 0; }
.bandeau.info { background: var(--marine-pale); }
.bandeau.ok { background: #dff3f0; color: #146c61; }
.bandeau.alerte { background: #fff1e4; color: #8a4b08; }
.bandeau.erreur { background: var(--rose-pale); color: var(--rose-fonce); }

.eleve { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 6px 10px; padding: 10px 8px; border-bottom: 1px solid var(--gris); align-items: center; }
.eleve:nth-child(even) { background: #fafbfd; }
.eleve .num { font: 800 .9rem var(--titre); color: var(--gris-texte); text-align: center; }
.eleve .nom { font-weight: 700; }
.eleve .nom small { font-weight: 400; color: var(--gris-texte); margin-left: 6px; }
.eleve .choix { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; min-width: 0; }
.eleve.a-verifier { background: #fff6ec; box-shadow: inset 4px 0 0 var(--orange); }
.eleve.vide { background: var(--rose-pale); box-shadow: inset 4px 0 0 var(--rose); }
.tour { appearance: none; border: 2px solid var(--gris); background: #fff; color: var(--marine); font: 800 1.05rem var(--titre); aspect-ratio: 1 / 1; min-width: 0; border-radius: 10px; cursor: pointer; padding: 0; position: relative; }
.tour.demi { font-size: .82rem; background: #f7f9fc; }
.tour:active { transform: scale(.94); }
.tour.sel { background: var(--marine); border-color: var(--marine); color: #fff; }
.tour.nc { color: var(--rose); border-color: #f3c3c7; }
.tour.nc.sel { background: var(--rose); border-color: var(--rose); color: #fff; }
.tour.lu::after { content: ''; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--vert); }
.barre-valider { position: sticky; bottom: 0; background: linear-gradient(transparent, #f6f8fb 25%); padding: 18px 0 10px; }
@media (min-width: 700px) { .eleve { grid-template-columns: 2.2rem 14rem minmax(0, 1fr); } .eleve .choix { grid-column: auto; grid-template-columns: repeat(18, minmax(0, 1fr)); } .tour { font-size: .9rem; } .tour.demi { font-size: .7rem; } }

/* ---------- résultats ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--gris); border-radius: var(--rayon); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.kpi .ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; flex: none; background: var(--rose-pale); }
.kpi:nth-child(2) .ico { background: var(--marine-pale); }
.kpi:nth-child(3) .ico { background: #dff3f0; }
.kpi .val { font: 800 2rem/1 var(--titre); }
.kpi .lib { color: var(--gris-texte); font-size: .85rem; font-weight: 600; }
.grille-podiums { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.classement { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.classement li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--gris); }
.classement li::before { counter-increment: r; content: counter(r); width: 28px; height: 28px; border-radius: 50%; background: var(--marine-pale); display: grid; place-items: center; font: 800 .85rem var(--titre); flex: none; }
.classement li:first-child::before { background: var(--rose); color: #fff; }
.classement .v { margin-left: auto; font: 800 1rem var(--titre); }
table.classes { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.classes th { text-align: left; font: 700 .75rem var(--corps); color: var(--gris-texte); text-transform: uppercase; letter-spacing: .06em; padding: 8px 6px; border-bottom: 2px solid var(--gris); }
table.classes td { padding: 8px 6px; border-bottom: 1px solid var(--gris); }
.barre-prog { height: 8px; background: var(--gris); border-radius: 99px; overflow: hidden; min-width: 60px; }
.barre-prog i { display: block; height: 100%; background: var(--vert); }
.pastille { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-size: .75rem; background: var(--marine-pale); }
.pastille.rose { background: var(--rose-pale); color: var(--rose-fonce); }

/* =====================================================================
   HABILLAGE « SPORT · OCTOBRE ROSE » — contrastes francs, gros boutons, dynamisme.
   (La fiche papier .fiche n'est pas concernée : sa géométrie sert à la lecture OMR.)
   ===================================================================== */
:root {
  --rose: #E8175D; --rose-fonce: #B80F47; --rose-vif: #FF477E; --rose-pale: #FFE3EC;
  --marine: #14213D; --marine-pale: #E6EBF5;
  --gris: #C9D3E3; --gris-texte: #44516a; --vert: #14907F; --rayon: 18px;
}
body { font-size: 17px; background: #FFF3F7; background-image: repeating-linear-gradient(115deg, rgba(232,23,93,.045) 0 2px, transparent 2px 26px); padding-bottom: 92px; }
@media (min-width: 800px) { body { padding-bottom: 0; } }
main { padding: 14px 12px 24px; }

/* --- en-tête --- */
.barre { background: linear-gradient(112deg, var(--marine) 0 66%, var(--rose) 66.15% 67.6%, var(--rose-vif) 67.75% 100%); padding: 10px 16px; gap: 14px; box-shadow: 0 4px 18px rgba(20,33,61,.28); position: relative; z-index: 5; }
.barre .blason { width: 58px; height: 58px; border: 3px solid #fff; box-shadow: 0 0 0 3px var(--rose); background: #fff; }
.barre h1 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: .03em; transform: skewX(-6deg); }
.barre h1 small { color: #ffd0de; font-size: .72rem; }
.onglets { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: var(--marine); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 6px; border-top: 3px solid var(--rose); box-shadow: 0 -6px 20px rgba(20,33,61,.3); z-index: 20; }
.onglets a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; color: #c7d2ea; text-decoration: none; font: 800 .72rem var(--titre); text-transform: uppercase; letter-spacing: .05em; background: transparent; }
.onglets a svg { width: 26px; height: 26px; }
.onglets a[aria-current] { background: var(--rose); color: #fff; box-shadow: 0 3px 0 var(--rose-fonce); }
@media (min-width: 800px) {
  .onglets { position: static; background: none; border: 0; box-shadow: none; padding: 0; margin-left: auto; gap: 8px; }
  .onglets a { flex: none; flex-direction: row; gap: 8px; padding: 11px 18px; border-radius: 999px; font-size: .85rem; background: rgba(255,255,255,.12); color: #fff; }
  .onglets a svg { width: 20px; height: 20px; }
}

/* --- cartes --- */
.carte { border: 2px solid #E1E7F1; border-radius: var(--rayon); box-shadow: 0 6px 0 rgba(20,33,61,.07); }
.carte h2 { font-size: 1.15rem; text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: 10px; }
.carte h2::before { content: ''; width: 8px; height: 1.15em; background: var(--rose); transform: skewX(-16deg); border-radius: 2px; flex: none; }
.carte h2:has(.pas)::before { display: none; }
.pas { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--rose); color: #fff; font: 800 1.1rem var(--titre); box-shadow: 0 3px 0 var(--rose-fonce); flex: none; }
.muted { color: var(--gris-texte); }

/* --- boutons « chunky », très faciles à atteindre --- */
.btn { font-family: var(--titre); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .95rem; min-height: 58px; padding: 14px 24px; border-radius: 16px; border: 0; box-shadow: 0 5px 0 rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, filter .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn svg { width: 24px; height: 24px; }
.btn-rose, .btn-rose:hover { background: linear-gradient(180deg, var(--rose-vif), var(--rose)); color: #fff; }
.btn-marine { background: linear-gradient(180deg, #243a66, var(--marine)); color: #fff; }
.btn-vert { background: linear-gradient(180deg, #1fb8a3, var(--vert)); color: #fff; }
.btn-contour { background: #fff; color: var(--marine); box-shadow: inset 0 0 0 3px var(--marine), 0 5px 0 rgba(20,33,61,.25); }
.btn-gros { min-height: 68px; font-size: 1.15rem; }
select, input[type=text], input[type=password] { min-height: 58px; border: 3px solid var(--marine); border-radius: 14px; font-weight: 700; font-size: 1.05rem; }
.ligne > select { flex: 1 1 200px; min-width: 0; }
input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--rose); flex: none; }
input[type=range] { accent-color: var(--rose); height: 34px; }

/* --- bandeau d'accueil --- */
.hero { position: relative; overflow: hidden; color: #fff; border-radius: var(--rayon); padding: 26px 22px 24px; margin-bottom: 14px; background: linear-gradient(115deg, var(--marine) 0 46%, var(--rose) 46.2% 100%); box-shadow: 0 8px 0 rgba(20,33,61,.18); }
.hero::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.07) 0 3px, transparent 3px 22px); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero-sur { margin: 0 0 6px; font: 800 .75rem var(--titre); letter-spacing: .14em; text-transform: uppercase; color: #ffc2d5; }
.hero h2 { font-size: clamp(1.7rem, 6vw, 2.8rem); text-transform: uppercase; transform: skewX(-7deg); transform-origin: left; line-height: 1.12; display: block; }
.hero h2::before { display: none; }
.hero h2 em { font-style: normal; color: #fff; background: var(--rose); padding: 0 .25em; display: inline-block; box-shadow: 4px 4px 0 rgba(20,33,61,.5); }
.hero-regle { margin: 14px 0 16px; font-weight: 700; }
.hero-chiffres { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-chiffres div { background: rgba(255,255,255,.96); color: var(--marine); border-radius: 14px; padding: 8px 16px; text-align: center; min-width: 92px; box-shadow: 0 4px 0 rgba(20,33,61,.3); }
.hero-chiffres b { display: block; font: 800 1.8rem/1 var(--titre); color: var(--rose); }
.hero-chiffres span { font: 700 .72rem var(--corps); text-transform: uppercase; letter-spacing: .08em; }
.hero .ruban { position: absolute; right: -6px; top: -10px; width: 130px; opacity: .25; z-index: 0; transform: rotate(14deg); }

/* --- scan : saisie tactile --- */
#btn-camera { flex: 1 1 100%; min-height: 72px; font-size: 1.2rem; justify-content: center; animation: pouls 2.2s infinite; }
@keyframes pouls { 0%, 100% { box-shadow: 0 5px 0 rgba(0,0,0,.25), 0 0 0 0 rgba(232,23,93,.5); } 50% { box-shadow: 0 5px 0 rgba(0,0,0,.25), 0 0 0 12px rgba(232,23,93,0); } }
.etat-qr { font-weight: 800; font-size: .95rem; padding: 8px 16px; }
.bandeau { border-radius: 14px; font-size: .98rem; border: 2px solid transparent; }
.bandeau.ok { background: #d3f3ee; color: #0b5c50; border-color: #8fdccf; }
.bandeau.alerte { background: #ffecd9; color: #7a3d00; border-color: #f4b97d; }
.bandeau.erreur { background: var(--rose-pale); color: var(--rose-fonce); border-color: #ff9fbd; }
.eleve { padding: 12px 8px; }
.eleve .num { font-size: 1rem; color: var(--rose); }
.eleve .nom { font-size: 1.08rem; }
.eleve.a-verifier { box-shadow: inset 6px 0 0 #f08a24; }
.eleve.vide { box-shadow: inset 6px 0 0 var(--rose); }
.tour { border: 3px solid #8ea0bf; border-radius: 14px; font-size: 1.25rem; color: var(--marine); background: #fff; box-shadow: 0 3px 0 #b8c4da; transition: transform .07s, box-shadow .07s, background .1s; }
.tour.demi { font-size: .95rem; background: #EEF2F9; }
.tour:active { transform: translateY(3px); box-shadow: 0 0 0 #b8c4da; }
.tour.sel { background: var(--marine); border-color: var(--marine); color: #fff; box-shadow: 0 3px 0 #000, 0 0 0 4px var(--rose-vif); transform: scale(1.06); z-index: 1; }
.tour.nc { color: var(--rose-fonce); border-color: #f09ab7; box-shadow: 0 3px 0 #f4bfd0; }
.tour.nc.sel { background: var(--rose); color: #fff; border-color: var(--rose); box-shadow: 0 3px 0 var(--rose-fonce), 0 0 0 4px var(--marine); }
.tour.lu::after { width: 11px; height: 11px; background: #2be3c4; border: 2px solid #fff; top: -4px; right: -4px; }
.barre-valider { bottom: 76px; background: linear-gradient(transparent, #FFF3F7 30%); }
@media (min-width: 800px) { .barre-valider { bottom: 0; } }

/* --- résultats --- */
.kpis { gap: 14px; }
.kpi { border: 0; color: #fff; padding: 20px; border-radius: var(--rayon); box-shadow: 0 7px 0 rgba(20,33,61,.2); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.09) 0 3px, transparent 3px 22px); pointer-events: none; }
.kpi:nth-child(1) { background: linear-gradient(135deg, var(--rose-vif), var(--rose-fonce)); animation-delay: .05s; }
.kpi:nth-child(2) { background: linear-gradient(135deg, #2c4a85, var(--marine)); animation-delay: .15s; }
.kpi:nth-child(3) { background: linear-gradient(135deg, #1fb8a3, #0b6e61); animation-delay: .25s; }
.kpi .ico, .kpi:nth-child(2) .ico { background: rgba(255,255,255,.22); width: 60px; height: 60px; font-size: 2rem; position: relative; z-index: 1; }
.kpi .val { font-size: 2.5rem; text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.kpi .lib { color: rgba(255,255,255,.92); font-weight: 700; }
.kpi > div { position: relative; z-index: 1; }
.classement li { padding: 10px 0; border-bottom: 2px solid #EEF1F7; font-size: 1.02rem; }
.classement li::before { width: 34px; height: 34px; font-size: 1rem; background: var(--marine-pale); color: var(--marine); }
.classement li:nth-child(1)::before { content: '🥇'; background: none; font-size: 1.7rem; width: 38px; }
.classement li:nth-child(2)::before { content: '🥈'; background: none; font-size: 1.5rem; width: 38px; }
.classement li:nth-child(3)::before { content: '🥉'; background: none; font-size: 1.5rem; width: 38px; }
.classement .v { color: var(--rose); font-size: 1.15rem; }
.pastille { background: var(--marine); color: #fff; font-weight: 800; }
.pastille.rose { background: var(--rose); }
table.classes th { color: var(--marine); border-bottom: 3px solid var(--marine); }
.barre-prog { height: 12px; background: #E1E7F1; }
.barre-prog i { background: linear-gradient(90deg, var(--rose-vif), var(--rose)); }

/* l'animation d'entrée ne se joue qu'au chargement (la page Résultats se redessine toutes les 3 s) */
.premiere .carte, .premiere .hero { animation: monte .45s both; }
.premiere .kpi { animation: monte .5s both; }
@keyframes monte { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .onglets { display: none !important; } }

@media (max-width: 560px) { .kpi { padding: 14px; gap: 10px; } .kpi .val { font-size: 1.85rem; white-space: nowrap; } .kpi .ico, .kpi:nth-child(2) .ico { width: 48px; height: 48px; font-size: 1.6rem; } }

/* --- cases Garçon / Fille (fiche + saisie) --- */
.fiche .th-sexe { font: 800 10pt var(--titre); }
.fiche .th-sexe-g { color: var(--marine); }
.fiche .th-sexe-f { color: var(--rose); }
.fiche .sep { background: #000; }
.eleve .nom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eleve .nom-t { flex: 1 1 8rem; min-width: 0; }
.sexe { display: inline-flex; gap: 6px; margin-left: auto; }
.sx { appearance: none; width: 46px; height: 46px; border-radius: 12px; border: 3px solid #8ea0bf; background: #fff; font: 800 1.15rem var(--titre); color: var(--marine); box-shadow: 0 3px 0 #b8c4da; cursor: pointer; padding: 0; position: relative; }
.sx:active { transform: translateY(3px); box-shadow: none; }
.sx.f { color: var(--rose-fonce); border-color: #f09ab7; box-shadow: 0 3px 0 #f4bfd0; }
.sx.sel { background: var(--marine); border-color: var(--marine); color: #fff; box-shadow: 0 3px 0 #000, 0 0 0 3px var(--rose-vif); }
.sx.f.sel { background: var(--rose); border-color: var(--rose); color: #fff; box-shadow: 0 3px 0 var(--rose-fonce), 0 0 0 3px var(--marine); }
.sx.lu::after { content: ''; position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: #2be3c4; border: 2px solid #fff; }

/* --- dialogues modaux --- */
dialog.dlg { border: 0; border-radius: 20px; padding: 22px; max-width: min(520px, 94vw); width: 100%; box-shadow: 0 20px 60px rgba(20,33,61,.5); color: var(--marine); }
dialog.dlg::backdrop { background: rgba(20,33,61,.6); }
dialog.dlg h3 { font-size: 1.2rem; text-transform: uppercase; margin-bottom: 8px; }
.dlg-txt { margin-bottom: 16px; max-height: 55vh; overflow: auto; }
.dlg-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.dlg-btns .btn { flex: 1 1 140px; justify-content: center; }
.dlg-liste { list-style: none; margin: 0; padding: 0; }
.dlg-liste li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 2px solid #EEF1F7; }
.dlg-liste .nom { flex: 1; min-width: 0; font-weight: 700; }
.dlg-liste .v { font: 800 1.05rem var(--titre); color: var(--rose); min-width: 3.2rem; text-align: right; }
.btn-suppr { background: var(--rose-pale); color: var(--rose-fonce); box-shadow: inset 0 0 0 2px #ff9fbd, 0 3px 0 #f4bfd0; min-height: 44px; padding: 8px 14px; border-radius: 12px; font-size: .8rem; }
.btn-danger { background: linear-gradient(180deg, #d93a3a, #a31d1d); color: #fff; }

/* --- cadrage en direct : la page entière doit tenir dans le cadre --- */
.zone-camera canvas.cadre { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.conseils { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.conseils li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.conseils b { color: var(--rose-fonce); }
details.manuel { margin-top: 12px; border: 2px dashed #b8c4da; border-radius: 14px; padding: 10px 14px; }
details.manuel summary { cursor: pointer; font-weight: 800; text-transform: uppercase; font-size: .85rem; letter-spacing: .04em; }
.deja { margin: 10px 0; }

/* l'attribut hidden doit toujours l'emporter sur les display: flex des boutons et lignes */
[hidden] { display: none !important; }

/* --- écran du code d'accès (PIN) --- */
.verrou { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: linear-gradient(115deg, var(--marine) 0 52%, var(--rose) 52.2% 100%); overflow: auto; }
.verrou::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, rgba(255,255,255,.06) 0 3px, transparent 3px 24px); pointer-events: none; }
.verrou-boite { position: relative; z-index: 1; background: #fff; width: min(360px, 100%); border-radius: 24px; padding: 22px 20px 20px; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.verrou-logo { width: 84px; height: 84px; border-radius: 50%; box-shadow: 0 0 0 4px var(--rose); }
.verrou-boite h2 { margin: 12px 0 4px; font-size: 1.3rem; text-transform: uppercase; }
.verrou-msg { margin: 0 0 12px; min-height: 2.6em; font-weight: 600; color: var(--gris-texte); }
.verrou-msg.erreur { color: var(--rose-fonce); }
.verrou-points { display: flex; justify-content: center; gap: 14px; margin-bottom: 14px; }
.verrou-points i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--marine); transition: background .1s, transform .1s; }
.verrou-points i.plein { background: var(--rose); border-color: var(--rose); transform: scale(1.15); }
.verrou-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.verrou-pave button { appearance: none; border: 0; border-radius: 16px; min-height: 64px; font: 800 1.6rem var(--titre); color: #fff; background: linear-gradient(180deg, #243a66, var(--marine)); box-shadow: 0 5px 0 #000; cursor: pointer; }
.verrou-pave button:active { transform: translateY(4px); box-shadow: 0 1px 0 #000; }
.verrou-pave button.aux { background: #fff; color: var(--marine); box-shadow: inset 0 0 0 3px var(--marine), 0 5px 0 rgba(20,33,61,.3); font-size: 1.3rem; }
.verrou-boite.secoue { animation: secoue .45s; }
@keyframes secoue { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* --- pastille d'état de la synchronisation --- */
.puce-sync { appearance: none; border: 0; border-radius: 999px; padding: 6px 12px; font: 800 .72rem var(--titre); letter-spacing: .04em; text-transform: uppercase; cursor: pointer; background: rgba(255,255,255,.16); color: #fff; white-space: nowrap; }
.puce-sync.ok { background: #1fb8a3; }
.puce-sync.attente { background: #f4a261; color: #14213D; }
.puce-sync.hors { background: #e63946; }

/* --- scan : accueil minimal, bandeau de classe, mode photo plein écran --- */
#carte-intro .btn-gros { flex: 1 1 100%; justify-content: center; }
.classe-bandeau { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.classe-bandeau small { display: block; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; color: var(--gris-texte); font-size: .72rem; }
.classe-bandeau b { font: 800 2.2rem/1 var(--titre); color: var(--rose); margin-right: 10px; }
details.carte > summary { cursor: pointer; font: 800 .85rem var(--titre); text-transform: uppercase; letter-spacing: .04em; }
.mode-photo { position: fixed; inset: 0; z-index: 900; background: #000; }
.mode-photo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.mode-photo canvas.cadre { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mp-haut { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 12px 28px; background: linear-gradient(rgba(0,0,0,.7), transparent); }
.mp-haut .etat-qr { position: static; max-width: calc(100% - 66px); white-space: normal; }
.mp-fermer { appearance: none; flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); color: #14213D; font: 800 1.4rem var(--titre); cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.mp-bas { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.75)); }
body.photo-ouverte { overflow: hidden; }

/* --- la barre « Valider » reste TOUJOURS au premier plan : rien ne passe au-dessus (ni les puces sélectionnées, ni les points de lecture) --- */
.barre-valider { z-index: 40; background: #FFF3F7; margin: 0 -12px; padding: 12px 12px 10px; box-shadow: 0 -10px 18px -8px rgba(20,33,61,.35); }
.eleve .choix, .tour, .sx { position: relative; z-index: 0; }
.tour.sel, .sx.sel { z-index: 0; }

/* --- sous-onglets de la page Fiches --- */
.sous-onglets { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.sous-onglets .btn { flex: 1 1 200px; justify-content: center; }
