body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background-color: #ffffff;
  color: #1c1c1c;
}

:root {
  --point-color: #000;
  /* noir */
  --size: 2.5px;
  /* plus petits */
}

.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(var(--size) * 3);
}

.loader__element {
  width: calc(var(--size) * 2);
  height: calc(var(--size) * 2);
  border-radius: 50%;
  background-color: #000;
  animation: preloader .6s ease-in-out alternate infinite;
}

.loader__element:nth-child(2) {
  animation-delay: .2s;
}

.loader__element:nth-child(3) {
  animation-delay: .4s;
}

@keyframes preloader {
  100% {
    transform: scale(2);
  }
}

@keyframes glowBorder {
  0% {
    box-shadow: 0 0 0px #ffeb3b75;
  }

  50% {
    box-shadow: 0 0 10px 2px #ffeb3b61;
  }

  100% {
    box-shadow: 0 0 0px #ffeb3b58;
  }
}

.glow-button {
  animation: glowBorder 2s infinite ease-in-out;
  transition: box-shadow 0.3s ease;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 3.5rem;
  /* mode medium */
  background: #fff;
  /* fond blanc */
  border-bottom: 1px solid #fafafa;
  /* liseret gris clair */
}

.header__group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__btn {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.header__btn:hover {
  background: #f1f5f9;
}

.header__title h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.header__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  object-fit: cover;
}

@media (max-width: 767px) {

  body,
  html {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
  }

  /* Ne pas fixer les headers app-header et account-header sur mobile */
  .app-header,
  .account-header {
    position: relative !important;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    z-index: 1;
    transform: none;
  }

  /* Seulement pour les headers de chat (header sans classe spécifique) */
  body:not(.account-page):not(.ui-page) > header:not(.app-header):not(.account-header) {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: #fff;
    z-index: 1000;
    transform: translateZ(0);
    /* hack pour forcer le rendu sur GPU mobile */
  }

  .container {
    padding-top: 0px;
    /* header height + margin */
    flex-grow: 1;
  }

  .intro-container {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    z-index: 999;
    background-color: white;
  }

  .messages {
    margin-top: 60px;
    /* intro-container height */
    padding-bottom: 120px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* pour rendre fluide sur iOS */
  }
  
  .messages > div[style*="background-color"] + .bubble.user,
  .messages > .bubble.user:first-of-type {
    margin-top: 1rem !important;
  }
}

.messages .bubble:last-child {
  margin-bottom: 100px; /* ou adapte selon la hauteur réelle de .input-area */
}

.share-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #ddd;
  background-color: white;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  color: #3D3D3D;
  font-weight: bold;
  transition: all 0.3s ease;
}

/* Rond et centré sur mobile */
@media (max-width: 768px) {
  .share-button {
    padding: 4px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    justify-content: center;
  }

  .share-button .hide-on-mobile {
    display: none;
  }
}


.container {
  display: flex;
  flex-direction: column;
  height: 85vh;
  justify-content: space-between;
  max-width: 700px;
  margin: 0 auto;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 800px;
  width: 100%;
  margin-top: 40px;
  /* Rendre la barre de défilement invisible */
  -ms-overflow-style: none;
  /* Pour les navigateurs IE et Edge */
  scrollbar-width: none;
  /* Pour Firefox */
}

.grid-container::-webkit-scrollbar {
  display: none;
  /* Pour les navigateurs basés sur WebKit (Chrome, Safari) */
}

.card {
  background: var(--grey-1);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  /* Centrer verticalement le texte et le SVG */
  font-size: small;
  font-weight: 500;
  color: var(--grey-6);
}

.input-container {
  min-height: 40px;
}

input[type="text"] {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
}

/* Media Query pour les écrans mobiles */
@media (max-width: 768px) {
  .grid-container {
    display: flex;
    overflow-x: scroll;
    /* Pour activer le défilement horizontal */
    flex-direction: row;
    gap: 10px;
    width: 100%;
    margin-bottom: 0px;
    margin-top: 0px;
  }

  .card {
    display: inline-block;
    /* Permet à l'élément de s'ajuster à son contenu */
    white-space: nowrap;
    /* Empêche le texte de passer à la ligne (facultatif selon besoin) */
    padding: 15px 20px;
    /* Ajoute un peu d'espace autour du texte */
    margin-right: 5px;
    margin-left: 5px;
  }

  .container {
    height: auto;
    /* Ajuste la hauteur en fonction du contenu sur mobile */
  }
}

