/* ============================================================
   SMS Platform — loading.css
   Système de chargement : splash, barre de navigation, boutons,
   skeletons, états (vide / erreur / hors ligne), bandeau réseau.

   Le comportement vit dans assets/js/loading.js. Ce fichier ne pose
   AUCUNE couleur en dur hors des voiles : tout lit les jetons de
   app.css (--color-*), donc le mode sombre suit sans une ligne de plus.

   ÉCHELLE DES Z-INDEX (relevée dans le projet avant d'en ajouter) :
     200        bandeaux sticky (compte non vérifié, lecture seule)
     8000–10000 modales des vues, paywall (9000)
     99990      voile d'opération (#loader) et bandeau hors ligne
     99995      barre de navigation (fine, en haut, jamais cliquable)
     99998      smsConfirm / smsAlert — une décision passe devant tout
     99999      toasts
     100000     splash de démarrage — seulement tant qu'il est visible ;
                il passe en `pointer-events:none` dès qu'il commence à
                s'effacer, puis en `display:none`.

   PERFORMANCE : toutes les animations ne touchent que `transform` et
   `opacity` — aucune ne force un recalcul de mise en page.
   ============================================================ */

:root {
  /* Plus soutenu que --color-surface-2 : sur le fond de page (#F8F9FB),
     celui-ci ne se distinguait presque pas — des barres qu'on ne voit pas
     ne disent pas « ça arrive ». Même famille de gris que --color-border. */
  --ss-skel-base      : #E6E9EF;
  --ss-skel-highlight : rgba(255, 255, 255, .7);
  --ss-ease-out       : cubic-bezier(.22, 1, .36, 1);
}
html.dark,
body.dark {
  --ss-skel-base      : #262B40;
  --ss-skel-highlight : rgba(255, 255, 255, .06);
}

/* ══════════════════════════════════════════════════════════════
   1. SPLASH DE DÉMARRAGE
   ══════════════════════════════════════════════════════════════
   Invisible par défaut : c'est `html.ss-splash-on`, posé par loading.js
   dans le <head> AVANT le premier rendu, qui l'affiche. Sans JavaScript,
   la classe n'est jamais posée et l'application s'affiche normalement —
   le splash ne peut pas bloquer une page. */

.ss-splash { display: none; }

html.ss-splash-on .ss-splash {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* Même fond que l'application : pas de flash blanc à la sortie, ni en
     mode sombre (html.dark est posé dans le <head>, avant ce rendu). */
  background: var(--color-bg);
  opacity: 1;
  transition: opacity 400ms ease;
}
/* Pas de défilement de la page derrière le splash. */
html.ss-splash-on,
html.ss-splash-on body { overflow: hidden; }

/* Sortie : l'opacité descend, et les clics passent IMMÉDIATEMENT — le
   splash ne doit jamais retenir un toucher pendant qu'il s'efface. */
html.ss-splash-on .ss-splash.is-leaving {
  opacity: 0;
  pointer-events: none;
}

/* LA CHORÉGRAPHIE — quatre temps, tous en `transform` / `opacity` :
     0 ms     le halo s'ouvre derrière l'emplacement du logo ;
     0–450    le logo entre (fondu, montée de 10 px, 0.85 → 1) ;
     350 ms   la barre de progression apparaît et glisse ;
     700 ms   le logo se met à flotter doucement, le halo à respirer ;
   sortie     l'ensemble s'agrandit à peine en s'effaçant — l'application
              semble « s'ouvrir » depuis le logo au lieu d'apparaître d'un coup.
   Le logo lui-même ne tourne pas, ne change ni de couleur ni de forme :
   le mouvement est porté par son conteneur et par le décor autour. */

.ss-splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  transition: transform 450ms var(--ss-ease-out), opacity 350ms ease;
}
html.ss-splash-on .ss-splash.is-leaving .ss-splash-inner {
  transform: scale(1.06);
  opacity: 0;
}

