/* Sélecteur d'applications du site (paquet commun). Couleurs propres (--sa-*), claires ou sombres selon
   l'appareil, ou selon data-theme sur <html> (light, dark) comme dans les applications. */
:root {
  --sa-fond: #ffffff; --sa-texte: #0f1b33; --sa-doux: #f1f5fb; --sa-bord: #e2e8f0;
  --sa-accent: #1d4ed8; --sa-teinte: #e8eefb; --sa-ombre: 0 12px 32px rgba(15, 27, 51, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sa-fond: #141d2f; --sa-texte: #e6ecf7; --sa-doux: #1b2638; --sa-bord: #24304a;
    --sa-accent: #8ab4ff; --sa-teinte: #1e2b47; --sa-ombre: 0 12px 32px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  --sa-fond: #141d2f; --sa-texte: #e6ecf7; --sa-doux: #1b2638; --sa-bord: #24304a;
  --sa-accent: #8ab4ff; --sa-teinte: #1e2b47; --sa-ombre: 0 12px 32px rgba(0, 0, 0, .45);
}

[data-selecteur-applications] { display: inline-flex; margin-left: auto; }

.sa-bouton {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: inherit; cursor: pointer;
}
.sa-bouton[hidden] { display: none; }
.sa-bouton:hover, .sa-bouton[aria-expanded="true"] { background: rgba(127, 140, 160, .16); }
.sa-bouton:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: 2px; }
.sa-bouton svg { width: 22px; height: 22px; fill: currentColor; }

.sa-grille {
  position: fixed; z-index: 1000; top: 8px; left: 8px;
  width: min(328px, calc(100vw - 16px)); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px);
  overflow-y: auto; overscroll-behavior: contain; padding: 10px;
  background: var(--sa-fond); color: var(--sa-texte);
  border: 1px solid var(--sa-bord); border-radius: 16px; box-shadow: var(--sa-ombre);
  font: 13px/1.25 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sa-grille *, .sa-bouton { box-sizing: border-box; }
.sa-liste { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.sa-tuile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0;
  padding: 12px 4px 10px; border-radius: 12px; color: inherit; text-decoration: none; text-align: center;
}
.sa-tuile:hover { background: var(--sa-doux); }
.sa-tuile:focus-visible { outline: 2px solid var(--sa-accent); outline-offset: -2px; }
.sa-tuile[aria-current="page"] { background: var(--sa-teinte); color: var(--sa-accent); font-weight: 600; }
.sa-icone {
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
  border-radius: 12px; overflow: hidden;
}
.sa-icone img { width: 48px; height: 48px; display: block; }
.sa-icone.sa-sans-image { background: var(--sa-doux); border: 1px solid var(--sa-bord); color: var(--sa-accent); }
.sa-icone svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sa-initiale { font-size: 22px; font-weight: 700; }
.sa-nom {
  max-width: 100%; overflow: hidden; overflow-wrap: anywhere; hyphens: auto;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