.messages {
  overflow-y: auto;
  flex-grow: 1;
  padding-top: 20px;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE 10+ */
}

@media screen and (max-width: 768px) {
  #chat.messages {
    height: 80vh;
    overflow-y: auto;
  }
}

/* Cacher scrollbar sur Webkit (Chrome, etc.) */
.messages::-webkit-scrollbar {
  display: none;
}

/* 🟩 En mobile : ajout du padding-right */
@media (max-width: 767px) {
  .messages {
    padding: 10px;
  }
}


.messages::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Edge, Opera */
}

@media (max-width: 767px) {
  .messages {
    padding-bottom: 80px;
    /* ajuste selon la hauteur réelle de .input-area */
  }

}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(130, 130, 130, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #ffffff;
  color: #111827;
  padding: 32px;
  border-radius: 32px;
  width: 100%;
  max-width: 600px;
  /* ← gère la largeur totale raisonnable */
  position: relative;
  margin: auto;
}

@media (max-width: 767px) {
  .modal-content {
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 9999;
  }
  
  .modal-h1 {
    text-align: center;
  }

  .modal-header p.save-text {
    text-align: center;
  }
}

.modal-content h2 {
  font-size: 20px;
  text-align: center;
}

.modal-header {
  display: flex;
  flex-direction: column;
  /* 🔁 empile les éléments verticalement */
  align-items: center;
  /* 🔁 centre horizontalement */
  /* espace entre le h2 et le toggle */
}

.segment-toggle {
  position: relative;
  display: flex;
  align-items: center;
  background-color: #F8F8F8;
  border-radius: 999px;
  padding: 2px;
  font-family: sans-serif;
  width: 180px;
  margin-bottom: 4px;
  margin-top: 12px;

}

.glider {
  position: absolute;
  inset: 4px;
  /* top, right, bottom, left = 2px */
  width: 48%;
  height: auto;
  background-color: #ffffff;
  border-radius: 999px;
  transition: transform 0.3s ease;
  z-index: 0;
}

.segment-toggle button {
  position: relative;
  flex: 1;
  z-index: 1;
  border: none;
  background: none;
  padding: 8px 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #888888;
  transition: color 0.3s;
}

.segment-toggle button.active {
  color: #000;
}

.save-text {
  color: #888888;
  /* équivalent de text-text-secondary */
  font-size: 14px;
  margin-top: 8px;
  line-height: 1.5;
  font-family: sans-serif;
}

.highlight {
  font-weight: bold;
  color: #0062ff;
  /* équivalent de hsl(var(--blue-60)) */
}

.btn-choose {
  display: inline-block;
  text-decoration: none;
  background-color: #e5e7eb;
  color: #000000;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
}

.auto-resize-textarea {
  width: 100%;
  min-height: 40px;
  max-height: 100px;
  overflow-y: auto;
  resize: none;
  padding: 8px;
  font-size: 16px;
  line-height: 1.4;
  box-sizing: border-box;
  border: 1px solid #ffffff;
  border-radius: 4px;
  font-family: inherit;
}

@media (max-width: 768px) {
  .auto-resize-textarea {
    max-height: 40px;
  }
}

.auto-resize-textarea:focus {
  outline: none;
  border-color: #ffffff;
  /* ou une autre couleur douce */
  box-shadow: none;
  /* au cas où un navigateur applique un effet */
}

.bubble {
  background-color: #f1f1f1;
  border-radius: 20px;
  padding: 8px;
  padding-right: 20px;
  width: fit-content;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.5;
}

