/*
 * Affichage — compléments de l'administration au design system « Groupe Factoria ».
 * Chargé après /assets/gf/tokens.css et /assets/gf/bundle.css (ordre des trois <link>, sans @layer).
 * Discipline : aucune couleur ni police écrite en dur (seulement des var(--…)), classes préfixées adm-,
 * une classe gf- n'est retouchée que dans la partie 1, commentée. Seule exception de police : le rendu des
 * diapositives texte (.adm-texte), qui imite le player, et la chasse fixe du système pour les adresses.
 *
 * 1. Correctifs du design system   2. Base   3. Structure   4. Composants propres   5. Vues et écrans étroits
 */

/* ═══ 1. Correctifs du design system ══════════════════════════════════════════════════════════════════ */

/* Les classes gf- imposent un display qui annulerait l'attribut hidden. */
[hidden] { display: none !important; }

/* Infobulle : bundle.css la laisse toujours visible ; elle s'affiche au survol et au focus, Échap la ferme
   (le script ajoute alors hidden). Variantes alignées au début ou à la fin, près d'un bord de l'écran. */
.gf-infobulle__bulle { display: none; }
.gf-infobulle:hover > .gf-infobulle__bulle,
.gf-infobulle:focus-within > .gf-infobulle__bulle { display: block; }
.adm-infobulle--fin > .gf-infobulle__bulle { left: auto; right: 0; transform: none; }
.adm-infobulle--fin > .gf-infobulle__bulle::after { left: auto; right: 14px; margin-left: 0; }
.adm-infobulle--debut > .gf-infobulle__bulle { left: 0; transform: none; }
.adm-infobulle--debut > .gf-infobulle__bulle::after { left: 14px; margin-left: 0; }

/* Dialogue : élément <dialog> natif habillé en gf-dialogue ; on remet à zéro les styles du navigateur,
   le voile vient de .gf-dialogue (le ::backdrop reste transparent). */
dialog.gf-dialogue { inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; color: var(--text-body); overflow: hidden; }
dialog.gf-dialogue:not([open]) { display: none; }
dialog.gf-dialogue::backdrop { background: transparent; }
/* Dialogue large (éditeur de texte, ajout depuis la médiathèque) : 880 px ; sous 768 px, plein écran. Les
   autres dialogues prennent alors toute la largeur moins 16 px de chaque côté. */
dialog.gf-dialogue.adm-dialogue--vaste .gf-dialogue__panneau { width: 880px; }
@media (max-width: 767px) {
  dialog.gf-dialogue { padding: var(--sp-4); }
  dialog.gf-dialogue .gf-dialogue__panneau { width: 100%; }
  dialog.gf-dialogue.adm-dialogue--vaste { padding: 0; }
  dialog.gf-dialogue.adm-dialogue--vaste .gf-dialogue__panneau { height: 100%; max-height: 100%; border-radius: 0; }
}

/* Tableau : pas de classe dans bundle.css (guide du design system, section 6). */
.gf-tableau { width: 100%; border-collapse: collapse; font-family: var(--font-corps); font-size: 16px; line-height: 24px; color: var(--text-body); }
.gf-tableau th { padding: var(--sp-3) var(--sp-4); background: var(--surface-clair); border-bottom: 1px solid var(--border-strong); font-weight: 700; color: var(--text-titre); text-align: left; }
.gf-tableau td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border-strong); vertical-align: middle; }
.gf-tableau tbody th { background: none; }
.gf-tableau tbody tr:hover { background: var(--surface-clair); }
.gf-tableau .gf-tableau__nombre { text-align: right; white-space: nowrap; }

/* Sur surface-clair, le cyan descend à 4,17:1 : liens et boutons-liens passent à accent-hover (5,49:1). */
.adm-sur-clair .gf-bouton--lien,
.adm-sur-clair .gf-lien { color: var(--accent-hover); }
.adm-sur-clair .gf-bouton--lien:hover,
.adm-sur-clair .gf-lien:hover { color: var(--accent-press); }
/* Bouton icône discret posé sur surface-clair : le survol reste visible. */
.adm-sur-clair .gf-bouton-icone--discret:hover,
.adm-adresse .gf-bouton-icone--discret:hover { background: var(--surface-page); }

/* Notification posée dans une carte (page de connexion) : pleine largeur, sans ombre flottante. */
.adm-connexion .gf-notification { max-width: none; box-shadow: none; }

