/* Pile de profils visités : colonne flottante à gauche du profil perso.
   N'apparaît que sur la page profil quand un compte est ouvert. */

:root {
  --profile-stack-width: 460px;
  --profile-stack-gap: 14px;
}

.profile-stack {
  position: fixed;
  right: 16px;
  top: 16px;
  width: var(--profile-stack-width);
  height: calc(100vh - 16px);
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-stack.is-open {
  pointer-events: all;
  opacity: 1;
}

/* Quand la pile est ouverte, le profil perso rétrécit côté droit pour laisser
   la colonne du compte visité visible à droite (le profil reste à gauche). */
body.profile-stack-open[data-page="profile"] .floating-panel {
  width: calc(100vw - var(--nav-width) - var(--profile-stack-width) - var(--profile-stack-gap) - 16px);
  transition: width 0.28s ease;
}

.profile-stack__panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--panel-radius, 38px) var(--panel-radius, 38px) 0 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transform: translateX(12px);
  opacity: 0;
  transition: transform 0.26s ease, opacity 0.26s ease;
}

.profile-stack__panel.is-in {
  transform: translateX(0);
  opacity: 1;
}

/* Barre supérieure : retour / nom / fermer */
.profile-stack__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  flex: 0 0 auto;
}

.profile-stack__back,
.profile-stack__expand,
.profile-stack__close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #000;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.15s ease;
}

.profile-stack__back:hover,
.profile-stack__expand:hover,
.profile-stack__close:hover { opacity: 0.6; }

.profile-stack__close { font-size: 24px; }

.profile-stack__expand img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.profile-stack__back-spacer { width: 32px; }

.profile-stack__bar-name {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Le contenu hérite des styles account-sheet (head, stats, grille, etc.) */
.profile-stack__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  padding-top: 8px;
}

.profile-stack__scroll::-webkit-scrollbar { display: none; }

/* Avatar un peu plus compact dans la colonne étroite */
.profile-stack__panel .account-sheet__avatar {
  width: 120px;
  height: 120px;
}

.profile-stack__panel .account-sheet__head { max-width: 100%; gap: 16px; }
.profile-stack__panel .account-sheet__actions { max-width: 100%; }
.profile-stack__panel .account-sheet__cells {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