.bubble.user {
  display: block;
  margin-left: auto;
  margin-right: 0;
  padding-left: 20px;
  padding-top: 8px;
  padding-bottom: 8px;
  background-color: #f1f1f1;
  max-width: 400px;
  margin-bottom: 10px;

  /* ✨ Ajout essentiel pour le retour à la ligne */
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

@media (max-width: 767px) {
  .bubble.user {
    max-width: 80%;
  }
  
  .messages > div[style*="background-color"] + .bubble.user,
  .messages > .bubble.user:first-of-type {
    margin-top: 1rem !important;
  }
}

.bubble.assistant {
  align-self: flex-start;
  background-color: #fFFFFF;
  margin-bottom: 10px;
}

.input-area {
  border-top: 1px solid #ddd;
  border: 1px solid #ddd;
  /* Contour gris de 1px */
  padding: 20px;
  padding-bottom: 10px;
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  gap: 12px;
  border-radius: 40px;
  box-shadow: none;
  margin-bottom: 10px;
  z-index: 20;
  border-width: 2px;
  border-style: solid;
  border-color: #ccc;
  border-bottom-width: 4px;
}

@media (max-width: 767px) {
  .input-area {
    position: fixed;
    padding: 10px;
    bottom: 2px;
    left: 2px;
    right: 2px;
    margin: 4px;
    border-width: 2px;
    border-style: solid;
    border-color: #ccc;
    border-bottom-width: 4px;
    border-radius: 30px;
    box-shadow: none;
    background-color: #fff;
  }
}


.input-box {
  display: flex;
  gap: 10px;

}

.input-box input.input-text {
  padding-left: 0;
}

.bottom-disclaim {
  color: #888;
  /* Gris clair */
  font-size: 10px;
  /* Taille du texte en 10px */
  text-align: center;
  /* Centrer le texte horizontalement */
  margin-bottom: 4px;
}


.input-box input {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid white;
  border-radius: 0px;
  font-size: 15px;
}

.input-box button {
  background-color: black;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
}

.icon-text {
  display: inline-flex;
  /* aligne icône + texte horizontalement */
  align-items: center;
  /* centre verticalement icône et texte */
  gap: 4px;
  font-weight: 600;
  font-size: 12px;
  color: #777777
}

.icon-no-text {
  display: inline-flex;
  /* aligne icône + texte horizontalement */
  align-items: center;
  /* centre verticalement icône et texte */
  gap: 4px;
  color: #777777;
}

.input-text {
  border-color: #ffffff;
  outline: none;
  border: none;
}

.input-text::placeholder {
  color: #aaa;
  /* la couleur que vous voulez */
  opacity: 1;
  /* pour forcer l’opacité sur certains navigateurs */
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: black;
  color: white;
  border: none;
  border-radius: 50%;
  height: 36px;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  cursor: pointer;
  margin-right: 0px;
  padding: 0;
  flex-shrink: 0;
}

.suggestions > span {
  background-color: #ffffff;
  border: 1px solid #ddd;
  padding: 10px 10px;
  border-radius: 30px;
  cursor: pointer;
  margin: 0px;
}

.suggestions {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  /* espace entre les icônes */
  position: relative;
}

.suggestions::before {
  content: '';
  position: absolute;
  right: calc(36px + 12px - 3px); /* Largeur du bouton submit (36px) + gap (12px) - ajustement */
  top: 0;
  bottom: 0;
  width: 50px;
  pointer-events: none;
  z-index: 10;
  background: linear-gradient(to right, transparent 0%, #ffffff 100%);
}

.external-links {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-right: auto;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  /* Masquer la scrollbar sur webkit browsers */
  -ms-overflow-style: none;
  width: 100%;
  max-width: 100%;
  position: relative;
}


.external-links::-webkit-scrollbar {
  display: none;
}

.external-links .icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 6px;
  background: #ffffff;
  border: 2px solid rgba(19, 21, 23, 0.16);
  border-bottom: 4px solid rgba(19, 21, 23, 0.16);
  border-radius: 30px;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  color: rgba(19, 21, 23, 0.8);
  transition: box-shadow 0.2s ease;
}

.external-links .icon-text:hover {
  border-width: 2px !important;
  border-bottom-width: 2px !important;
  /* La couleur de la bordure reste celle définie par le style inline */
}

.external-links .icon-text i[data-lucide],
.external-links .icon-text svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* État par défaut : gris */
.submit-btn {
  margin-left: auto;
  background-color: #ccc;
  color: #fff;
  transition: background-color 0.2s ease;
  cursor: default;
  height: 36px;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 50%;
  padding: 0;
}

/* État “actif” : noir */
.submit-btn.active {
  margin-left: auto;
  background-color: #000;
  cursor: pointer;
}

/* Ordinateur : la position reste en bas */
.intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  /* Garder le contenu en bas sur les grands écrans */
  height: 100%;
  /* Occupation totale de la hauteur de la page */
  text-align: center;
  gap: 10px;
}