/* Conteneur du logo : c'est LUI qui flotte, pas l'image. L'entrée du logo
   reste une animation finie dont loading.js attend la fin pour partir —
   une flottaison infinie sur l'image rendrait cette attente impossible. */
.ss-splash-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;               /* le halo reste DERRIÈRE le logo */
  animation: ssFloat 3.2s ease-in-out 700ms infinite;
}

/* Halo : un dégradé radial à la couleur d'accent, très diffus. Il donne de
   la profondeur sans toucher au logo. La décroissance a SIX paliers : avec
   deux ou trois, le passage d'un palier à l'autre se lit comme un bord, et
   sur fond sombre on voit un disque au lieu d'une lueur. */
.ss-splash-halo {
  position: absolute;
  z-index: -1;
  inset: -38%;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(79, 107, 237, .17) 0%, rgba(79, 107, 237, .11) 25%, rgba(79, 107, 237, .06) 45%,
    rgba(79, 107, 237, .025) 62%, rgba(79, 107, 237, .008) 76%, rgba(79, 107, 237, 0) 88%);
  opacity: 0;
  transform: scale(.6);
  animation:
    ssHaloIn 700ms var(--ss-ease-out) forwards,
    ssHaloBreathe 3.2s ease-in-out 700ms infinite;
  pointer-events: none;
}
html.dark .ss-splash-halo,
body.dark .ss-splash-halo {
  background: radial-gradient(closest-side,
    rgba(107, 138, 245, .15) 0%, rgba(107, 138, 245, .095) 25%, rgba(107, 138, 245, .05) 45%,
    rgba(107, 138, 245, .022) 62%, rgba(107, 138, 245, .007) 76%, rgba(107, 138, 245, 0) 88%);
}

@keyframes ssFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes ssHaloIn {
  to { opacity: 1; transform: scale(1); }
}
@keyframes ssHaloBreathe {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.08); opacity: .75; }
}

/* Le logo garde SES proportions : seule la largeur est fixée, la hauteur
   suit (`height:auto`). Aucune couleur, aucun filtre, aucune rotation. */
.ss-splash-logo {
  display: block;
  width: 150px;
  height: auto;
  max-width: 46vw;
  opacity: 0;
  transform: translateY(10px) scale(.85);
  animation: ssLogoEntrance 450ms var(--ss-ease-out) forwards;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
}

@keyframes ssLogoEntrance {
  from { opacity: 0; transform: translateY(10px) scale(.85); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* L'indicateur arrive juste après le logo : l'œil lit d'abord la marque,
   puis comprend que l'application travaille. Une barre fine et
   indéterminée plutôt qu'un rotor : c'est le code des applications
   récentes, et elle se lit comme « ça avance » plutôt que « ça tourne ». */
.ss-splash-bar {
  position: relative;
  width: 132px;
  height: 3px;
  border-radius: 9999px;
  overflow: hidden;
  background: var(--color-border);
  opacity: 0;
  animation: ssFadeIn 300ms ease 350ms forwards;
}
.ss-splash-bar > span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--color-accent) 30%, var(--color-accent) 70%, transparent);
  transform: translateX(-100%);
  animation: ssBarSlide 1.25s cubic-bezier(.65, 0, .35, 1) 350ms infinite;
}
[dir="rtl"] .ss-splash-bar > span { animation-name: ssBarSlideRtl; left: auto; right: 0; }

@keyframes ssBarSlide    { from { transform: translateX(-100%); } to { transform: translateX(240%); } }
@keyframes ssBarSlideRtl { from { transform: translateX(100%);  } to { transform: translateX(-240%); } }

@media (min-width: 768px) {
  .ss-splash-logo { width: 190px; }
  .ss-splash-inner { gap: 36px; }
  .ss-splash-bar { width: 168px; }
}
@media (min-width: 1280px) {
  .ss-splash-logo { width: 220px; }
  .ss-splash-bar { width: 184px; }
}

