/* =================================================================
   NEO — UI PARTAGÉE (contact, footer global, repli de la sidebar,
   écran de connexion). Identique dans les deux workspaces.
   ================================================================= */

/* ═══════════════════════════════════════════════════════════════════
   1 · BOUTON « NOUS CONTACTER » (accueil, coin haut droit)
   ═══════════════════════════════════════════════════════════════════ */
.neo-contact-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-black); background: var(--surface);
  color: var(--color-black);
  font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.neo-contact-btn:hover {
  border-color: var(--color-primary); color: var(--color-primary);
  background: var(--blue-light);
}
html[data-theme="dark"] .neo-contact-btn {
  border-color: var(--border-hover); color: var(--text-1);
}
html[data-theme="dark"] .neo-contact-btn:hover {
  border-color: var(--color-primary); color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   2 · REPLI DE LA SIDEBAR
   Bouton icône (carré arrondi) en tête de sidebar. L'état replié met
   la barre en rail d'icônes : les libellés disparaissent, la géométrie
   du contenu suit via --neo-rail.
   ═══════════════════════════════════════════════════════════════════ */
.neo-rail-toggle {
  width: 24px; height: 32px; flex-shrink: 0;
  display: flex; align-items: flex-start; justify-content: center;
  border: none; border-radius: 0;
  background: transparent; color: #000;
  cursor: pointer; padding: 0;
  transition: opacity var(--dur) var(--ease);
}
.neo-rail-toggle:hover { opacity: 0.7; }
.neo-rail-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* la tête de sidebar accueille logo + bouton */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

/* ─ état replié ─ */
html.neo-rail .sidebar { width: 72px; min-width: 72px; }
html.neo-rail .main-content { margin-left: 72px; }
html.neo-rail #view-agent-workspace { margin-left: 72px; }

html.neo-rail .logo-text,
html.neo-rail .sidebar-label,
html.neo-rail .sidebar-section-label,
html.neo-rail .mt-sidebar-name { display: none; }

html.neo-rail .sidebar-header { justify-content: center; padding-left: 0; padding-right: 0; }
html.neo-rail .logo-mark { display: none; }
html.neo-rail .sidebar-item,
html.neo-rail .sidebar-ai-btn { justify-content: center; padding-left: 0; padding-right: 0; }
html.neo-rail .sidebar-sub { padding-left: 0 !important; }
html.neo-rail .mt-sidebar-cta { margin-left: 8px; margin-right: 8px; }
html.neo-rail .mt-sidebar-cta-inner { justify-content: center; }
html.neo-rail .sidebar-footer,
html.neo-rail .sidebar-onepoint { padding-left: 0; padding-right: 0; justify-content: center; }
html.neo-rail .sidebar-onepoint .onepoint-logo { max-width: 44px; height: auto; }

.sidebar, .main-content, #view-agent-workspace {
  transition: width var(--dur) var(--ease), min-width var(--dur) var(--ease), margin-left var(--dur) var(--ease);
}
.sidebar { overflow-y: auto; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   2 ter · BOUTON « RETOUR SUR NEO »
   Bandeau propre entre l'en-tête de sidebar et la navigation : icône
  « retour » encadrée + libellé aligné sur la navigation, filet en bas.
   ═══════════════════════════════════════════════════════════════════ */
.neo-back {
  display: flex; align-items: center; gap: 12px;
  width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer;
  padding: 12px 12px 12px 28px;
  border-bottom: 1px solid var(--border);
  color: var(--color-black);
  font: var(--type-body-s);
  letter-spacing: 0; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.neo-back:hover { background: var(--blue-50); color: var(--color-primary); }
.neo-back:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.neo-back-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.neo-back-icon svg { transform: translateY(-2px); }
html[data-theme="dark"] .neo-back { color: var(--text-1); }
html[data-theme="dark"] .neo-back:hover { color: var(--color-primary); }

/* sidebar repliée : icône seule, centrée */
html.neo-rail .neo-back { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
html.neo-rail .neo-back-label { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   3 · FOOTER NEO — présent sur toutes les vues
   (le style .proj-footer existe déjà ; on ne redéfinit rien, on se
   contente d'assurer un détachement propre en bas de vue)
   ═══════════════════════════════════════════════════════════════════ */
.view > .proj-footer { margin-top: auto; }
.view-home .proj-footer { margin-top: 8px; }

#view-projects.active { display: flex; flex-direction: column; min-height: 100vh; }
#view-projects .projects-list-view { display: flex; flex: 1; flex-direction: column; min-height: 0; }
#view-projects .projects-list-view > .proj-footer { margin-top: auto; }

.proj-footer {
  margin: 0; padding: 0; background: var(--surface); border-top: 0;
}
.neo-footer-gradient {
  width: 100%; height: 3px; flex-shrink: 0;
  background: var(--color-primary);
}
.neo-footer-content { max-width: 1288px; margin: 0 auto; padding: 48px 24px 32px; }
.proj-footer-links { gap: 48px; margin: 0; }
.proj-footer-links a {
  font-family: var(--font-heading); font-size: 18px; line-height: 30px;
  font-weight: 600; color: #3E3E59;
}
.proj-footer-bottom { margin-top: 40px; padding-top: 24px; }
.proj-footer-logo { height: 34px; opacity: 1; }
.proj-footer-social { gap: 24px; padding-right: 56px; }
.proj-footer-social svg { width: 28px; height: 28px; }
.proj-footer-social img { width: 28px; height: 28px; display: block; }

.proj-footer { width: 100%; margin-left: 0; }
.proj-footer-logo { width: 139px; height: 40px; object-fit: contain; }
.proj-footer-links a:focus-visible,
.proj-footer-social a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; }
html[data-theme="dark"] .proj-footer-links a { color: var(--text-1); }
html.neo-rail .proj-footer { width: 100%; margin-left: 0; }
@media (max-width: 768px) {
  .sidebar { width: 60px !important; min-width: 60px !important; flex-basis: 60px; }
  .main-content { min-width: 0; }
  .proj-footer { width: 100%; margin-left: 0; }
  .neo-footer-content { padding: 24px 16px; display: flex; flex-direction: column; gap: 40px; align-items: flex-end; }
  .proj-footer-links { display: none; }
  .proj-footer-bottom { width: 100%; margin: 0; padding: 0; flex-direction: column; align-items: flex-end; gap: 40px; }
  .proj-footer-logo { width: 139px; height: 40px; }
  .proj-footer-social { padding: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   2 bis · BANDEAU HAUT DU PANNEAU BIBLIOTHÈQUE
   Les contrôles reviennent à la ligne quand la colonne du template rétrécit.
   ═══════════════════════════════════════════════════════════════════ */
.lib-side-top {
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.lib-side-top .workspace-selector,
.lib-side-top .btn-create-agent { flex: 0 0 auto; }
.lib-side-top .btn-create-agent { white-space: nowrap; }
.lib-side-top .user-session { flex: 0 1 auto; min-width: 0; }
.lib-side-top .user-btn { max-width: 100%; }
.lib-side-top .user-info { min-width: 0; }
.lib-side-top .user-name,
.lib-side-top .user-role {
  display: block; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* la langue FR|EN se place en tête de bandeau et ne se comprime pas */
.lib-side-top .lang-switch { flex: 0 0 auto; }
/* panneau étroit : on masque le rôle plutôt que de couper le nom en
   plein milieu — la ligne reste unique et le nom entièrement lisible. */
@media (max-width: 1400px) {
  .lib-side-top .user-role { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   3 bis · FOND DE L'ACCUEIL
   Déclaré ici (feuille partagée, chargée en dernier) pour que les deux
   workspaces rendent exactement le même dégradé. Le mode sombre garde
   la main : html[data-theme="dark"] .view-home est plus spécifique.
   ═══════════════════════════════════════════════════════════════════ */
.view-home {
  padding: 0;
  min-height: 100vh;
  background-color: #FDFDFF;
  background-image:
    radial-gradient(60% 50% at 0% 0%, rgba(163,190,238,0.34), rgba(163,190,238,0) 100%),
    radial-gradient(55% 45% at 100% 30%, rgba(206,205,246,0.32), rgba(206,205,246,0) 100%),
    radial-gradient(55% 45% at 25% 100%, rgba(178,222,244,0.34), rgba(178,222,244,0) 100%),
    linear-gradient(150deg, #F2F7FD 0%, #FFFFFF 45%, #F7F6FE 100%);
  background-repeat: no-repeat;
}

/* ═══════════════════════════════════════════════════════════════════
   4 · ÉCRAN DE CONNEXION — maquette neo
   ═══════════════════════════════════════════════════════════════════ */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  /* Visuel de marque neo. La couleur de fond prend le relais pendant le
     chargement et sur les formats plus larges que l'image. */
  background-color: #FFFFFF;
  background-image: url("assets/login-bg.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
/* Écrans étroits : on recentre sur le sujet pour qu'il reste visible
   derrière la carte plutôt que d'être rogné hors champ. */
@media (max-width: 900px) {
  .login-overlay { background-position: 68% center; }
}
/* filet de dégradé signature en pied d'écran */
.login-overlay::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--gradient-line);
}

/* wordmark « neo » en haut à gauche de la page */
.login-wordmark { position: absolute; top: 30px; left: 40px; width: 190px; height: auto; }

/* logo onepoint en bas à droite */
.login-onepoint {
  position: absolute; right: 44px; bottom: 40px;
  display: block; line-height: 0;
  opacity: 0.9; cursor: pointer;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.login-onepoint img { height: 34px; width: auto; display: block; }
.login-onepoint:hover { opacity: 1; transform: translateY(-1px); }
.login-onepoint:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; border-radius: 4px; }

.login-card {
  position: relative; z-index: 1;
  background: #FFFFFF;
  border: none;
  border-radius: 18px;
  padding: 44px 48px 40px;
  width: 480px; max-width: 92vw;
  box-shadow: 0 24px 70px -24px rgba(24,24,24,0.22), 0 2px 8px rgba(24,24,24,0.05);
  animation: loginCardIn 600ms cubic-bezier(0.16,1,0.3,1) both;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 34px; font-weight: 700; color: var(--color-black);
  letter-spacing: -0.02em; text-align: center; margin-bottom: 8px;
}
.login-subtitle {
  font-size: 14px; color: var(--text-2); text-align: center;
  margin-bottom: 30px; line-height: 1.5;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field { display: flex; flex-direction: column; gap: 8px; }
.login-label {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 600; color: var(--color-black);
  text-transform: none; letter-spacing: 0;
}
.login-input-wrapper { position: relative; display: flex; align-items: center; }
.login-input {
  width: 100%; padding: 12px 44px 12px 14px;
  background: #FFFFFF;
  border: 1px solid #D9DCE3; border-radius: 9px;
  font-family: var(--font-body); font-size: 14px; color: var(--color-black);
  transition: border-color 200ms, box-shadow 200ms;
  outline: none;
}
.login-input::placeholder { color: #9AA0AC; }
.login-input::-ms-reveal, .login-input::-ms-clear { display: none; }
.login-input:focus {
  border-color: var(--color-primary);
  box-shadow: none;
  background: #FFFFFF;
}
.login-input.error { border: 1px solid var(--color-error) !important; box-shadow: none !important; }
.login-eye-btn {
  position: absolute; right: 14px;
  color: var(--text-2); background: none; border: none;
  cursor: pointer; padding: 4px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: color 200ms;
}
.login-eye-btn:hover { color: var(--color-black); }
.login-input.error ~ .login-eye-btn { color: var(--color-error); }
#login-password.error + .login-eye-btn { color: var(--color-error) !important; }

.login-submit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 14px 24px; margin-top: 6px;
  border-radius: var(--radius-pill); border: none; cursor: pointer;
  background: var(--color-primary); color: #FFFFFF;
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
  transition: background 200ms, box-shadow 200ms;
}
.login-submit:hover { background: var(--blue-hover); box-shadow: 0 6px 20px var(--blue-a30); }
.login-submit:disabled { opacity: 0.7; cursor: default; }

.login-or {
  display: flex; align-items: center; gap: 16px;
  margin: 24px 0 20px; color: var(--text-2); font-size: 14px;
}
.login-or::before, .login-or::after {
  content: ''; flex: 1; height: 1px; background: #E3E5EA;
}

.login-help {
  text-align: center; font-size: 14px; color: var(--color-black);
  margin-bottom: 16px;
}
.login-contact {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 13px 24px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-black); background: #FFFFFF;
  color: var(--color-black);
  font-family: var(--font-heading); font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.login-contact:hover {
  border-color: var(--color-primary); color: var(--color-primary);
  background: var(--blue-light);
}

.login-error {
  display: none;
  margin-top: -8px;
  color: var(--color-error);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  text-align: left;
}
.login-error.visible { display: block; animation: loginShake 420ms; }

@media (max-width: 560px) {
  .login-card { padding: 34px 26px 30px; }
  .login-wordmark { top: 20px; left: 22px; font-size: 28px; }
  .login-onepoint { right: 22px; bottom: 22px; height: 26px; }
}


/* ═══════════════════════════════════════════════════════════════════
   5 · SÉLECTEUR DE LANGUE FR | EN — géométrie de base
   (les couleurs/rayons neo sont posés par neo-theme.css)
   ═══════════════════════════════════════════════════════════════════ */
.lang-switch {
  display: inline-flex; align-items: center; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  overflow: hidden; height: 32px; flex-shrink: 0;
}
.lang-opt {
  border: none; background: none; cursor: pointer;
  font-family: var(--font-body); font-size: 12px; font-weight: 600;
  letter-spacing: .03em; color: var(--text-3);
  padding: 0 11px; height: 100%;
  transition: background .15s, color .15s;
}
.lang-opt + .lang-opt { border-left: 1px solid var(--border); }
.lang-opt:hover { color: var(--text-1); }
.lang-opt--on, .lang-opt--on:hover { background: var(--color-primary); color: #fff; }


/* ═══════════════════════════════════════════════════════════════════
   6 · COQUILLE « SITE NEO » — header global, sidebar sous le header,
   footer dans la colonne de contenu.
   Empilement demandé : le header prend toute la largeur et passe
   au-dessus de la sidebar ; la sidebar passe au-dessus du footer
   (le footer reste dans la colonne de contenu, jamais sous la barre).
   ═══════════════════════════════════════════════════════════════════ */

/* ── Header global ── */
.neo-header {
  position: static; width: 100%; height: var(--neo-header-size, 97px);
  overflow: hidden;
  transition: height 200ms ease-out;
  z-index: 300;                     /* au-dessus de la sidebar (100) */
  background: var(--surface);
}
/* Le document défile dans .aw-messages : libérer aussi l'espace du bandeau. */
.neo-header-content, .neo-header-gradient { transform: translateY(calc(var(--neo-header-size, 97px) - 97px)); transition: transform 200ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .neo-header, .neo-header-content, .neo-header-gradient { transition: none; }
}
#view-agent-workspace .aw-msg-agent:has(.amoa-frame) > .aw-msg-avatar { display: none; }
/* la ligne de dégradé signature suit le contenu du header, pleine largeur */
.neo-header-content {
  height: 94px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px 0 36px;
}
.neo-header-gradient {
  width: 100%; height: 3px; flex-shrink: 0;
  background: var(--gradient-line);
}
.neo-header-wordmark {
  width: auto; min-width: 0; height: auto; padding: 0; border: 0; background: transparent;
  display: inline-flex; align-items: center; gap: 20px;
  color: var(--color-black); cursor: pointer;
}
.neo-header-wordmark img { display: block; flex: 0 0 90px; width: 90px; height: auto; }
.neo-header-workspace {
  max-width: 260px; margin: 0; padding-left: 20px; border-left: 1px solid var(--border-hover);
  color: var(--text-2); font-family: var(--font-body);
  font-size: 16px; font-weight: 600; line-height: 22px; white-space: nowrap;
}
.neo-header .neo-contact-btn { height: 44px; box-sizing: border-box; border-width: 1.5px; font-size: 15px; padding: 0 26px; }
html[data-theme="dark"] .neo-header-wordmark { color: var(--text-1); }

/* ── Décalage de la coquille : tout passe sous le header (64 + 4px) ── */
.sidebar { position: sticky; top: 0; bottom: auto; height: 100vh; align-self: flex-start; flex-shrink: 0; border-right: none; }
/* `overflow-x: hidden` sur body (styles.css) en fait un conteneur de défilement
   qui ne défile jamais : le `sticky` ci-dessus restait alors sans effet et la
   sidebar partait avec la page. `clip` coupe pareil le débordement horizontal
   sans créer de conteneur de défilement. */
body { overflow-x: clip; }
.main-content, #view-agent-workspace {
  margin-left: 0;
  padding-top: 0;
  background-image: none;           /* la ligne signature est sur le header */
}
html.neo-rail .main-content, html.neo-rail #view-agent-workspace { margin-left: 0; }
#agent-workspace-root { height: 100vh; }
.ai-panel { top: var(--neo-header-size, 97px); }

/* ── Sidebar façon site neo : plus de logo (il est dans le header),
      bouton de repli seul en tête, champ de recherche dessous ── */
.sidebar-header .logo-mark { display: none; }
.sidebar-header {
  height: 40px; margin: 10px 16px 0; padding: 8px; box-sizing: border-box;
  justify-content: flex-end; border-bottom: none;
}
.neo-side-search {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 16px 12px; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-3);
}
.neo-side-search svg { flex-shrink: 0; }
.neo-side-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--font-body); font-size: 14px; color: var(--text-1);
}
.neo-side-search:focus-within { border-color: var(--color-primary); color: var(--color-primary); }
html.neo-rail .neo-side-search { display: none; }
/* le logo onepoint du bas de sidebar est redondant : le footer le porte */
.sidebar-onepoint { display: none; }

/* ── Footer : structure calquée sur la colonne centrale du site neo ── */
.proj-footer { width: 100%; margin: 0; padding: 0; background: var(--surface); border-top: 0; }
.proj-footer::before { content: none; }
.neo-footer-gradient {
  width: 100%; height: 3px; flex-shrink: 0;
  background: linear-gradient(to right,
    #6EE5FF 0%, #6EE5FF 20%,
    #EBACFF 20%, #EBACFF 40%,
    #C9ADFF 40%, #C9ADFF 60%,
    #9585FF 60%, #9585FF 80%,
    #2D9DFF 80%, #2D9DFF 100%);
}
.neo-footer-content { max-width: 1288px; margin: 0 auto; padding: 48px 24px 32px; }
.proj-footer-links { gap: 48px; margin: 0; }
.proj-footer-links a {
  font-family: var(--font-heading); font-size: 18px; line-height: 30px;
  font-weight: 600; color: #3E3E59;
}
.proj-footer-bottom { margin-top: 40px; padding-top: 24px; }
.proj-footer-logo { width: 139px; height: 40px; object-fit: contain; opacity: 1; }
.proj-footer-social { gap: 24px; padding-right: 56px; }
.proj-footer-social svg { width: 28px; height: 28px; }
.proj-footer-social img { width: 28px; height: 28px; display: block; }
html.neo-rail .proj-footer { width: 100%; margin-left: 0; }
@media (max-width: 768px) {
  .proj-footer { width: 100%; margin-left: 0; }
  .neo-footer-content { padding: 24px 16px; display: flex; flex-direction: column; gap: 40px; align-items: flex-end; }
  .proj-footer-links { display: none; }
  .proj-footer-bottom { width: 100%; margin: 0; padding: 0; flex-direction: column; align-items: flex-end; gap: 40px; }
  .proj-footer-logo { width: 139px; height: 40px; }
  .proj-footer-social { padding: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   8 · PETITS ÉCRANS — correctifs de débordement uniquement
   Aucun effet au-dessus de 768px : le rendu desktop est inchangé.
   Les largeurs fixes (grilles 300–340px, bandeaux sur une ligne) sont
   ramenées à une colonne pour que rien ne sorte de l'écran.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .home-wrap { padding: 12px 16px 40px; gap: 28px; }
  .home-title { font-size: 34px; overflow-wrap: anywhere; }
  .home-stat { min-width: 0; }
  .lib-title { font-size: 32px; overflow-wrap: anywhere; }

  .neo-header-content { padding: 0 16px; }
  .neo-header-workspace { display: none; }
  .neo-header .neo-contact-btn { padding: 9px 16px; font-size: 13px; }

  .content-topbar { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 0; }
  .content-topbar .topbar-right { grid-column: 1; justify-content: flex-start; flex-wrap: wrap; }

  .lib-layout { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 32px; gap: 16px; }
  .lib-side-top { flex-wrap: wrap; }

  .projects-grid { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .workflow-templates { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 0; }
  .workflow-canvas-wrapper { padding: 24px 16px; }
  .mt-history-stats { flex-direction: column; padding: 16px 16px 0; }

  .pilotage-content { padding: 16px 16px 40px; }
  .pil-stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-featured { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px; }
  .dash-featured-right { align-items: flex-start; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .gsa-cgrid { grid-template-columns: minmax(0, 1fr); }
  .gsa-content { padding-left: 16px; padding-right: 16px; }

  .ai-panel.open { width: 100%; min-width: 100%; z-index: 310; }
  .app-shell.ai-open .main-content { margin-right: 0; }
}

@media (min-width: 561px) and (max-width: 768px) {
  .neo-header-content { gap: 16px; padding: 0 20px; }
  .neo-header-wordmark { gap: 16px; }
  .neo-header-wordmark img { flex-basis: 90px; width: 90px; }
  .neo-header-workspace { max-width: 130px; padding-left: 16px; font-size: 14px; line-height: 18px; white-space: normal; }
  .neo-header .neo-contact-btn { padding: 9px 16px; font-size: 13px; }
}

/* Barre latérale compacte (≤ 768px) : mêmes règles que le mode rail replié,
   sinon les titres de section (« AI Copilot ») sont tronqués. */
@media (max-width: 768px) {
  .sidebar-section-label, .mt-sidebar-name { display: none; }
  .sidebar-nav { padding-left: 8px; padding-right: 8px; }
  .mt-sidebar-cta { margin-left: 0; margin-right: 0; }
  .mt-sidebar-cta-inner { justify-content: center; }
  .neo-back { justify-content: center; padding-left: 0; padding-right: 0; gap: 0; }
  .neo-back-label { display: none; }
}

/* Espace d'exécution ≤ 900px : le panneau Configuration est réduit à 48px
   avec ses sections masquées (agent-workspace.css) — il n'afficherait plus
   qu'un titre tronqué. On le retire ; le formulaire prend toute la largeur. */
@media (max-width: 900px) {
  #view-agent-workspace .aw-setup { display: none; }
}

/* Petits écrans Neo AMOA : retirer la coque conversationnelle autour du document. */
@media(max-width:680px){
 #view-agent-workspace .aw-msg-agent{width:100%;max-width:none;gap:0}
 #view-agent-workspace .aw-msg-agent>.aw-msg-avatar{display:none}
 #view-agent-workspace .aw-msg-agent>.aw-msg-bubble{width:100%;max-width:none;min-width:0;padding:0}
 #view-agent-workspace .amoa-frame>.amoa-head{grid-template-columns:minmax(0,1fr);padding:16px;gap:12px}
 #view-agent-workspace .amoa-frame>.amoa-head>.amoa-headactions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start}
 #view-agent-workspace .amoa-frame .amoa-headactions>button{white-space:normal}
 #view-agent-workspace .pv-focus-list{position:static;max-width:none;flex-basis:100%}
 #view-agent-workspace .pv-focus-main{flex-basis:100%}
}

/* Menu Neo : référence Marketing vérifiée le 22/10/2026, Syne 700, 15/20 px.
   Le corps des documents conserve Poppins. */
#sidebar .sidebar-item,
#sidebar .sidebar-item .sidebar-label {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: normal;
}

/* Conserver la sélection du template visible dans le thème sombre. */
html[data-theme="dark"] .agent-card.selected,
html[data-theme="dark"] .agent-card:hover,
html[data-theme="dark"] .workflow-template-card.active,
html[data-theme="dark"] .workflow-template-card:hover { border-color: var(--color-primary); }

/* Rail commun : mêmes cibles et intervalles, y compris au passage des sections.
   Les noms restent accessibles lorsque les libellés sont masqués visuellement. */
html.neo-rail .sidebar-nav { padding-left:14px; padding-right:14px; gap:8px; }
html.neo-rail .sidebar-nav > .sidebar-item,
html.neo-rail .sidebar-settings .sidebar-item {
  position:relative; width:44px; height:44px; min-height:44px; flex:0 0 44px;
  margin:0; padding:0 !important; gap:0; justify-content:center;
}
html.neo-rail #mt-sidebar-cta { margin:0; padding:0 !important; }
html.neo-rail .sidebar-settings { padding-left:14px; padding-right:14px; }
html.neo-rail .sidebar-label {
  display:block; position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip-path:inset(50%); white-space:nowrap;
}
@media(max-width:768px) {
  .sidebar .sidebar-header { margin-left:8px; margin-right:8px; padding-left:0; padding-right:0; justify-content:center; }
  html.neo-rail .sidebar { width:60px; min-width:60px; }
  .sidebar .sidebar-nav, html.neo-rail .sidebar-nav { padding-left:8px; padding-right:8px; gap:8px; }
  .sidebar .sidebar-nav > .sidebar-item, .sidebar-settings .sidebar-item {
    position:relative; width:44px; height:44px; min-height:44px; flex:0 0 44px;
    margin:0; padding:0 !important; gap:0; justify-content:center;
  }
  #mt-sidebar-cta { margin:0; padding:0 !important; }
  .sidebar-settings, html.neo-rail .sidebar-settings { padding-left:8px; padding-right:8px; }
  .sidebar .sidebar-label {
    display:block; position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap;
  }
}
