/* Sourcing UGC — ajustements de mise en page pour l'application réelle.
   Tout le style visuel vient des fichiers du designer (design/tokens.css, design/composants.css).
   Ici : seulement ce que les maquettes figées ne règlent pas (hauteurs d'écran, positions fixes, couches flottantes).
   Aucune couleur en dur : uniquement les variables du designer. */

*, *::before, *::after { box-sizing: border-box; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button, input, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
ul { margin: 0; padding: 0; }

/* Coquille : la barre latérale reste en place, le contenu défile. */
#app { min-height: 100vh; }
.sx-main { min-height: 100vh; display: flex; flex-direction: column; }
a.sx-nav__item { text-decoration: none; }

/* Écrans « plein cadre » (Créateurs, Vérification) : le tableau ou la fiche occupe la hauteur restante. */
.ax-plein { height: 100vh; overflow: hidden; }
.ax-plein > .sx-page { flex: 1; min-height: 0; }
.ax-tableau { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.ax-tableau__zone { flex: 1; min-height: 0; overflow: auto; }
.ax-tableau .sx-tablefoot { position: static; }
.sx-seg { overflow: visible; flex-wrap: nowrap; }
.ax-seg-defile { overflow-x: auto; scrollbar-width: none; }

/* Tiroir et voile : fixés à la fenêtre (dans les maquettes ils sont posés sur un cadre). */
.sx-scrim { position: fixed; }
.sx-drawer { position: fixed; max-width: 100vw; }

/* Couche flottante : menus, info de confirmation. */
#sx-flottant { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
#sx-flottant > * { pointer-events: auto; position: absolute; }
.sx-pop { max-height: min(70vh, 520px); overflow: auto; }
.ax-pop-corps { padding: 8px; display: flex; flex-direction: column; gap: var(--space-3); min-width: 260px; }
.ax-toasts { position: fixed !important; left: 50%; bottom: var(--space-6); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-2); align-items: center; }

/* Bandeau d'erreur en tête de page. */
.ax-bandeaux { display: flex; flex-direction: column; gap: var(--space-2); }
.ax-bandeaux:empty { display: none; }

/* Note modifiable dans la ligne : même gabarit que .sx-note. */
input.sx-note { cursor: text; }
input.sx-note:focus { border-color: var(--focus-ring); background: var(--surface); outline: 2px solid var(--focus-ring); outline-offset: -1px; }
.sx-table td .sx-saved { margin-left: 6px; }

/* Vérification : la fiche en deux colonnes défile à l'intérieur de sa carte. */
.ax-verif-col { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); overflow: auto; min-height: 0; }
.ax-verif-col + .ax-verif-col { border-left: 1px solid var(--line); }

/* Réglages : ancres décalées sous le haut de page. */
.sx-settings section { scroll-margin-top: var(--space-6); }
.sx-setting__ctl .sx-inputwrap .sx-input { width: 140px; }
.sx-weights .sx-inputwrap .sx-input { width: 72px; }

/* Écran étroit : hors périmètre du design (1280px et plus), on garde seulement l'outil utilisable. */
/* La barre latérale devient une barre en haut : la navigation et la déconnexion restent à portée (outil à côté d'Instagram). */
@media (max-width: 1100px) {
  .sx-app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .sx-side { position: sticky; top: 0; z-index: 9; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-2) var(--space-4); border-right: 0; border-bottom: 1px solid var(--line-strong); }
  .sx-side__brand { padding: 0 var(--space-3) 0 0; }
  .sx-side__section, .sx-side__crawl, .sx-side__who, .sx-side .sx-avatar { display: none; }
  .sx-side .sx-nav__item { width: auto; }
  .sx-side .sx-nav__count, .sx-side .sx-nav__badge { margin-left: var(--space-1); }
  .sx-side__foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .sx-side__user { border-top: 0; margin: 0; padding: 0; }
  .sx-main, .ax-plein { min-height: 0; }
  .ax-plein { height: calc(100vh - 51px); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