/* Cibles tactiles de 44 px sous 1 024 px et sur écran tactile (WCAG 2.5.5 visé, 2.5.8 garanti partout). */
@media (max-width: 1023px), (pointer: coarse) {
  .gf-bouton,
  .gf-bouton--sm { min-height: 44px; }
  .gf-bouton-icone,
  .gf-bouton-icone--sm { width: 44px; height: 44px; }
  .gf-onglet { min-height: 44px; }
  .gf-champ__saisie { min-height: 44px; }
  .gf-choix { padding-block: 10px; }
  .gf-choix__input { top: 12px; }
  .gf-interrupteur { min-height: 44px; }
}

/* ═══ 2. Base ══════════════════════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; overflow-wrap: break-word; }
h1, h2, h3, h4, p, figure { margin: 0; }
img { max-width: 100%; }
/* Les contrôles natifs prennent la police de la page (Carlito) au lieu de celle du navigateur. */
button, input, select, textarea { font-family: inherit; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.875em; color: var(--text-body); }

/* Focus clavier : focus-ring (2 px blanc puis 2 px cyan) sur tous les éléments interactifs adm-. L'outline
   transparent reste visible en mode de contraste élevé. */
.adm-evitement:focus,
.adm-entete__logo:focus-visible,
.adm-barre__logo:focus-visible,
.adm-nav__lien:focus-visible,
.adm-nav__ecran:focus-visible,
.adm-compte:focus-visible,
.adm-menu__action:focus-visible,
.adm-diapo__nom:focus-visible,
.adm-depot:focus-visible,
.adm-selection__carte:focus-visible,
.adm-modele:focus-visible,
.adm-couleur__saisie:focus-visible,
.adm-tableau-defilant:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }

/* Titre de vue et zone principale : cibles du focus après une navigation, pas des contrôles. */
.adm-page:focus,
.adm-page h1:focus { outline: none; }

/* Mouvement réduit : transitions et rotations coupées. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ 3. Structure ═════════════════════════════════════════════════════════════════════════════════════ */

.adm-evitement { position: absolute; top: var(--sp-2); left: var(--sp-4); z-index: 2000; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-s); background: var(--surface-page); color: var(--accent); text-decoration: underline; transform: translateY(-300%); }
.adm-evitement:focus { transform: none; }

.adm-coque { min-height: 100vh; }

/* Logo Comeva : 40 px (barre latérale), 34 px (en-tête), 48 px (connexion), jamais moins de 33 px. */
.adm-logo { display: block; width: auto; height: 40px; max-width: none; }
.adm-logo--entete { height: 34px; }
.adm-logo--connexion { height: 48px; }
.adm-barre__logo,
.adm-entete__logo { display: inline-block; align-self: flex-start; line-height: 0; border-radius: var(--radius-s); }

/* En-tête sur téléphone et tablette : logo à 16 px du bord et 12 px du haut, bouton « Menu » à droite ;
   pas de filet bas, le contenu commence à 72 px. */
.adm-entete { display: flex; align-items: flex-start; justify-content: space-between; height: 72px; padding: 12px var(--sp-4) 0; background: var(--surface-page); }
/* Lien du logo porté à 44 px de haut (cible tactile) sans déplacer le logo. */
.adm-entete__logo { margin-top: -5px; padding: 5px 0; }
.adm-entete__menu { margin-top: -5px; }