/* Mobile : Centrer verticalement */
@media (max-width: 767px) {

  /* Modifier l'intro-container pour le positionner juste au-dessus de l'input-area */
  .intro-container {
    position: fixed;
    /* Fixer l'élément en bas de l'écran */
    bottom: 60px;
    /* Espacement de 10px au-dessus de l'input-area */
    left: 0;
    right: 0;
    padding-top: 10px;
    margin-bottom: 74px;
    text-align: center;
    z-index: 10;
    /* Assurer qu'elle est au-dessus de l'input-area */
    height: auto;
    /* Forcer les enfants à ne pas se déformer */
    align-items: center !important;
  }

  /* FORCER la photo à rester ronde dans le conteneur flex mobile */
  .intro-container .intro-photo {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 auto !important;
    align-self: center !important;
    /* Empêcher toute déformation par le conteneur flex */
    flex-basis: 100px !important;
  }

  .grid-container {
    gap: 0px;
    margin-top: 100px;
  }

  .card {
    margin-left: 12px;
    width: fit-content;
  }
}

/* Photo ronde de 100×100px - FORCER TOUJOURS RONDE */
.intro-photo {
  width: 100px !important;
  height: 100px !important;
  border-radius: 50% !important;
  background-size: 110%;
  background-position: center center;
  background-repeat: no-repeat;
  border: 2px solid rgba(0, 0, 0, 0.15);
  box-sizing: border-box !important;
  overflow: hidden !important;
  /* Forcer la forme ronde même sur mobile */
  aspect-ratio: 1 / 1 !important;
  min-width: 100px !important;
  min-height: 100px !important;
  max-width: 100px !important;
  max-height: 100px !important;
  /* Forcer les dimensions à être identiques */
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  display: block !important;
  /* Empêcher toute déformation */
  object-fit: cover;
  padding: 0 !important;
  margin: 0 auto !important;
  /* Forcer les dimensions même dans flex containers */
  align-self: center !important;
}

/* Media queries pour garantir la forme ronde sur tous les écrans */
@media (max-width: 767px) {
  .intro-photo {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 auto !important;
    align-self: center !important;
  }
}

@media (max-width: 480px) {
  .intro-photo {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 auto !important;
    align-self: center !important;
  }
}

.profil-photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  /* cercle parfait */
  object-fit: cover;
  box-shadow: inset 0 0 0 2px #000;
}

/* Texte plus gros */
.intro-message {
  font-size: 1.75rem;
  /* agrandi (ajustez à 1.5rem, 2rem, etc.) */
  font-weight: bold;
  padding: 0 20px;
}

.intro-message-secondary {
  font-size: 1.2rem;
  /* agrandi (ajustez à 1.5rem, 2rem, etc.) */
  padding: 0 20px;
}


body,
html {
  overflow-x: hidden;
  /* Désactive le défilement horizontal */
  height: 100%;
  /* Assure que le corps prend toute la hauteur de l'écran */
  margin: 0;
  /* Enlève la marge par défaut */
}


@media (max-width: 767px) {
  .hide-on-mobile {
    display: none;
  }
}

@media (max-width: 767px) {
  html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
  }

  .container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 10px;
    padding-bottom: 120px; /* espace suffisant pour input-area */
    box-sizing: border-box;
  }

  .input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background-color: white;
  }

  .intro-container {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 998;
    background: white;
    text-align: center;
    align-items: center !important;
  }

  /* FORCER la photo à rester ronde dans ce conteneur aussi */
  .intro-container .intro-photo {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 auto !important;
    align-self: center !important;
    flex-basis: 100px !important;
  }
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  min-width: 0;
  border-bottom: none;
}

