/* ==========================================================================
   Stellion — nexus : liste des salons, membres, tiroirs mobiles, « Tes nexus »
   Maquettes : Nexus, NexusStellion (tiroir des salons), Membres.
   La même liste de salons sert dans la colonne (ordinateur) et dans le tiroir (mobile).
   ========================================================================== */

/* ---------- Catégorie de salons ---------- */

.st-chan-cat {
  padding: 0 var(--space-1) 0 var(--space-1);
  display: flex;
  align-items: center;
}

.st-chan-cat__toggle {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  box-shadow: none;
  color: var(--text-muted);
  font: inherit;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  cursor: pointer;
}

.st-chan-cat__toggle:hover {
  color: var(--text);
  filter: none;
  transform: none;
  box-shadow: none;
}

.st-chan-cat__toggle > svg {
  flex-shrink: 0;
  transition: transform var(--duration-fast) ease;
}

.st-chan-cat__toggle[aria-expanded="false"] > svg {
  transform: rotate(-90deg);
}

.st-chan-cat__btn {
  width: 40px;
  height: 40px;
}

.category-channels {
  padding: 0 var(--space-2) 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.category-channels[hidden] {
  display: none;
}

/* ---------- Un salon ---------- */

.st-chan {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
}

.st-chan[hidden] {
  display: none;
}

.st-chan__btn {
  flex: 1;
  min-width: 0;
  width: auto;
  min-height: var(--tap-min);
  margin: 0;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  box-shadow: none;
  color: var(--text-muted);
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
}

.st-chan__btn:hover {
  background: var(--surface-2);
  color: var(--text);
  filter: none;
  transform: none;
  box-shadow: none;
}

.st-chan__btn[aria-current="page"] {
  background: var(--selected);
  color: var(--text);
}

.st-chan__icon {
  width: 20px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.st-chan__btn[aria-current="page"] .st-chan__icon {
  color: var(--accent-text);
}

.st-chan__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.st-chan__name,
.st-chan__desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-chan__name {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.st-chan__btn[aria-current="page"] .st-chan__name {
  font-weight: var(--weight-semibold);
}

.st-chan__desc {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.st-chan__flag {
  flex-shrink: 0;
  display: flex;
  color: var(--text-muted);
}

/* Supprimer un salon : visible au survol ou au clavier, pour qui gère le nexus */
.st-chan__del {
  position: absolute;
  right: 2px;
  opacity: 0;
}

.st-chan:hover > .st-chan__del,
.st-chan__del:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .st-chan__del {
    display: none;
  }
}

/* Participants d'un salon vocal, sous son nom */
.voice-channel-users {
  padding-left: 40px;
}

/* ---------- Membres ---------- */

.st-member-group {
  margin: 0;
  padding: var(--space-3) 10px var(--space-1);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.st-member {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.st-member:hover {
  background: var(--surface-2);
  filter: none;
  transform: none;
  box-shadow: none;
}

.st-member[hidden] {
  display: none;
}

.st-member > .st-avatar {
  --avatar-size: 36px;
  --avatar-ring: var(--surface);
}

/* Hors ligne : nom en gris (pas d'opacité, qui ferait tomber le contraste sous 4,5:1) */
.st-member.is-offline .st-row-btn__title {
  color: var(--text-muted);
}

/* ---------- Tiroirs mobiles (salons à gauche, membres à droite) ---------- */

.st-nexus-drawer {
  width: min(338px, 88vw);
  padding-top: env(safe-area-inset-top, 0px);
}

.st-nexus-drawer__head {
  flex-shrink: 0;
  padding: 14px var(--space-2) 10px var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.st-nexus-drawer__who {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-nexus-drawer__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
}

.st-nexus-drawer__meta {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.st-nexus-drawer__meta:empty {
  display: none;
}

.st-nexus-drawer__search {
  flex-shrink: 0;
  min-height: 42px;
  margin: 0 var(--space-3) 6px;
  border-radius: var(--radius-md);
}

.st-nexus-drawer__search > input {
  height: 42px;
  font-size: var(--text-md);
}

.st-nexus-drawer__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--space-2) calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
}

/* Grand repère d'un nexus (image ou initiale) */
.st-nexus-mark--xl {
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 14px;
  font-size: var(--text-lg);
}

/* ---------- Zone dangereuse des paramètres du nexus ---------- */

.st-danger-zone {
  margin-top: var(--space-6);
  padding: var(--space-4);
  border: 1px solid var(--danger);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
}

.st-danger-zone[hidden] {
  display: none;
}

.st-danger-zone__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--danger);
}

.st-danger-zone__text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ---------- « Tes nexus » (mobile) ---------- */

/* Écran plein, au-dessus des vues, sous la barre du bas ; affiché avec la classe « open » */
.st-nexus-home {
  position: fixed;
  inset: 0;
  z-index: 450;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--bg);
  display: none;
  flex-direction: column;
}

.st-nexus-home.open {
  display: flex;
}

@media (min-width: 769px) {
  .st-nexus-home.open {
    display: none;
  }
}

.st-nexus-home__head {
  flex-shrink: 0;
  height: 60px;
  padding: 0 var(--space-2) 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.st-nexus-home__title {
  margin: 0;
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-title);
}

.st-nexus-home__new {
  min-height: 40px;
  padding: 0 14px 0 10px;
}

.st-nexus-home__search {
  flex-shrink: 0;
  margin: 0 var(--space-4);
  border-radius: var(--radius-md);
}

.st-nexus-home__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: calc(var(--nav-space) + var(--space-4));
}

.st-nexus-home__label {
  margin: 0;
  padding: 18px var(--space-4) var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.st-nexus-home__tiles {
  padding: 0 var(--space-4);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.st-nexus-tile {
  position: relative;
  min-width: 0;
  width: auto;
  height: 112px;
  margin: 0;
  padding: 0 var(--space-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: none;
  color: var(--text);
  font: inherit;
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.st-nexus-tile:hover {
  border-color: var(--border-strong);
  filter: none;
  transform: none;
  box-shadow: none;
}

.st-nexus-tile__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
}

.st-nexus-tile > .st-nexus-home__dot {
  position: absolute;
  top: 12px;
  right: 12px;
}

.st-nexus-mark--tile {
  width: var(--avatar-lg);
  height: var(--avatar-lg);
  border-radius: 16px;
  font-size: var(--text-lg);
}

.st-nexus-mark--row {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: var(--text-lg);
}

.st-nexus-home__list {
  padding: 0 var(--space-2);
}

.st-nexus-row {
  min-height: 68px;
}

.st-nexus-row[aria-current="true"] {
  background: var(--selected);
}

.st-nexus-home__dot {
  background: var(--text);
}

.st-nexus-home__empty {
  margin: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