/* Barre latérale sur ordinateur (1 024 px et plus). */
.adm-barre { display: none; }
.adm-produit { display: flex; flex-direction: column; margin-top: 30px; }
.adm-produit__nom { font-size: 18px; line-height: 22px; color: var(--text-titre); }
.adm-produit__role { font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-organisation { margin-top: var(--sp-5); }

.adm-nav { margin-top: var(--sp-5); }
.adm-nav__rubrique { margin: var(--sp-5) 0 var(--sp-2); font-size: 12px; line-height: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.adm-nav__rubrique:first-child { margin-top: 0; }
.adm-nav__liste { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.adm-nav__lien { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 40px; padding: 0 var(--sp-3); border: 0; border-left: 3px solid transparent; border-radius: var(--radius-s); background: none; font-family: var(--font-corps); font-size: 16px; line-height: 20px; color: var(--text-titre); text-align: left; text-decoration: none; cursor: pointer; transition: background-color .33s ease-in-out; }
.adm-nav__lien:hover { background: var(--surface-clair); }
.adm-nav__lien[aria-current="page"] { border-left-color: var(--accent); background: var(--surface-clair); color: var(--accent-hover); }
.adm-nav__libelle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-nav__compteur { font-size: 14px; color: var(--text-muted); }
.adm-nav__ajout { color: var(--accent-hover); }
.adm-nav__ecran { display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; padding: 0 var(--sp-3) 0 calc(var(--sp-3) + 3px + 4px); border-radius: var(--radius-s); font-size: 14px; line-height: 20px; color: var(--text-body); text-decoration: none; transition: background-color .33s ease-in-out; }
.adm-nav__ecran:hover { background: var(--surface-clair); }
.adm-nav__synthese { padding: var(--sp-1) var(--sp-3); font-size: 14px; color: var(--text-muted); }
/* État d'un écran : disque plein (en ligne) ou cercle vide (hors ligne), et un mot pour les lecteurs d'écran. */
.adm-point { flex: none; width: 10px; height: 10px; border: 2px solid var(--text-muted); border-radius: 50%; }
.adm-point--en-ligne { border-color: var(--ok); background: var(--ok); }

.adm-barre__pied,
.adm-tiroir__pied { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.adm-compte { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: 40px; padding: 0 var(--sp-3); border: 1px solid var(--bleu-gris); border-radius: var(--radius-pilule); background: var(--surface-page); font-family: var(--font-corps); font-size: 16px; color: var(--text-titre); cursor: pointer; transition: background-color .33s ease-in-out; }
.adm-compte:hover { background: var(--surface-clair); }
.adm-compte__libelle { flex: 1; text-align: left; }
.adm-version { margin-top: var(--sp-2); font-size: 12px; line-height: 18px; color: var(--text-muted); }

/* Tiroir de navigation (dialogue natif) : plein écran sur téléphone, 360 px à droite sur tablette. */
dialog.adm-tiroir { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: var(--sp-4); border: 0; background: var(--surface-page); color: var(--text-body); overflow-y: auto; }
dialog.adm-tiroir:not([open]) { display: none; }
dialog.adm-tiroir[open] { display: flex; flex-direction: column; }
dialog.adm-tiroir::backdrop { background: var(--voile); }
.adm-tiroir__entete { display: flex; justify-content: flex-end; }
.adm-tiroir .adm-nav { flex: 1; margin-top: var(--sp-2); }

/* Contenu : marges de 32 px, largeur utile de 1 200 px au plus, centrée. */
.adm-page { display: block; min-width: 0; padding: var(--sp-6); }
.adm-vue { max-width: 1200px; margin: 0 auto; }
.adm-chargement { padding: var(--sp-7) 0; font-size: 16px; color: var(--text-muted); }

.adm-entete-vue { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5); }
.adm-entete-vue > h1,
.adm-entete-vue__titre { flex: 1 1 200px; min-width: 0; }
.adm-entete-vue h1 { overflow-wrap: anywhere; }
.adm-entete-vue__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.adm-intro { max-width: 72ch; margin-top: var(--sp-2); color: var(--text-muted); }

/* Notifications : en haut à droite, 420 px au plus, trois au plus. */
.adm-notifications { position: fixed; top: var(--sp-4); right: var(--sp-4); z-index: 1200; display: flex; flex-direction: column; gap: var(--sp-2); width: min(420px, calc(100vw - 2 * var(--sp-4))); pointer-events: none; }
.adm-notifications > * { pointer-events: auto; }

/* Superposition de dépôt : panneau blanc centré sur le voile (aucun texte posé sur le voile). */
.adm-superposition { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: var(--sp-5); background: var(--voile); pointer-events: none; }
.adm-superposition__panneau { max-width: 480px; padding: var(--sp-6) var(--sp-7); border: 2px dashed var(--accent); border-radius: var(--radius-l); background: var(--surface-page); text-align: center; }
.adm-superposition__titre { font-size: 24px; line-height: 28px; color: var(--text-titre); }
.adm-superposition__texte { margin-top: var(--sp-2); color: var(--text-body); }

/* ═══ 4. Composants propres ════════════════════════════════════════════════════════════════════════════ */

.adm-aide { font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-aide--tactile { display: none; }
.adm-mention { margin-bottom: var(--sp-3); font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-pile { display: flex; flex-direction: column; gap: var(--sp-4); }
.adm-boutons { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.adm-coupe { overflow-wrap: anywhere; }
.adm-lien-petit { gap: var(--sp-1); min-height: 24px; font-size: 14px; line-height: 21px; }
.adm-pastille__icone { margin-right: var(--sp-1); }
.adm-radios .gf-groupe__legende { margin-bottom: var(--sp-1); }

/* État vide. */
.adm-vide { grid-column: 1 / -1; padding: var(--sp-7) var(--sp-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-l); text-align: center; }
.adm-vide__titre { font-size: 18px; line-height: 22px; }
.adm-vide__texte { margin-top: var(--sp-2); color: var(--text-muted); }

/* Zone de dépôt d'une playlist vide (bouton). */
.adm-depot { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); width: 100%; padding: var(--sp-7) var(--sp-5); border: 2px dashed var(--bleu-gris); border-radius: var(--radius-l); background: var(--surface-page); font-family: var(--font-corps); font-size: 16px; line-height: 24px; color: var(--text-muted); text-align: center; cursor: pointer; transition: border-color .33s ease-in-out; }
.adm-depot:hover { border-color: var(--accent); }
.adm-depot .gf-icone { color: var(--accent); }
.adm-depot__titre { font-weight: 700; color: var(--text-titre); }

/* Encadré (autonomie d'un écran) : filet gauche de 4 px dans le ton, icône et pastille. */
.adm-encadre { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-left: 4px solid var(--adm-ton); border-radius: var(--radius-m); background: var(--surface-page); }
.adm-encadre--ok { --adm-ton: var(--ok); }
.adm-encadre--info { --adm-ton: var(--accent); }
.adm-encadre--attention { --adm-ton: var(--attention); }
.adm-encadre--neutre { --adm-ton: var(--text-muted); }
.adm-encadre__entete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.adm-encadre__icone { color: var(--adm-ton); }
.adm-encadre__titre { flex: 1 1 160px; font-weight: 700; color: var(--text-titre); }
.adm-encadre__detail { margin-top: var(--sp-1); font-size: 14px; line-height: 21px; }
.adm-encadre__note { margin-top: var(--sp-2); font-size: 14px; line-height: 21px; color: var(--text-muted); }

/* Indicateur d'enregistrement. */
.adm-enregistrement { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.adm-enregistrement__etat { display: inline-flex; align-items: center; gap: var(--sp-1); }
.adm-enregistrement__etat--saved .gf-icone { color: var(--ok); }
.adm-enregistrement__etat--error { color: var(--erreur); }
.adm-tourne { animation: adm-tourne 1s linear infinite; }
@keyframes adm-tourne { to { transform: rotate(360deg); } }

/* Adresse du player : texte en chasse fixe du système, coupé par une ellipse, sélectionnable en entier. */
.adm-adresse { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--radius-s); background: var(--surface-clair); }
.adm-adresse__texte { flex: 1; min-width: 0; overflow: hidden; font-size: 14px; line-height: 21px; text-overflow: ellipsis; white-space: nowrap; user-select: all; }

/* Vignette d'un média. */
.adm-vignette { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-s); background: var(--anthracite); color: var(--text-inverse); }
.adm-vignette img { display: block; width: 100%; height: 100%; object-fit: cover; }
.adm-vignette--texte { display: block; background: none; container-type: size; }
.adm-vignette__lecture { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bleu-turquin-ombre); color: var(--text-inverse); }

/* Rendu d'une diapositive texte : même rendu que le player, à l'échelle de son conteneur. Les couleurs sont
   des données de contenu (--adm-fond, --adm-texte), posées par l'API CSSOM. */
.adm-texte { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 7cqmin; overflow: hidden; background: var(--adm-fond); color: var(--adm-texte); font-family: Roboto, "Segoe UI", Arial, sans-serif; text-align: center; }
.adm-texte--gauche { justify-content: flex-start; text-align: left; }
.adm-texte__contenu { max-width: 100%; overflow-wrap: break-word; }
.adm-texte__titre { font-size: 9cqmin; font-weight: 800; line-height: 1.08; white-space: pre-line; }
.adm-texte__corps { font-size: 4.4cqmin; line-height: 1.3; white-space: pre-line; opacity: .92; }
.adm-texte__titre + .adm-texte__corps { margin-top: .7em; }

/* Cadre d'appareil de l'aperçu (fond anthracite, contour bleu turquin ombre). */
.adm-appareil { margin: var(--sp-4) auto 0; overflow: hidden; border-radius: var(--radius-m); background: var(--anthracite); box-shadow: 0 0 0 6px var(--bleu-turquin-ombre); }
.adm-appareil--portrait { height: min(58vh, 460px); max-width: 100%; aspect-ratio: 9 / 16; }
.adm-appareil--landscape { width: calc(100% - 12px); aspect-ratio: 16 / 9; }
.adm-appareil iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Menu d'actions. */
.adm-menu { position: relative; display: inline-flex; }
.adm-menu__liste { position: absolute; top: calc(100% + 4px); right: 0; z-index: 900; min-width: 240px; padding: var(--sp-1) 0; border: 1px solid var(--border); border-radius: var(--radius-m); background: var(--surface-page); box-shadow: var(--shadow-pop); }
.adm-menu__liste--haut { top: auto; right: auto; bottom: calc(100% + 4px); left: 0; }
.adm-barre__pied .adm-menu,
.adm-tiroir__pied .adm-menu { display: flex; }
.adm-menu__action { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 40px; padding: 0 var(--sp-4); border: 0; background: none; font-family: var(--font-corps); font-size: 16px; line-height: 20px; color: var(--text-body); text-align: left; cursor: pointer; }
.adm-menu__action:hover,
.adm-menu__action:focus { background: var(--surface-clair); }

/* Panneau d'envoi des fichiers. */
.adm-envois { position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: 1100; display: flex; flex-direction: column; width: 340px; max-height: 50vh; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface-page); box-shadow: var(--shadow-pop); }
.adm-envois__entete { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2) var(--sp-1) var(--sp-4); }
.adm-envois__titre { font-size: 16px; line-height: 20px; }
.adm-envois__liste { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; padding: 0 var(--sp-4) var(--sp-3); overflow-y: auto; list-style: none; }
.adm-envoi__nom { overflow: hidden; font-size: 14px; line-height: 21px; font-weight: 700; color: var(--text-titre); text-overflow: ellipsis; white-space: nowrap; }
.adm-envoi__etat { display: flex; align-items: flex-start; gap: var(--sp-1); font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-envoi__icone { flex: none; margin-top: 2px; }
.adm-envoi--ok .adm-envoi__etat { color: var(--ok); }
.adm-envoi--attention .adm-envoi__etat { color: var(--attention); }
.adm-envoi--erreur .adm-envoi__etat { color: var(--erreur); }
.adm-progression { display: block; width: 100%; height: 6px; margin: var(--sp-1) 0; overflow: hidden; border: 0; border-radius: var(--radius-pilule); background: var(--border); color: var(--accent); appearance: none; }
.adm-progression::-webkit-progress-bar { border-radius: var(--radius-pilule); background: var(--border); }
.adm-progression::-webkit-progress-value { border-radius: var(--radius-pilule); background: var(--accent); }
.adm-progression::-moz-progress-bar { border-radius: var(--radius-pilule); background: var(--accent); }
.adm-envoi--ok .adm-progression::-webkit-progress-value { background: var(--ok); }
.adm-envoi--ok .adm-progression::-moz-progress-bar { background: var(--ok); }
.adm-envoi--attention .adm-progression::-webkit-progress-value { background: var(--attention); }
.adm-envoi--attention .adm-progression::-moz-progress-bar { background: var(--attention); }
.adm-envoi--erreur .adm-progression::-webkit-progress-value { background: var(--erreur); }
.adm-envoi--erreur .adm-progression::-moz-progress-bar { background: var(--erreur); }

/* Champ couleur. */
.adm-couleur__ligne { display: flex; align-items: center; gap: var(--sp-3); }
.adm-couleur__saisie { flex: none; width: 44px; height: 40px; padding: 2px; border: 1px solid var(--bleu-gris); border-radius: var(--radius-s); background: var(--surface-page); cursor: pointer; }
.adm-couleur__valeur { font-family: ui-monospace, Consolas, monospace; font-size: 14px; color: var(--text-body); }

/* Recherche avec icône. */
.adm-recherche { width: min(100%, 300px); }
.adm-recherche .gf-champ__saisie { padding-left: 40px; }
.adm-recherche__icone { position: absolute; top: 50%; left: 12px; color: var(--text-muted); transform: translateY(-50%); pointer-events: none; }

/* Dialogues. */
.adm-dialogue__formulaire { display: flex; flex-direction: column; min-height: 0; }
.adm-dialogue__texte:not(:last-child) { margin-bottom: var(--sp-4); }
.adm-dialogue__erreur { padding: 0 var(--sp-5) var(--sp-4); }

/* Interrupteur : libellé cliquable. */
.adm-interrupteur__libelle { cursor: pointer; user-select: none; }

/* Tableau qui défile à part ; lien de ligne porté à 24 px de haut (cible). */
.adm-tableau-defilant { overflow-x: auto; border-radius: var(--radius-s); }
.adm-tableau-cartes th a { display: inline-flex; align-items: center; min-height: 24px; }

/* ═══ 5. Vues ══════════════════════════════════════════════════════════════════════════════════════════ */

/* ─── Playlist ─── */
.adm-playlist__etat { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); margin: calc(-1 * var(--sp-3)) 0 var(--sp-5); font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-diffusion { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.adm-diffusion__puce { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2); padding: 2px var(--sp-3) 2px 2px; border: 1px solid var(--border); border-radius: var(--radius-l); color: var(--text-body); }
.adm-diffusion--aucune { color: var(--text-muted); }
.adm-playlist__grille { display: grid; gap: var(--sp-5); }
.adm-playlist__contenu { min-width: 0; }
.adm-outils { margin-bottom: var(--sp-4); }
.adm-outils__boutons { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.adm-outils .adm-aide { margin-top: var(--sp-2); }

.adm-apercu { padding: var(--sp-4); }
.adm-apercu__entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.adm-apercu__titre { font-size: 18px; line-height: 21px; }
.adm-apercu__bascule { display: none; }
.adm-apercu__corps > .adm-radios { margin-top: var(--sp-3); }
.adm-apercu__pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-4); }

.adm-diapos { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.adm-diapo { position: relative; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface-page); transition: border-color .33s ease-in-out, box-shadow .33s ease-in-out; }
.adm-diapo:hover { border-color: var(--border-strong); }
.adm-diapo--choisie { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.adm-diapo--suspendue .adm-diapo__vignette { opacity: .45; }
.adm-diapo--suspendue .adm-diapo__nom { color: var(--text-muted); }
.adm-diapo--hors-periode .adm-diapo__vignette { opacity: .6; }
.adm-diapo--glissee { opacity: .4; }
.adm-diapo--avant::before,
.adm-diapo--apres::after { content: ""; position: absolute; right: var(--sp-2); left: var(--sp-2); height: 3px; border-radius: 3px; background: var(--accent); }
.adm-diapo--avant::before { top: -6px; }
.adm-diapo--apres::after { bottom: -6px; }
.adm-diapo__ligne { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-2); cursor: pointer; }
.adm-diapo__poignee { display: grid; flex: none; place-items: center; width: 24px; height: 40px; color: var(--text-muted); cursor: grab; }
.adm-diapo__poignee:active { cursor: grabbing; }
.adm-diapo__vignette { flex: none; width: 92px; }
.adm-diapo__infos { flex: 1; min-width: 0; }
.adm-diapo__nom { display: block; max-width: 100%; min-height: 24px; padding: 1px 0; border: 0; border-radius: var(--radius-s); background: none; font-family: var(--font-corps); font-size: 16px; line-height: 22px; font-weight: 700; color: var(--text-titre); text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.adm-diapo__nom:hover { text-decoration: underline; }
.adm-diapo__nom--absent { color: var(--text-muted); cursor: default; }
.adm-diapo__meta { font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-diapo__statut { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-2); margin-top: var(--sp-1); font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-diapo__reglages { display: flex; flex: none; align-items: center; gap: var(--sp-3); }
.adm-duree { gap: 2px; }
.adm-duree .gf-champ__libelle { font-size: 12px; line-height: 16px; }
.adm-duree__controle { align-items: center; gap: var(--sp-1); }
.adm-duree__saisie { width: 72px; min-height: 36px; padding: 6px 8px; text-align: right; }
.adm-duree__unite { color: var(--text-muted); }
.adm-duree .gf-champ__erreur { max-width: 220px; }
.adm-diapo__options { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-6); padding: var(--sp-4) var(--sp-4) var(--sp-4) 48px; border-top: 1px solid var(--border-strong); border-radius: 0 0 var(--radius-l) var(--radius-l); background: var(--surface-clair); }
.adm-programmation__dates { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3); }
.adm-programmation__dates .gf-champ__saisie { width: 170px; }
.adm-programmation .gf-champ__erreur { margin-top: var(--sp-2); }

/* Ajout depuis la médiathèque. */
.adm-selection__compteur { margin-bottom: var(--sp-3); font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-selection { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--sp-3); }
.adm-selection__carte { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 6px; border: 2px solid var(--border); border-radius: var(--radius-m); background: var(--surface-page); font-family: var(--font-corps); text-align: left; cursor: pointer; transition: border-color .33s ease-in-out; }
.adm-selection__carte:hover { border-color: var(--bleu-gris); }
.adm-selection__carte[aria-pressed="true"] { border-color: var(--accent); }
.adm-selection__nom { overflow: hidden; font-size: 14px; line-height: 21px; font-weight: 700; color: var(--text-titre); text-overflow: ellipsis; white-space: nowrap; }
.adm-selection__ordre { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--radius-pilule); background: var(--accent); color: var(--text-inverse); font-size: 13px; font-weight: 700; }

