/* En-tête commun : une grille simple, une identité lisible, puis les actions.
   Les règles restent locales à l'en-tête pour préserver les formulaires et
   l'administration. La marque conserve sa police, sa couleur et ses deux mots
   de même taille, définis dans site.css. */
.app-header {
  min-height: 112px;
  padding-block: 24px;
  gap: 24px 32px;
  flex-wrap: nowrap;
  border-bottom-color: #e5e5e3;
}
.app-header .wordmark {
  flex-shrink: 0;
  gap: 14px;
}
.app-header .brand-mark {
  width: 32px;
  height: 40px;
  padding: 7px 11px;
  border: 1px solid #e1e1de;
  border-radius: 9px;
  background: #f6f6f4;
}
.app-header .wordmark small {
  margin-top: 6px;
  letter-spacing: 0;
}
.site-nav-connected {
  flex: 1 1 0;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
  max-width: 100%;
  margin-left: auto;
}

/* L'avatar et les deux lignes forment un seul lien, avec une cible confortable.
   Le nom peut revenir à la ligne, il n'est jamais masqué ni abrégé. */
.session-account {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 12px;
  min-width: 0;
  max-width: 290px;
  padding: 8px 16px 8px 8px;
  margin-right: 8px;
  border-radius: 10px;
  text-decoration: none;
}
.session-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border: 1px solid #e5e5e1;
  border-radius: 50%;
  background: #f2f2ef;
  color: #53534e;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
}
.session-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.session-identity strong {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.session-caption {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.session-account:hover {
  background: #f6f6f4;
}
.session-account:hover .session-caption {
  color: var(--red);
}

/* Administration et déconnexion partagent les mêmes proportions et états.
   Le cadre discret sépare les actions du lien d'identité sans effet de carte. */
.app-header .session-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 8px;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid #e5e5e3;
  border-radius: 8px;
  background: #fff;
  color: #42423f;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
}
.app-header .session-action:hover {
  border-color: #c9c9c4;
  background: #f6f6f4;
  color: #171717;
}
.app-header .session-action[aria-current="page"] {
  border-color: #ebcacc;
  background: #fdf4f4;
  color: #a71118;
}
.session-logout {
  flex-shrink: 0;
  margin: 0;
}
.session-action svg,
.session-caption svg {
  flex: 0 0 auto;
}
.hero-connected h1 {
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.14;
  letter-spacing: -1.7px;
}

/* La barre passe en deux étages lorsqu'il n'y a plus la place pour le nom
   complet à côté de la marque. L'ordre visuel reste celui du clavier. */
@media (max-width: 960px) {
  .app-header {
    flex-wrap: wrap;
  }
  .site-nav-connected {
    flex-basis: 100%;
    width: 100%;
    margin-left: 0;
    padding-top: 16px;
    border-top: 1px solid #eeeeeb;
  }
  .session-account {
    max-width: none;
    flex: 1;
    padding-left: 0;
  }
}
@media (max-width: 780px) {
  .app-header {
    min-height: 100px;
    padding-block: 20px;
    gap: 18px;
  }
}
@media (max-width: 560px) {
  .site-nav-connected {
    flex-wrap: wrap;
    gap: 10px;
  }
  .session-account {
    flex-basis: 100%;
    margin-right: 0;
    padding-block: 0 8px;
  }
  .app-header .admin-link,
  .session-logout {
    flex: 1 1 auto;
  }
  .session-logout button {
    width: 100%;
  }
  .app-header .session-action {
    padding-inline: 10px;
  }
}
@media (max-width: 380px) {
  .app-header .admin-link,
  .session-logout {
    flex-basis: 100%;
  }
}