@media (min-width: 768px) {
  .app-header {
    max-width: none;
    margin: 0;
    padding-left: 24px;
    padding-right: 24px;
    justify-content: flex-end;
  }
  
  .app-header__left {
    margin-right: auto;
  }
}

.app-header__logo {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #111827;
  text-decoration: none;
}

.app-header__logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.app-header__logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.app-header__left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
}

.app-header__right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-width: 0;
}

@media (max-width: 768px) {
  .app-header {
    padding: 8px 16px;
    gap: 0.5rem;
  }
  
  .app-header__right {
    gap: 0.5rem;
  }
  
  
  .nav-pill--view {
    padding: 8px 12px;
    font-size: 12px;
    white-space: nowrap;
  }
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-pill--share,

.nav-pill--dark {
  background: #111827;
  color: #ffffff;
}

.nav-pill--dark:hover {
  background: #000000;
}

.nav-pill--light {
  background: #f1f5f9;
  color: #111827;
  border: 1px solid #d1d5db;
}

.nav-pill--light:hover {
  background: #e2e8f0;
}

.nav-pill--profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
  text-decoration: none;
  flex-shrink: 0;
  border: none !important;
}

.nav-pill--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
  text-decoration: none;
  flex-shrink: 0;
  border: none !important;
  background: var(--grey-1);
  color: var(--grey-5);
  transition: background 0.2s ease;
}

.nav-pill--icon:hover {
  background: var(--grey-2);
}

.nav-pill--icon svg,
.nav-pill--icon .link-icon-container {
  width: 18px;
  height: 18px;
  color: var(--grey-5);
}

.nav-pill--icon .link-icon-container svg {
  color: var(--grey-5);
  stroke: var(--grey-5);
}

.nav-pill-profile-image {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: 110%;
  background-position: center center;
  background-repeat: no-repeat;
  box-sizing: border-box;
  overflow: hidden;
  display: block;
}

.nav-pill-profile-image--placeholder {
  background-color: var(--grey-3);
  color: var(--grey-6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.add-knowledge-tooltip {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--ui-color-surface, #ffffff);
  border-radius: 12px;
  padding: 0.5rem;
  border: 1px solid var(--grey-2, #e5e7eb);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  pointer-events: auto;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#profileTooltip {
  z-index: 10001 !important;
  position: absolute !important;
  right: 0 !important;
  left: auto !important;
  top: calc(100% + 0.5rem) !important;
  pointer-events: auto !important;
}

#dashboardProfileTooltip {
  z-index: 99999 !important;
  position: absolute !important;
  pointer-events: auto !important;
}

#profileTooltip[style*="display: flex"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.add-knowledge-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.5rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--grey-5, #6b7280);
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background-color 0.15s ease;
}

.add-knowledge-option:hover {
  background: var(--grey-1, #f9fafb);
}

.add-knowledge-option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--grey-4, #9ca3af);
}

.nav-pill--share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 6px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
  border: 2px solid #374151;
  border-bottom: 4px solid #374151;
  color: #374151;
}

.nav-pill--share svg {
  width: 16px;
  height: 16px;
}

.nav-pill--share-text {
  display: inline;
}


.nav-pill--share:hover {
  border: 2px solid #374151;
  border-bottom: 2px solid #374151;
}

.nav-pill--view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 6px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: box-shadow 0.2s ease;
  border: 2px solid var(--pink-700);
  border-bottom: 4px solid var(--pink-700);
  background: linear-gradient(to bottom, var(--pink-50), var(--pink-200));
  color: var(--pink-700);
}

.nav-pill--view:hover {
  border: 2px solid var(--pink-700);
  border-bottom: 2px solid var(--pink-700);
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.auth-modal.is-open {
  display: flex;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}

.auth-modal__dialog {
  position: relative;
  width: min(92vw, 420px);
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.15);
  padding: 28px;
  z-index: 1;
}