/* ══════════════════════════════════════════════════════════════
   2. BARRE DE NAVIGATION (entre deux pages)
   ══════════════════════════════════════════════════════════════
   L'application est multi-pages : un clic de menu recharge la page. Le
   splash ne revient pas à chaque clic — ce serait faire attendre
   l'utilisateur à chaque geste. Une barre fine en haut dit simplement
   « la page suivante arrive ». */

.ss-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99995;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
}
.ss-progress-bar {
  height: 100%;
  background: var(--color-accent, #4F6BED);
  box-shadow: 0 0 8px var(--btn-primary-glow, rgba(79,107,237,.3));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
[dir="rtl"] .ss-progress-bar { transform-origin: 100% 50%; }

.ss-progress.is-active { opacity: 1; }
/* Progression « à l'estime » : rapide au début, puis ralentit vers 90 %
   sans jamais l'atteindre — elle ne prétend pas savoir quand le serveur
   répondra. */
.ss-progress.is-active .ss-progress-bar {
  animation: ssProgressTrickle 8s cubic-bezier(.1, .7, .2, 1) forwards;
}
/* Fin sans navigation (téléchargement, requête annulée) : la barre
   s'efface là où elle en est — la ramener à zéro ferait un saut visible. */
.ss-progress.is-done { opacity: 0; }

@keyframes ssProgressTrickle {
  0%   { transform: scaleX(0); }
  10%  { transform: scaleX(.35); }
  40%  { transform: scaleX(.7); }
  100% { transform: scaleX(.92); }
}

/* ══════════════════════════════════════════════════════════════
   3. BOUTONS EN COURS D'ENVOI
   ══════════════════════════════════════════════════════════════
   Deux temps :
   • `ss-lock` est posé TOUT DE SUITE : plus aucun clic ne passe, le double
     envoi est impossible ;
   • `ss-busy` arrive après ~120 ms seulement si la requête dure encore —
     un appel instantané ne fait pas clignoter un rotor.

   LE CONTENU N'EST PAS RÉÉCRIT. Le texte devient transparent et les
   icônes invisibles, le rotor se pose au centre : le bouton garde
   exactement sa taille (aucun décalage de mise en page), et le code des
   vues qui lit ou remplace le libellé du bouton continue de fonctionner. */

.ss-lock {
  pointer-events: none !important;
  cursor: progress !important;
}

/* `position` n'est posée que sur un bouton qui n'en a pas (script) : forcer
   `relative` sur un bouton flottant (`fixed`, `absolute`) le déplacerait. */
.ss-busy--static { position: relative !important; }
.ss-busy {
  -webkit-text-fill-color: transparent !important;
  text-shadow: none !important;
}
.ss-busy > * { visibility: hidden !important; }

/* Le rotor prend la couleur du texte du bouton (`currentColor` reste
   intact : seul le remplissage du texte est rendu transparent). */
.ss-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: .9;
  animation: ssSpin 650ms linear infinite;
  visibility: visible;
}

/* Variante avec texte explicite (data-loading-text) : rotor + libellé,
   comme « ◌ Connexion en cours… ». Le libellé est posé par le script. */
.ss-busy.ss-busy--text {
  -webkit-text-fill-color: currentColor !important;
}
.ss-busy.ss-busy--text > * { visibility: visible !important; }
.ss-busy.ss-busy--text::after { content: none; }
.ss-btn-spin {
  display: inline-block;
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: ssSpin 650ms linear infinite;
  vertical-align: -.15em;
  margin-inline-end: .5em;
  flex-shrink: 0;
}

/* `<input type="submit">` n'a pas de pseudo-éléments : on se contente de
   l'atténuer, le verrou reste le même. */
input.ss-busy {
  -webkit-text-fill-color: currentColor !important;
  opacity: .65;
}

/* ══════════════════════════════════════════════════════════════
   4. CHAMP DE RECHERCHE EN COURS
   ══════════════════════════════════════════════════════════════
   Petit rotor DANS le champ, côté fin de saisie. Un SVG animé en image de
   fond : aucun élément ajouté au DOM, donc aucune mise en page touchée. */

input.ss-input-busy {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%239CA3AF' stroke-opacity='.3' stroke-width='3'/%3E%3Cpath d='M21 12a9 9 0 0 0-9-9' fill='none' stroke='%234F6BED' stroke-width='3' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.7s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 16px 16px !important;
  background-position: right 10px center !important;
  /* Le texte ne passe pas sous le rotor. `border-box` : la largeur du champ
     ne bouge pas, seule la zone de saisie se resserre. */
  padding-inline-end: 34px !important;
  box-sizing: border-box;
}
[dir="rtl"] input.ss-input-busy { background-position: left 10px center !important; }

/* ══════════════════════════════════════════════════════════════
   5. SKELETONS
   ══════════════════════════════════════════════════════════════
   `.ss-sk` est la brique : un bloc gris du thème traversé d'un reflet.
   Le reflet est un pseudo-élément qui se déplace en `transform` — le
   navigateur le compose sans repeindre la page. */

.ss-sk {
  position: relative;
  overflow: hidden;
  display: block;
  background: var(--ss-skel-base);
  border-radius: var(--radius-sm, 6px);
}
.ss-sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--ss-skel-highlight), transparent);
  animation: ssShimmer 1.4s ease-in-out infinite;
}
[dir="rtl"] .ss-sk::after { animation-name: ssShimmerRtl; }