/* Éditeur de texte. */
.adm-editeur { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--sp-5); }
.adm-editeur__formulaire { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.adm-modeles { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 6px; }
.adm-modele { width: 44px; height: 40px; border: 1px solid var(--bleu-gris); border-radius: var(--radius-m); background: var(--adm-fond); color: var(--adm-texte); font-family: var(--font-corps); font-size: 16px; font-weight: 700; cursor: pointer; }
.adm-modele[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface-page), 0 0 0 4px var(--text-titre); }
.adm-editeur__couleurs { display: flex; flex-wrap: wrap; gap: var(--sp-5); }
.adm-editeur__apercu { display: flex; flex-direction: column; gap: 6px; }
.adm-texte-apercu { width: 100%; overflow: hidden; border-radius: var(--radius-m); box-shadow: 0 0 0 1px var(--border); aspect-ratio: 9 / 16; container-type: size; }
.adm-texte-apercu--landscape { aspect-ratio: 16 / 9; }

/* ─── Écrans ─── */
.adm-ecrans { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: var(--sp-5); }
.adm-ecran .gf-carte__corps { gap: var(--sp-4); }
.adm-ecran__entete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.adm-ecran__icone { color: var(--accent); }
.adm-ecran__titre { flex: 1 1 120px; min-width: 0; font-size: 18px; line-height: 22px; overflow-wrap: anywhere; }
.adm-etat-ecran { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.adm-etat-ecran__vu { font-size: 14px; color: var(--text-muted); }
.adm-ecran__en-cours { min-height: 21px; margin-top: calc(-1 * var(--sp-2)); font-size: 14px; line-height: 21px; color: var(--text-muted); overflow-wrap: anywhere; }
.adm-ecran__en-cours strong { color: var(--text-body); }
.adm-ecran__appareil { font-size: 14px; line-height: 21px; color: var(--text-muted); overflow-wrap: anywhere; }
.adm-ecran__appareil strong { color: var(--text-body); }
.adm-ecran__pied { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.adm-android { margin-top: var(--sp-5); }
.adm-android .gf-carte__corps { gap: var(--sp-3); }
.adm-android__entete { display: flex; align-items: flex-start; gap: var(--sp-3); }
.adm-android__icone { margin-top: 2px; color: var(--accent-hover); }
.adm-android__titre { font-size: 18px; line-height: 22px; }
.adm-etapes { margin: 0; padding-left: var(--sp-5); font-size: 14px; line-height: 21px; }
.adm-etapes li + li { margin-top: var(--sp-1); }

/* ─── Médiathèque ─── */
.adm-medias__filtres { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); }
.adm-medias__filtres .gf-onglets__liste { flex: 1 1 auto; }
.adm-medias { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: var(--sp-4); }
.adm-media__vignette { position: relative; }
.adm-media__vignette .adm-vignette { border-radius: 0; aspect-ratio: 4 / 3; }
.adm-media__type { position: absolute; top: var(--sp-2); left: var(--sp-2); }
.adm-media__corps { flex: 1; min-width: 0; padding: var(--sp-3) var(--sp-4) var(--sp-1); }
.adm-media__nom { overflow: hidden; font-family: var(--font-corps); font-size: 16px; line-height: 22px; text-overflow: ellipsis; white-space: nowrap; }
.adm-media__infos,
.adm-media__usages { font-size: 14px; line-height: 21px; color: var(--text-muted); }
.adm-media__usages { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-media__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3) var(--sp-3); }

