/* Styles du module « Séances et exercices » (séances) : fiche de séance, assistant pas à pas, impression A4.
   PROPRIÉTAIRE : le module. Classes préfixées « se- » ; couleurs : jetons de app.css (clair et sombre). */

/* --- éléments communs --- */
.se-date { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--teinte); line-height: 1.05; }
.se-date small { font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }
.se-date strong { font-size: 1.05rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.se-numero { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--club); color: var(--sur-club); font-weight: 750; font-size: .88rem; font-variant-numeric: tabular-nums; }
.se-texte { white-space: pre-line; overflow-wrap: anywhere; }
.se-alerte-texte { color: var(--alerte); font-weight: 600; }
.se-centre { justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.se-liste .ligne-fin, .lignes .ligne-fin:has(.icone-seule) { position: relative; z-index: 1; }
.se-annulee .ligne-texte strong { text-decoration: line-through; color: var(--doux); }
.se-action-fiche { white-space: nowrap; }

/* --- fiche de séance (lecture) --- */
.se-fiche { display: flex; flex-direction: column; gap: 16px; }
.se-impression-tete { display: none; }
.se-infos { display: flex; flex-direction: column; gap: 14px; }
.se-details { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.se-details li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.se-details .icone { color: var(--doux); }
.se-rubrique h2, .se-bloc h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); margin: 0 0 4px; }
.se-rubrique p, .se-bloc p { margin: 0; }
.se-fort { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.se-bloc { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; }
.se-puces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.se-puces li { padding: 4px 12px; border: 1px solid var(--trait-fort); border-radius: 999px; font-size: .9rem; font-weight: 550; background: var(--surface-2); }
.se-duree .icone { color: var(--alerte); flex: none; }
.se-materiel-libre { margin: 0; }
.se-phase.se-phase-vide { padding-block: 12px; opacity: .6; box-shadow: none; }
.se-prochaines .pastille { flex: none; }
.se-duree { display: flex; align-items: center; gap: 10px; margin: 0; max-width: none; }
.se-duree > span:last-child { flex: 1; min-width: 0; }
.se-duree .pastille { flex: none; }
.se-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.se-phase { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.se-phase-tete { display: flex; align-items: center; gap: 12px; min-width: 0; }
.se-phase-tete h2 { margin: 0; flex: 1; min-width: 0; font-size: 1.08rem; }
.se-phase > p { margin: 0; }
.se-exercices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.se-exercice { border-top: 1px solid var(--trait); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.se-exercice-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.se-exercice-tete h3 { margin: 0; font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
.se-exercice-tete a { color: inherit; text-decoration-color: var(--trait-fort); }
.se-exercice-tete span { white-space: nowrap; }
.se-note { margin: 0; max-width: none; padding: 8px 12px; border-left: 3px solid var(--club); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.se-exercice-corps { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 4px 20px; align-items: start; }
.se-exercice-corps > :not(.ex-figure) { grid-column: 2; }
.se-exercice-corps > .ex-figure { grid-column: 1; grid-row: 1 / span 6; }
.se-exercice:not(.avec-schema) .se-exercice-corps { grid-template-columns: 1fr; }
.se-exercice:not(.avec-schema) .se-exercice-corps > * { grid-column: 1; }
.se-exercice-corps .ex-bloc h2 { font-size: .85rem; margin: 6px 0 2px; }
.se-exercice-corps .ex-infos { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.se-exercices-simples { margin: 0; padding-left: 20px; }
.se-pied { margin: 0; }
.se-pied:empty { display: none; }
.se-fiche-famille { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.se-vide-famille { margin: 0; }
.se-texte-copie { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }

/* --- assistant pas à pas --- */
.se-assistant { display: flex; flex-direction: column; gap: 14px; }
.se-etapes { list-style: none; margin: 0; padding: 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.se-etapes li { flex: none; }
.se-pastille-etape { min-height: 38px; padding: 5px 14px 5px 14px; background: var(--surface); color: var(--encre); border: 1px solid var(--trait); border-radius: 999px; font-size: .86rem; font-weight: 600; max-width: 260px; }
.se-pastille-etape:hover { filter: none; border-color: var(--trait-fort); }
.se-pastille-etape[aria-current=step] { background: var(--teinte); border-color: var(--club); }
.se-pastille-etape:has(.se-num-etape) { padding-left: 6px; }
.se-num-etape { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--surface-2); font-size: .78rem; font-variant-numeric: tabular-nums; }
.se-pastille-etape[aria-current=step] .se-num-etape { background: var(--club); color: var(--sur-club); }
.se-nom-etape { overflow: hidden; text-overflow: ellipsis; }
.se-etape { display: flex; flex-direction: column; gap: 14px; outline: none; }
.se-etape > h2 { margin: 0; }
.se-etape h3 { margin: 6px 0 -4px; font-size: .95rem; }
.se-pied-assistant { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--trait); border-radius: 14px; box-shadow: var(--ombre); }
.se-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.se-choix-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.se-choix { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--trait); border-radius: 14px; background: var(--surface); }
.se-choix:hover { border-color: var(--club); background: var(--teinte); }
.se-choix:focus-visible { outline: 2px solid var(--club); outline-offset: 2px; }
.se-choix-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.se-phase-entete { display: flex; align-items: center; gap: 12px; }
.se-phase-entete h2 { margin: 0; flex: 1; min-width: 0; }
.se-duree-phase, .se-duree-exercice { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.se-court { width: 76px; min-height: 40px; padding: 7px 8px; }
.se-liste-exercices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; }
.se-ligne-exercice { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--trait); min-width: 0; }
.se-ligne-exercice:first-child { border-top: 0; }
.se-aucun { padding: 14px; text-align: center; font-size: .9rem; }
.se-miniature { display: grid; place-items: center; width: 64px; height: 42px; flex: none; border-radius: 7px; overflow: hidden; background: var(--surface-2); color: var(--doux); }
.se-mini-schema { width: 100%; height: 100%; display: block; }
.se-ligne-titre { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; }
.se-note-exercice { flex: 1 1 180px; min-width: 0; min-height: 38px; padding: 6px 10px; font-size: .88rem; }
.se-duree-exercice .se-court { width: 66px; min-height: 38px; }
.se-boutons-exercice { display: flex; flex: none; }
.se-ajuster { margin: -6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.se-ajuster:empty { display: none; }
.se-ajouts { flex-wrap: wrap; }
.se-recherche { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.se-filtres-choix { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.se-filtres-choix select { flex: 1 1 130px; width: auto; min-width: 0; min-height: 40px; padding: 6px 10px; }
.se-filtres-choix .case { align-items: center; flex: none; }
.se-ligne-choix .icone { flex: none; color: var(--doux); }
.se-recap-theme { margin: 0; }
.se-liste-choix { max-height: 55vh; overflow-y: auto; margin: 0 -22px; }
.lignes.nues.se-liste-choix > li { padding: 0; }
.se-ligne-choix { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 10px 22px; min-width: 0; }
.se-ligne-choix.se-avec-mini { flex-direction: row; align-items: center; gap: 12px; }
.se-ligne-choix:hover { background: var(--surface-2); }
.se-ligne-choix:focus-visible { outline: 2px solid var(--club); outline-offset: -2px; }
.se-recap { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; }
.se-recap li + li { border-top: 1px solid var(--trait); }
.se-recap-phase { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; }
.se-recap-phase:hover { background: var(--surface-2); }
.se-recap-phase:focus-visible { outline: 2px solid var(--club); outline-offset: -2px; }
.se-phase-vide { opacity: .6; }
.se-fieldset { border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.se-fieldset legend { font-weight: 700; padding: 0 4px; }
.se-fieldset p { margin: 0; }

@media (max-width: 860px) {
  .se-exercice-corps { grid-template-columns: 1fr; }
  .se-exercice-corps > * { grid-column: 1 !important; grid-row: auto !important; }
  .se-phase, .se-bloc { padding: 14px; }
  .se-ligne-exercice { flex-wrap: wrap; }
  .se-note-exercice { order: 5; flex-basis: 100%; }
  .se-pied-assistant { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .se-etapes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .ag-liste .se-action-fiche { padding: 0; width: 34px; justify-content: center; }
  .ag-liste .se-action-fiche span { display: none; }
}

@media (max-width: 520px) {
  .se-pied-assistant { padding: 8px 10px; gap: 8px; }
  .se-precedent span { display: none; }
  .se-precedent { padding-inline: 12px; }
  .se-filtres-choix select:first-child { flex: 1 1 100%; }
}

/* --- impression A4 : seulement la fiche (le reste de l'interface disparaît) ; une à deux pages --- */
@page { size: A4; margin: 10mm 10mm; }
@media print {
  html:has(.se-fiche), body:has(.se-fiche) { background: #FFFFFF !important; color: #000000; }
  body:has(.se-fiche) > :not(#page), body:has(.se-fiche) .club > :not(.club-contenu), body:has(.se-fiche) .club-contenu > :not(.se-fiche) { display: none !important; }
  body:has(.se-fiche) #page, body:has(.se-fiche) .club, body:has(.se-fiche) .club-contenu { display: block; padding: 0; margin: 0; max-width: none; min-height: 0; width: auto; background: none; }
  .se-fiche { display: block; font-size: 9pt; line-height: 1.3; color: #000000; }
  .se-fiche > * { margin-bottom: 2mm; }
  .se-fiche .carte { box-shadow: none; border: .3mm solid #999999; background: #FFFFFF; padding: 2.5mm 3.5mm; border-radius: 1.5mm; color: #000000; }
  .se-ecran, .se-pied, .se-fiche .se-phase-vide { display: none !important; }
  .se-impression-tete { display: block; border-bottom: .6mm solid #000000; padding-bottom: 2mm; }
  .se-impression-tete h1 { font-size: 16pt; margin: 0; white-space: normal; }
  .se-impression-tete p { margin: 0; color: #222222; max-width: none; }
  .se-surtitre { font-size: 8.5pt; text-transform: uppercase; letter-spacing: .08em; }
  .se-infos { gap: 2mm; }
  .se-infos .se-details { display: none; }
  .se-rubrique h2, .se-bloc h2 { color: #333333; font-size: 7.5pt; margin-bottom: .5mm; }
  .se-infos > .se-rubrique:first-of-type:has(.se-fort) { display: none; }
  .se-fort { font-size: 10.5pt; }
  .se-duree .pastille { display: none; }
  .se-duree span, .se-alerte-texte { color: #000000 !important; font-weight: 600; }
  .se-phases { display: block; }
  .se-phase { display: block; break-inside: auto; margin-bottom: 2mm; }
  .se-phase > * + * { margin-top: 1.5mm; }
  .se-phase-tete { break-after: avoid; gap: 2.5mm; }
  .se-phase-tete h2 { font-size: 11pt; white-space: normal; }
  .se-numero { background: #000000 !important; color: #FFFFFF !important; width: 5.5mm; height: 5.5mm; font-size: 8.5pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .se-exercices { display: block; }
  .se-exercice { display: block; break-inside: avoid; padding-top: 1.5mm; margin-top: 1.5mm; border-top: .2mm solid #BBBBBB; }
  .se-exercice > * + * { margin-top: 1mm; }
  .se-exercice-tete h3 { font-size: 10pt; }
  .se-exercice-tete a { text-decoration: none; color: #000000; }
  .se-exercice-corps { display: grid; grid-template-columns: 46mm minmax(0, 1fr); gap: .6mm 4mm; }
  .se-exercice-corps > * { grid-column: 2 !important; grid-row: auto !important; }
  .se-exercice-corps > .ex-figure { grid-column: 1 !important; grid-row: 1 / span 6 !important; }
  .se-exercice:not(.avec-schema) .se-exercice-corps { grid-template-columns: 1fr; }
  .se-exercice:not(.avec-schema) .se-exercice-corps > * { grid-column: 1 !important; }
  .se-exercice-corps .ex-infos { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1mm 3mm; }
  .se-exercice-corps .ex-infos dt { font-size: 6.5pt; color: #444444; }
  .se-exercice-corps .ex-infos dd { font-weight: 600; margin: 0; }
  .se-exercice-corps .ex-bloc h2 { display: inline; font-size: 8pt; margin: 0 1.5mm 0 0; color: #000000; white-space: normal; }
  .se-exercice-corps .ex-bloc h2::after { content: ' :'; }
  .se-exercice-corps .ex-bloc p { display: inline; }
  .se-fiche .pastille { border: .2mm solid #777777; background: #FFFFFF !important; color: #000000 !important; }
  .se-note { border-left: .8mm solid #000000; background: #F2F2F2; padding: 1mm 2.5mm; border-radius: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .se-bloc { break-inside: avoid; gap: 1mm; }
  .se-puces { gap: 1mm 1.5mm; }
  .se-puces li { border: .2mm solid #777777; background: #FFFFFF; padding: .3mm 2.5mm; font-size: 9pt; }
  .ex-figure { print-color-adjust: exact; -webkit-print-color-adjust: exact; border-radius: 1.5mm; }
  .se-fiche .doux { color: #333333 !important; }
  .se-fiche .petit-texte { font-size: 8.5pt; }
}