@keyframes ssShimmer    { 100% { transform: translateX(100%);  } }
@keyframes ssShimmerRtl { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

.ss-sk-line   { height: 10px; margin: 6px 0; border-radius: var(--radius-full, 9999px); }
.ss-sk-line.lg{ height: 14px; }
.ss-sk-title  { height: 16px; width: 45%; margin-bottom: 14px; border-radius: var(--radius-full, 9999px); }
.ss-sk-value  { height: 26px; width: 55%; margin: 10px 0 8px; border-radius: var(--radius-sm, 6px); }
.ss-sk-circle { border-radius: 50%; flex-shrink: 0; }

/* Conteneur posé par showSkeleton() : il porte l'annonce d'accessibilité
   et empêche le contenu de sauter pendant le remplacement. */
.ss-sk-wrap { width: 100%; }

/* — Cartes / widgets — */
.ss-sk-grid {
  display: grid;
  gap: var(--space-4, 16px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.ss-sk-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-5, 20px);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.ss-sk-card-foot {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.ss-sk-card-foot .ss-sk { height: 28px; flex: 1; border-radius: var(--radius-md, 10px); }

/* — Statistiques (KPI) — */
.ss-sk-stats {
  display: grid;
  gap: var(--space-4, 16px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr));
}
.ss-sk-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 14px);
  padding: var(--space-4, 16px) var(--space-5, 20px);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.ss-sk-stat-top { display: flex; align-items: center; gap: 10px; }
.ss-sk-stat-top .ss-sk-circle { width: 32px; height: 32px; border-radius: var(--radius-md, 10px); }

/* — Listes / profils — */
.ss-sk-list { display: flex; flex-direction: column; }
.ss-sk-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border-soft);
}
.ss-sk-item:last-child { border-bottom: 0; }
.ss-sk-item .ss-sk-circle { width: 38px; height: 38px; }
.ss-sk-item-body { flex: 1; min-width: 0; }