/* ─── Connexion ─── */
body.adm-page-connexion { background: var(--surface-clair); }
.adm-connexion { display: grid; place-items: center; min-height: 100vh; padding: var(--sp-4); }
.adm-connexion__carte { width: 100%; max-width: 400px; padding: 36px; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--surface-page); }
.adm-logo--connexion { margin-bottom: 36px; }
.adm-connexion__titre { margin-bottom: var(--sp-1); }
.adm-connexion__sous-titre { margin-bottom: var(--sp-5); color: var(--text-muted); }
.adm-connexion__info,
.adm-connexion__alerte { margin-bottom: var(--sp-4); }
.adm-mot-de-passe .gf-champ__saisie { padding-right: 48px; }
.adm-mot-de-passe__voir { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); }
.adm-connexion__bouton { width: 100%; margin-top: var(--sp-5); }

/* ─── Écrans étroits, regroupés par seuil ─── */
@media (pointer: coarse) {
  .adm-aide--souris { display: none; }
  .adm-aide--tactile { display: inline; }
}

@media (min-width: 1024px) {
  .adm-coque { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .adm-entete { display: none; }
  .adm-barre { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: var(--sp-5); overflow-y: auto; border-right: 1px solid var(--border); background: var(--surface-page); }
  .adm-barre .adm-nav { flex: 1; }
  .adm-seulement-etroit { display: none; }
}

@media (min-width: 1200px) {
  .adm-playlist__grille { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "contenu apercu"; align-items: start; }
  .adm-playlist__apercu { position: sticky; top: var(--sp-5); grid-area: apercu; }
  .adm-playlist__contenu { grid-area: contenu; }
}

@media (max-width: 1199px) {
  .adm-apercu__bascule { display: inline-flex; }
  .adm-apercu--replie .adm-apercu__corps { display: none; }
}

@media (max-width: 1023px) {
  .adm-page { padding: 0 var(--sp-4) var(--sp-7); }
  .adm-seulement-large { display: none; }
  .adm-entete-vue__actions--principales { width: 100%; }
  .adm-entete-vue__actions--principales > .gf-bouton--primaire { width: 100%; }
  .adm-nav__lien,
  .adm-nav__ecran,
  .adm-menu__action,
  .adm-compte { min-height: 44px; }
  .adm-diapo__ligne { flex-wrap: wrap; }
  .adm-diapo__vignette { width: 64px; }
  .adm-diapo__infos { flex: 1 1 160px; }
  .adm-diapo__nom { display: flex; align-items: center; min-height: 44px; }
  .adm-diapo__reglages { flex: 1 1 100%; flex-wrap: wrap; padding-left: 36px; }
  .adm-duree__saisie { min-height: 44px; }
  .adm-diapo__options { padding-left: var(--sp-4); }
  .adm-couleur__saisie,
  .adm-modele { height: 44px; }
  .adm-mot-de-passe .gf-champ__saisie { padding-right: 52px; }
  .adm-tableau-cartes,
  .adm-tableau-cartes tbody,
  .adm-tableau-cartes tr,
  .adm-tableau-cartes th,
  .adm-tableau-cartes td { display: block; }
  .adm-tableau-cartes thead { display: none; }
  .adm-tableau-cartes tr { margin-bottom: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-l); }
  .adm-tableau-cartes th,
  .adm-tableau-cartes td { padding: 2px 0; border: 0; text-align: left; }
  .adm-tableau-cartes td::before { content: attr(data-libelle) "\00a0: "; font-weight: 700; color: var(--text-titre); }
  .adm-tableau-cartes th a { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (max-width: 767px) {
  .adm-outils__boutons > .gf-bouton--primaire { width: 100%; }
  .adm-editeur { grid-template-columns: 1fr; }
  .adm-editeur__apercu { width: min(100%, 240px); margin-inline: auto; }
  .adm-recherche { width: 100%; }
  .adm-envois { right: var(--sp-2); bottom: var(--sp-2); left: var(--sp-2); width: auto; }
  .adm-notifications { right: var(--sp-4); left: var(--sp-4); width: auto; }
  .adm-ecran__pied { justify-content: flex-start; }
}

@media (min-width: 768px) {
  dialog.adm-tiroir { right: 0; left: auto; width: 360px; border-left: 1px solid var(--border); box-shadow: var(--shadow-pop); }
}
