/* SerYOS · correctifs d'interface communs à toutes les pages (lot 2.3).
   Sélecteurs :where() = spécificité nulle : le style propre à chaque page reste prioritaire. */

/* Débordements horizontaux : médias et blocs de code jamais plus larges que l'écran */
:where(img, video, canvas, iframe, embed, object) { max-width: 100%; }
:where(img, video) { height: auto; }
:where(pre) { overflow-x: auto; max-width: 100%; }
:where(body) { overflow-wrap: break-word; }
@media (max-width: 640px) {
  /* un tableau trop large défile dans son propre cadre au lieu d'élargir la page */
  :where(table:not(.sy-pas-de-defilement)) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Focus visible au clavier (les pages qui ont leur propre style le gardent) */
:where(a, button, input, select, textarea, summary, [tabindex], [role="button"]):focus-visible {
  outline: 2px solid #3b82f6; outline-offset: 2px;
}

/* Zones tactiles d'au moins 44 px sur écran tactile */
@media (pointer: coarse) {
  :where(button, [role="button"], select, .sy-btn, .sy-icon, .sy-chip, summary) { min-height: 44px; min-width: 44px; }
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), textarea) { min-height: 44px; }
  :where(label:has(> input[type="checkbox"]), label:has(> input[type="radio"])) { min-height: 44px; display: inline-flex; align-items: center; }
}

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

/* Bandeau d'état (hors ligne, session expirée, serveur lent) et messages */
.sy-etat { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 2147483000;
  max-width: calc(100vw - 32px); box-sizing: border-box; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 14px; background: #111827; color: #f3f6fc; font: 600 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.sy-etat[hidden] { display: none; }
.sy-etat.err { background: #b91c1c; }
.sy-etat.ok { background: #166534; }
.sy-etat a, .sy-etat button { color: #fff; background: rgba(255, 255, 255, .16); border: 0; border-radius: 10px; padding: 0 14px; min-height: 44px;
  display: inline-flex; align-items: center; font: inherit; text-decoration: none; cursor: pointer; }
.sy-etat-haut { top: calc(10px + env(safe-area-inset-top)); bottom: auto; }
@media (prefers-color-scheme: light) { .sy-etat:not(.err):not(.ok) { background: #1f2937; } }