.ss-sk-profile { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.ss-sk-profile .ss-sk-circle { width: 64px; height: 64px; }

/* — Graphique — */
.ss-sk-chart {
  display: flex;
  align-items: flex-end;
  gap: 4%;
  height: 180px;
  padding: 12px 4px 0;
  border-bottom: 2px solid var(--ss-skel-base);
}
.ss-sk-chart .ss-sk {
  flex: 1;
  border-radius: var(--radius-sm, 6px) var(--radius-sm, 6px) 0 0;
}

/* — Tableaux — */
tr.ss-sk-row td { padding-top: 14px !important; padding-bottom: 14px !important; }
tr.ss-sk-row .ss-sk-line { margin: 0; }

/* — Indicateur discret dans une zone (pagination, rafraîchissement) — */
.ss-area-busy { position: relative; }
.ss-area-busy > * { opacity: .55; transition: opacity 150ms ease; }
.ss-area-busy::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: ssAreaSweep 1s ease-in-out infinite;
}
@keyframes ssAreaSweep {
  from { background-position: -50% 0; }
  to   { background-position: 150% 0; }
}

/* ══════════════════════════════════════════════════════════════
   6. SKELETON AUTOMATIQUE DES « Chargement… » EXISTANTS
   ══════════════════════════════════════════════════════════════
   Les vues écrivent déjà un « Chargement… » dans la zone qu'elles vont
   remplir. loading.js repère ces éléments et leur pose une classe : le
   texte reste dans le DOM (lu par les lecteurs d'écran, remplacé par la
   vue comme avant), il devient seulement invisible, et des barres
   prennent sa place. La vue n'est pas modifiée. */

.ss-auto-skel {
  position: relative !important;
  overflow: hidden !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
}
.ss-auto-skel::before {
  content: '';
  position: absolute;
  pointer-events: none;
}
.ss-auto-skel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--ss-skel-highlight), transparent);
  animation: ssShimmer 1.4s ease-in-out infinite;
}
[dir="rtl"] .ss-auto-skel::after { animation-name: ssShimmerRtl; }

/* Ligne seule (sous-titre de KPI, titre de modale, cellule courte). */
.ss-auto-skel--inline::before {
  top: 50%;
  left: 0;
  width: min(60%, 160px);
  height: .8em;
  margin-top: -.4em;
  border-radius: 9999px;
  background: var(--ss-skel-base);
}
[dir="rtl"] .ss-auto-skel--inline::before { left: auto; right: 0; }

/* Bloc (paragraphe d'attente d'une liste ou d'une modale) : trois lignes. */
.ss-auto-skel--block { min-height: 72px; }
.ss-auto-skel--block::before {
  top: 50%;
  left: 16px;
  right: 16px;
  height: 50px;
  margin-top: -25px;
  background:
    linear-gradient(var(--ss-skel-base) 0 0) 0 0    / 72% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 0 20px / 94% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 0 40px / 48% 10px no-repeat;
}
[dir="rtl"] .ss-auto-skel--block::before {
  background-position: 100% 0, 100% 20px, 100% 40px;
}

/* Cellule de tableau : cinq lignes de trois colonnes, comme un vrai
   tableau qui arrive. */
td.ss-auto-skel--rows { height: 172px; }
td.ss-auto-skel--rows::before {
  top: 16px;
  left: 16px;
  right: 16px;
  height: 140px;
  background:
    linear-gradient(var(--ss-skel-base) 0 0) 0    0     / 26% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 38%  0     / 18% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 100% 0     / 20% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 0    32px  / 32% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 38%  32px  / 14% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 100% 32px  / 16% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 0    64px  / 22% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 38%  64px  / 20% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 100% 64px  / 22% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 0    96px  / 30% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 38%  96px  / 16% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 100% 96px  / 18% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 0    128px / 24% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 38%  128px / 18% 10px no-repeat,
    linear-gradient(var(--ss-skel-base) 0 0) 100% 128px / 20% 10px no-repeat;
}

/* ══════════════════════════════════════════════════════════════
   7. ÉTATS VIDE / ERREUR / HORS LIGNE
   ══════════════════════════════════════════════════════════════ */