.auth-modal__close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #0f172a;
}

.auth-modal__title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #0f172a;
}

.auth-modal__subtitle {
  margin: 6px 0 0;
  font-size: 0.95rem;
  color: #6b7280;
}

.auth-modal__step {
  display: block;
}

.auth-modal__step--hidden {
  display: none;
}

.auth-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #374151;
}

.auth-input-group {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  overflow: hidden;
  background: #f9fafb;
}

.auth-input-group input {
  flex: 1;
  border: none;
  padding: 12px;
  font-size: 0.95rem;
  background: transparent;
}

.auth-input-group input:focus-visible {
  outline: none;
}

.auth-input-prefix {
  padding-left: 12px;
  padding-right: 6px;
  font-size: 0.9rem;
  color: #9ca3af;
}

.auth-helper {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.auth-error {
  margin: 0;
  font-size: 0.85rem;
  color: #dc2626;
  min-height: 1em;
}

.auth-secondary-link {
  margin-top: 16px;
  background: none;
  border: none;
  color: #4f46e5;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.auth-secondary-link:hover {
  color: #4338ca;
}

.auth-button {
  border: none;
  background-color: #111827;
  color: #ffffff;
  border-radius: 999px;
  padding: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-button:not(:disabled):hover {
  background-color: #000000;
}

.auth-form--hidden {
  display: none;
}

.auth-modal__subtitle--hidden {
  display: none;
}

.auth-divider {
  margin: 20px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #a1a1aa;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider span {
  flex: 1;
  height: 1px;
  background: #e4e4e7;
}

.auth-oauth {
  display: grid;
  gap: 12px;
}

.auth-oauth__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid #d4d4d8;
  background: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-oauth__btn svg {
  display: block;
}

.auth-oauth__btn--google {
  color: #1f2937;
}

.auth-oauth__btn--google:hover {
  background: #f9fafb;
  box-shadow: 0 6px 18px rgba(66, 133, 244, 0.12);
}

.auth-oauth__btn--apple {
  color: #0c0c0d;
}

.auth-oauth__btn--apple:hover {
  background: #0c0c0d;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.auth-feedback {
  display: none;
  border-radius: 12px;
  font-size: 0.87rem;
  padding: 12px;
}

.auth-feedback.is-visible {
  display: block;
}

.auth-feedback[data-tone="success"] {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.auth-feedback[data-tone="error"] {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.auth-slug {
  font-weight: 600;
  color: #111827;
}

.auth-form input {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.95rem;
}

.auth-form input:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 1px;
}

body.modal-open {
  overflow: hidden;
}

/* Space Header */
.space-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    min-height: 64px;
    background-color: var(--ui-color-surface);
    border-bottom: 2px solid var(--grey-2);
    width: 100%;
    box-sizing: border-box;
}

.space-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.space-header__chat-image {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background-size: 110%;
    background-position: center center;
    background-repeat: no-repeat;
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
}

.space-header__chat-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--grey-6);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.space-header__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.space-header__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    gap: 6px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
    border: 2px solid #374151;
    border-bottom: 4px solid #374151;
    color: #374151;
}

.space-header__share-btn:hover {
    border: 2px solid #374151;
    border-bottom: 2px solid #374151;
}

.space-header__share-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.space-header__action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    gap: 6px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
    border: 2px solid var(--pink-700);
    border-bottom: 4px solid var(--pink-700);
    background: linear-gradient(to bottom, var(--pink-50), var(--pink-200));
    color: var(--pink-700);
    cursor: pointer;
    white-space: nowrap;
}

.space-header__action-btn--create:hover,
.space-header__action-btn--manage:hover {
    border: 2px solid var(--pink-700);
    border-bottom: 2px solid var(--pink-700);
}

@media (max-width: 768px) {
    .space-header {
        padding: 14px 16px;
        min-height: 60px;
    }
    
    .space-header__chat-image {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .space-header__chat-name {
        font-size: 15px;
    }
    
    .space-header__action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .space-header__share-btn {
        display: none;
    }
}