.ss-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: var(--space-8, 32px) var(--space-4, 16px);
  color: var(--color-text-secondary);
  font-size: var(--text-sm, .813rem);
  animation: ssFadeIn 200ms ease;
}
td > .ss-state { padding: var(--space-6, 24px) var(--space-2, 8px); }
.ss-state-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.ss-state-icon svg { width: 20px; height: 20px; }
.ss-state--error   .ss-state-icon { background: var(--color-danger-soft);  color: var(--color-danger); }
.ss-state--offline .ss-state-icon { background: var(--color-warning-soft); color: var(--color-warning); }
.ss-state-msg { max-width: 360px; line-height: 1.5; font-weight: 500; color: var(--color-text-secondary); }

.ss-state-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 7px 16px;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-primary);
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm, .813rem);
  cursor: pointer;
  transition: border-color var(--transition-fast, 120ms ease), background var(--transition-fast, 120ms ease);
}
.ss-state-retry:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
.ss-state-retry:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════
   8. BANDEAU HORS LIGNE
   ══════════════════════════════════════════════════════════════ */

.ss-offline {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 10px 12px 10px 16px;
  border-radius: var(--radius-lg, 14px);
  background: #1F2433;
  color: #F1F5F9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  font-size: var(--text-sm, .813rem);
  font-weight: 600;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 250ms var(--ss-ease-out), opacity 200ms ease;
}
.ss-offline.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.ss-offline.is-online { background: var(--color-success, #3D9E6B); color: #fff; }
.ss-offline.is-stale { background: #B45309; color: #fff; }
.ss-offline.is-stale .ss-offline-dot { background: #fff; }
.ss-offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FBBF24;
  flex-shrink: 0;
}
.ss-offline.is-online .ss-offline-dot { background: #fff; }
.ss-offline-msg { min-width: 0; }
.ss-offline-retry {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--radius-md, 10px);
  background: rgba(255, 255, 255, .14);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.ss-offline-retry:hover { background: rgba(255, 255, 255, .22); }
.ss-offline.is-online .ss-offline-retry { display: none; }

/* ══════════════════════════════════════════════════════════════
   COMMUN
   ══════════════════════════════════════════════════════════════ */

@keyframes ssSpin   { to { transform: rotate(360deg); } }
@keyframes ssFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Petits écrans : le splash rétrécit, rien ne déborde. */
@media (max-width: 359px) {
  .ss-splash-logo { width: 130px; }
  .ss-splash-inner { gap: 26px; }
  .ss-splash-bar { width: 112px; }
  .ss-offline { font-size: .75rem; gap: 8px; }
}

/* MOUVEMENT RÉDUIT : on garde un signe de vie, on retire le mouvement.
   Le logo apparaît en fondu simple, les reflets s'arrêtent (les blocs
   restent visibles), les rotors ralentissent fortement plutôt que de
   disparaître — un cercle figé ressemblerait à une page bloquée. */
@media (prefers-reduced-motion: reduce) {
  .ss-splash-logo {
    animation: ssFadeIn 200ms ease forwards;
    transform: none;
  }
  /* Ni flottaison, ni respiration, ni zoom de sortie : un simple fondu. La
     barre continue d'avancer, lentement — elle reste le signe de vie. */
  .ss-splash-mark { animation: none; }
  .ss-splash-halo { animation: ssFadeIn 200ms ease forwards; transform: none; }
  .ss-splash-bar > span { animation-duration: 3s; }
  html.ss-splash-on .ss-splash.is-leaving .ss-splash-inner { transform: none; }
  .ss-busy::after,
  .ss-btn-spin { animation-duration: 3s; }
  .ss-sk::after,
  .ss-auto-skel::after,
  .ss-area-busy::before { animation: none; display: none; }
  .ss-progress.is-active .ss-progress-bar { animation-duration: 16s; }
  html.ss-splash-on .ss-splash { transition-duration: 150ms; }
}
