/* guibs:/public/css/styles.css */

:root {
  --bg-app: #ffffff;
  --bg-sidebar: #f9f9f9;
  --bg-main: #ffffff;
  --bg-hover: #ececec;
  --bg-active: #e9e9e9;
  --bg-chip: #f1f1f1;
  --bg-menu-danger: #fde8e8;
  --bg-login: #ffffff;

  --text-main: #0f0f0f;
  --text-muted: #6b6b6b;
  --text-soft: #8b8b8b;
  --text-danger: #d93025;

  --border-soft: #e7e7e7;
  --border-input: #dddddd;
  --border-menu: #ebebeb;

  --shadow-composer: 0 8px 26px rgba(0, 0, 0, 0.08);
  --shadow-floating: 0 12px 32px rgba(0, 0, 0, 0.14);
  --shadow-login: 0 1px 3px rgba(0, 0, 0, 0.04);

  --sidebar-width: 260px;
  --composer-width: 760px;

  --font-main: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-main);
}

body {
  overflow: hidden;
}

img,
svg {
  display: block;
  max-width: 100%;
}

input,
textarea,
button {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: none;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#app,
.app-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background: var(--bg-app);
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sidebar__top {
  flex: 0 0 auto;
  padding: 10px 12px 6px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 600;
  user-select: none;
}

.sidebar__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 13px;
  line-height: 1;
  flex: 0 0 18px;
}

.sidebar__brand-text,
.sidebar__brand-name {
  line-height: 1;
}

.sidebar__nav {
  flex: 0 0 auto;
  padding: 0 12px 6px;
}

.sidebar__nav-item,
.sidebar__nav-btn,
#newProjectBtn,
#newChatBtn,
#searchChatsBtn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar__nav-item:hover,
.sidebar__nav-btn:hover,
#newProjectBtn:hover,
#newChatBtn:hover,
#searchChatsBtn:hover {
  background: var(--bg-hover);
}

.sidebar__nav-btn.is-active,
.sidebar__nav-btn[aria-current="page"] {
  background: var(--bg-active);
  font-weight: 600;
}

.sidebar__nav-btn[aria-disabled] {
  opacity: 0.55;
}

.sidebar__nav-btn--live {
  position: relative;
  margin-top: 2px;
  padding-right: 42px;
}

.sidebar__nav-btn--live:hover {
  background: var(--bg-hover);
}

.sidebar__nav-btn--live .sidebar__nav-icon {
  font-size: 15px;
}

.sidebar__nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  color: #222;
  flex: 0 0 18px;
}

.sidebar__nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar__nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 400;
}

.sidebar__search-row {
  display: none;
}

.sidebar__search {
  width: calc(100% - 0px);
  height: 38px;
  margin: 8px 0 4px;
  padding: 0 12px;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  outline: none;
  background: #ffffff;
  color: var(--text-main);
}

.sidebar__search::placeholder {
  color: #8d8d8d;
}

/* =========================
   CONNEXION RAPIDE / IDENTITY
========================= */

.quick-login {
  flex: 0 0 auto;
  margin: 6px 12px 8px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: var(--bg-login);
  box-shadow: var(--shadow-login);
}

.quick-login__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-login__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.quick-login__badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef6ee;
  color: #1d6f42;
  font-size: 11px;
  font-weight: 600;
}

.quick-login__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-login__input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
}

.quick-login__input::placeholder {
  color: #8d8d8d;
}

.quick-login__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.quick-login__hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-soft);
}

.sidebar__identity {
  margin: auto 12px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.sidebar__identity label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.sidebar__identity input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-input);
  border-radius: 12px;
  outline: none;
  background: #ffffff;
}

.sidebar__identity-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

#saveIdentityBtn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  cursor: pointer;
  font-size: 13px;
}

.identity-badge {
  background: #16a34a;
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.identity-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-soft);
}

.identity-hint.is-connected {
  background: #dff7e8;
  color: #166534;
  border: 1px solid #b7ebc8;
  border-radius: 10px;
  padding: 8px 10px;
}

/* =========================
   SECTIONS / LISTES
========================= */

.sidebar__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 12px 14px;
}

.sidebar__section + .sidebar__section {
  margin-top: 14px;
}

.sidebar__section-header {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 4px;
}

.sidebar__section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  user-select: none;
}

.sidebar__section-toggle:hover {
  background: var(--bg-hover);
}

.sidebar__section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
}

.sidebar__section-arrow {
  font-size: 14px;
  color: #6f6f6f;
  transition: transform 0.15s ease;
}

#projectsToggleBtn[aria-expanded="true"] .sidebar__section-arrow,
#recentToggleBtn[aria-expanded="true"] .sidebar__section-arrow {
  transform: rotate(90deg);
}

.sidebar__section-body[hidden] {
  display: none;
}

.sidebar__list,
#projectList,
#projectRecentList,
#chatList {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__list-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar__list-entry:hover {
  background: var(--bg-hover);
}

.sidebar__list-entry.is-active {
  background: var(--bg-active);
  font-weight: 600;
}

.sidebar__list-entry-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__list-entry-icon {
  width: 22px;
  display: flex;
  justify-content: center;
}

.sidebar__list-entry-icon svg {
  width: 18px;
  height: 18px;
}

.empty-list {
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text-muted);
}

/* =========================
   MENUS 3 POINTS
========================= */

.sidebar__list-entry--project,
.sidebar__list-entry--chat {
  position: relative;
}

.sidebar__item-menu-trigger {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: transparent;
  color: #595959;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.15s ease;
}

.sidebar__list-entry:hover .sidebar__item-menu-trigger {
  opacity: 1;
}

.sidebar__item-menu-trigger:hover {
  background: var(--bg-hover);
  color: #111;
}

.sidebar__nav-btn--live .sidebar__item-menu-trigger {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
}

.sidebar__nav-btn--live:hover .sidebar__item-menu-trigger,
.sidebar__nav-btn--live:focus-within .sidebar__item-menu-trigger {
  opacity: 1;
  pointer-events: auto;
}

.sidebar__item-menu-dots {
  font-size: 14px;
}

/* =========================
   HEADER
========================= */

.main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 18px 24px 8px;
  display: flex;
  justify-content: space-between;
}

.chat-header__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.chat-header__title-main {
  font-weight: 700;
}

.chat-header__title-date {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-header__meta {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.connected-users {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.connected-pill {
  background: var(--bg-chip);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.connected-pill.muted {
  opacity: 0.6;
}

/* =========================
   MESSAGES
========================= */

.messages {
  flex: 1;
  overflow-y: auto;
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 24px 150px;
}

.message {
  position: relative;
  max-width: 760px;
  margin: 0 auto 22px;
}

.message-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.message-head strong {
  color: var(--text-main);
  font-weight: 700;
}

.message-head__right {
  display: flex;
  gap: 8px;
}

.message-body {
  position: relative;
  font-size: 15px;
  line-height: 1.6;
}

.message.mine .message-body {
  background: var(--bg-chip);
  width: 560px;
  min-height: 64px;
  padding: 16px 70px 16px 22px;
  border-radius: 18px;
}


.message.is-ai .message-body {
  background: #f4f7ff;
  width: 560px;
  min-height: 64px;
  padding: 16px 70px 16px 22px;
  border-radius: 18px;
}

/* bouton copier façon ChatGPT : en haut à droite de la bulle */
.message-copy-trigger {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
  color: #3f3f46;
  opacity: 0.9;
  cursor: pointer;
}
.message-copy-trigger:hover {
  background: rgba(0, 0, 0, 0.045);
  color: #111111;
  opacity: 1;
}

.message-copy-trigger svg {
  width: 28px;
  height: 28px;
}


.message-copy-trigger::after {
  content: "Copier";
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  padding: 6px 8px;
  border-radius: 7px;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.message-copy-trigger:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* bouton ... message */
.message-menu-trigger {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  opacity: 0;
}

.message:hover .message-menu-trigger {
  opacity: 1;
}

.message-menu-trigger:hover {
  background: var(--bg-hover);
}

/* =========================
   HOME / PROJECT EMPTY
========================= */

.sensi-home,
.project-home {
  min-height: calc(100vh - 230px);
  padding: 48px 24px 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sensi-home-title {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text-main);
}

.sensi-home-subtitle {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.project-home__icon {
  width: 54px;
  height: 54px;
  margin-bottom: 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--bg-chip);
  font-size: 26px;
}

.project-home h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-home p {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 15px;
}
/* =========================
   COMPOSER CHATGPT-LIKE
========================= */

.composer {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  width: min(var(--composer-width), calc(100% - 48px));
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  border: none;
  background: transparent;
  box-shadow: none;
}

.composer__inner {
  min-height: 56px;
  padding: 8px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--border-input);
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow-composer);
}

.composer__input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  max-height: 220px;
  padding: 9px 6px;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  background: transparent;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.45;
}

.composer__input::placeholder {
  color: #8a8a8a;
}

.composer__input:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.composer__button,
.composer__send {
  width: 38px;
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  cursor: pointer;
}

.composer__button {
  background: transparent;
  color: #111111;
}

.composer__button:hover {
  background: var(--bg-hover);
}

.composer__button svg,
.composer__send svg {
  width: 20px;
  height: 20px;
}

.composer__button--add span {
  display: block;
  transform: translateY(-1px);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.composer__send {
  background: #111111;
  color: #ffffff;
}

.composer__send:hover {
  background: #222222;
}

.composer__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.composer__send.is-voice-mode {
  background: transparent;
  color: #111111;
}

.composer__send.is-voice-mode:hover {
  background: var(--bg-hover);
}

.composer__send.is-send-mode {
  background: #111111;
  color: #ffffff;
}

/* =========================
   STATES / STATUS
========================= */

.empty-state,
.loading-state {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.empty-state[hidden],
.loading-state[hidden] {
  display: none;
}

.status-bar {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
}

.status-bar.error {
  color: var(--text-danger);
}

/* =========================
   FLOATING MENUS
========================= */

.projects-popover[hidden],
.chat-actions-menu[hidden],
.project-actions-menu[hidden],
.message-actions-menu[hidden] {
  display: none;
}

.projects-popover,
.chat-actions-menu,
.project-actions-menu,
.message-actions-menu {
  z-index: 3000;
}

.projects-popover__inner,
.chat-actions-menu__inner,
.project-actions-menu__inner,
.message-actions-menu__inner {
  padding: 6px;
  border: 1px solid var(--border-menu);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-floating);
}

.chat-actions-menu__item,
.project-actions-menu__item,
.message-actions-menu__item {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  white-space: nowrap;
}

.chat-actions-menu__item:hover,
.project-actions-menu__item:hover,
.message-actions-menu__item:hover {
  background: var(--bg-hover);
}

.chat-actions-menu__item--danger,
.project-actions-menu__item--danger,
.message-actions-menu__item--danger {
  color: var(--text-danger);
}

.chat-actions-menu__item--danger:hover,
.project-actions-menu__item--danger:hover,
.message-actions-menu__item--danger:hover {
  background: var(--bg-menu-danger);
}

/* =========================
   LIVE
========================= */

.live-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.live-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-soft);
}

.live-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.live-header p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.live-header__subtitle {
  color: var(--text-soft);
}

.live-presence-card {
  min-width: 180px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: #ffffff;
}

.live-presence-card__title {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.live-users {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.live-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 120px;
}

.live-message {
  max-width: 760px;
  margin: 0 auto 16px;
}

.live-message.mine {
  text-align: right;
}

.live-message.is-ai .live-message__body {
  background: #f4f7ff;
}

.live-message.is-system {
  opacity: 0.7;
  font-style: italic;
}

.live-message__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.live-message__body {
  background: var(--bg-chip);
  border-radius: 16px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.5;
}

/* =========================
   LIVE COMPOSER
========================= */

.live-composer {
  width: min(var(--composer-width), calc(100% - 48px));
  margin: 0 auto 22px;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-input);
  border-radius: 24px;
  background: var(--bg-main);
  box-shadow: var(--shadow-composer);
}

.live-composer input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  outline: none;
  background: transparent;
}

.live-composer button {
  border: none;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  padding: 0 16px;
  cursor: pointer;
}

.live-composer button:hover {
  background: #222222;
}

.live-empty {
  color: var(--text-muted);
  font-size: 14px;
}

/* =========================
   SENSI / STATES
========================= */

.message.is-pending {
  opacity: 0.6;
}

.sidebar__badge {
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
}

/* =========================
   SEARCH MODAL
========================= */

.chat-search-modal[hidden] {
  display: none;
}

.chat-search-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.chat-search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(1px);
}

.chat-search-modal__panel {
  position: relative;
  width: min(1000px, calc(100vw - 420px));
  min-height: 390px;
  max-height: 78vh;
  margin: 92px auto 0;
  overflow: hidden;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.18);
}

.chat-search-modal__header {
  height: 94px;
  padding: 0 62px 0 36px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ededed;
}

.chat-search-modal__input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111111;
  font-size: 27px;
  font-weight: 400;
}

.chat-search-modal__input::placeholder {
  color: #999999;
}

.chat-search-modal__close {
  position: absolute;
  top: 28px;
  right: 30px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #777777;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.chat-search-modal__close:hover {
  background: #f3f3f3;
}

.chat-search-modal__results {
  padding: 14px 14px 18px;
  overflow-y: auto;
  max-height: calc(78vh - 94px);
}

.chat-search-result {
  width: 100%;
  min-height: 84px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.chat-search-result:hover,
.chat-search-result:focus-visible {
  background: #f1f1f1;
  outline: 0;
}

.chat-search-result__icon {
  width: 28px;
  height: 28px;
  color: #111111;
}

.chat-search-result__title {
  display: block;
  margin-bottom: 4px;
  color: #111111;
  font-size: 18px;
  font-weight: 500;
}

.chat-search-result__snippet {
  display: block;
  max-width: 100%;
  color: #666666;
  font-size: 15px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.chat-search-result__date {
  color: #555555;
  font-size: 15px;
  white-space: nowrap;
}

.chat-search-empty {
  padding: 32px 24px;
  color: #777777;
  font-size: 16px;
}
/* =========================
   SCROLLBARS
========================= */

.sidebar__scroll,
.sidebar__inner,
.composer__input,
#messages,
.messages,
.live-messages,
.projects-popover__inner,
.chat-search-modal__results {
  scrollbar-width: thin;
  scrollbar-color: #d0d0d0 transparent;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1080px) {
  :root {
    --sidebar-width: 248px;
    --composer-width: 720px;
  }

  .chat-search-modal__panel {
    width: min(900px, calc(100vw - 80px));
  }
}

@media (max-width: 820px) {
  :root {
    --sidebar-width: 230px;
    --composer-width: 680px;
  }

  .chat-header {
    padding: 16px 18px 8px;
  }

  .messages {
    padding: 18px 18px 150px;
  }

  .sensi-home,
  .project-home {
    padding: 78px 18px 150px;
  }

  .sensi-home-title {
    font-size: 34px;
  }

  .composer {
    bottom: 18px;
    width: calc(100% - 28px);
  }
}

@media (max-width: 680px) {
  body {
    overflow: auto;
  }

  #app,
  .app-shell {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 42vh;
  }

  .main {
    height: calc(100vh - 42vh);
    min-height: 58vh;
  }

  .chat-header {
    flex-direction: column;
  }

  .composer {
    width: calc(100% - 20px);
    bottom: 14px;
  }

  .composer__inner {
    border-radius: 24px;
  }

  .chat-search-modal__panel {
    width: calc(100vw - 24px);
    margin-top: 60px;
  }
}

/* =========================
   LIVE WINDOWS (Messenger style)
========================= */

.live-windows-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2000;
}

.live-window {
  position: fixed;
  width: 300px;
  height: 360px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  transition: all 0.2s ease;
  animation: livePop 0.18s ease;
}

.live-window__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #f5f5f7;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
  font-size: 14px;
  cursor: grab;
}

.live-window__header:active {
  cursor: grabbing;
}

.live-window__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-window__btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
}

.live-window__btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.live-window__body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fafafa;
}

.live-window__empty {
  text-align: center;
  font-size: 13px;
  color: #888;
}

.live-msg {
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.live-msg strong {
  display: block;
  font-size: 12px;
  color: #555;
  margin-bottom: 2px;
}

.live-window__badge {
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
}

.live-window.is-minimized {
  height: 42px;
}

.live-window.is-minimized .live-window__body {
  display: none;
}

@keyframes livePop {
  from {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.live-window__users {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: #fff;
}

.live-window__user,
.live-window__users-empty {
  font-size: 12px;
  color: var(--text-muted);
}

.live-window__title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-window__status {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
  background: #22c55e;
}

.live-window__status--green {
  background: #22c55e;
}

.live-window__status--orange {
  background: #f59e0b;
}

.live-window__status--red {
  background: #ef4444;
}

.live-window__messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-window__composer {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--border-soft);
  background: #fff;
}

.live-window__input {
  flex: 1;
  min-height: 34px;
  max-height: 90px;
  resize: none;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  padding: 8px 12px;
  outline: none;
  font-size: 13px;
}

.live-window__send {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  cursor: pointer;
}

.live-message {
  max-width: 86%;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.live-message.is-mine {
  align-self: flex-end;
  background: #111;
  color: #fff;
}

.live-message__meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  opacity: 0.7;
}

.live-message__body {
  font-size: 13px;
  line-height: 1.4;
}

.live-window.is-minimized .live-window__users,
.live-window.is-minimized .live-window__messages,
.live-window.is-minimized .live-window__composer {
  display: none;
}

.live-window.is-maximized {
  left: calc(var(--sidebar-width) + 24px) !important;
  top: 76px !important;
  right: 24px !important;
  bottom: 24px !important;
  width: auto !important;
  height: auto !important;
}

/* FIX lisibilité messages fenêtre live */
.live-window .live-message {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: #111 !important;
}

.live-window .live-message__body {
  background: #f1f1f1 !important;
  color: #111 !important;
  border-radius: 14px !important;
  padding: 9px 11px !important;
}

.live-window .live-message.is-mine .live-message__body {
  background: #111 !important;
  color: #fff !important;
}

.live-window .live-message__meta {
  color: #555 !important;
}

.live-window .live-message.is-mine .live-message__meta {
  color: #111 !important;
}

/* =========================
   COMPOSER FILE PREVIEW
========================= */

.composer-file-preview {
  position: absolute;
  left: 50%;
  bottom: 88px;
  z-index: 60;
  width: min(var(--composer-width), calc(100% - 48px));
  transform: translateX(-50%);
  pointer-events: auto;
}

.composer-file-preview[hidden] {
  display: none;
}

.composer-files {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.composer-file-card {
  position: relative;
  width: 230px;
  min-height: 72px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 34px 8px 8px;
  border: 1px solid #dedede;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.composer-file-card__thumb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f1f1f1;
  font-weight: 700;
  font-size: 13px;
}

.composer-file-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-file-card__thumb--pdf {
  background: #ffeded;
  color: #d93025;
}

.composer-file-card__thumb--audio {
  background: #eef4ff;
  color: #2563eb;
  font-size: 24px;
}

.composer-file-card__thumb--video {
  background: #f3edff;
  color: #7c3aed;
  font-size: 20px;
}

.composer-file-card__info {
  min-width: 0;
}

.composer-file-card__name {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
}

.composer-file-card__meta {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.composer-file-card__remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.chat-header__user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  font-size: 13px;
}

.chat-header__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.chat-header__user.is-me {
  font-weight: 600;
}

.connected-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f3f3;
  font-size: 13px;
  color: #111;
}

.connected-user-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

.connected-user-pill.is-me {
  font-weight: 600;
}
/* =========================
   IMAGE STUDIO
========================= */

.hidden {
  display: none !important;
}

.image-studio {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.image-studio__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.image-studio__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.image-studio__subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.image-studio__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-hover);
  cursor: pointer;
}

.image-studio__body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
}

.image-studio__panel,
.image-studio__preview {
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  background: var(--bg-main);
  box-shadow: var(--shadow-floating);
}

.image-studio__panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.image-studio__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.image-studio__select,
.image-studio__textarea {
  width: 100%;
  border: 1px solid var(--border-input);
  border-radius: 14px;
  padding: 12px;
  font: inherit;
}

.image-studio__textarea {
  min-height: 150px;
  resize: vertical;
}

.image-studio__generate {
  margin-top: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 16px;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.image-studio__viewer {
  min-width: 0;
}

.image-studio__preview {
  min-height: 420px;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-studio__placeholder {
  text-align: center;
  color: var(--text-muted);
}

.image-studio__placeholder-icon {
  font-size: 42px;
  margin-bottom: 12px;
}

.image-studio__loading {
  width: min(560px, 100%);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 24px;
  background: var(--bg-main);
}

.image-studio__loading-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.image-studio__loading-text {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.image-studio__progress {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-chip);
  overflow: hidden;
}

.image-studio__progress-bar {
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: #111;
  animation: imageStudioProgress 1.4s ease-in-out infinite alternate;
}

@keyframes imageStudioProgress {
  from {
    width: 25%;
  }

  to {
    width: 78%;
  }
}

.image-studio__steps {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.image-studio__step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-studio__step-dot {
  width: 12px;
  height: 12px;
  border: 2px solid #111;
  border-radius: 999px;
}

@media (max-width: 820px) {
  .image-studio__body {
    grid-template-columns: 1fr;
  }
}
/* =========================
   IMAGE GENERATION
========================= */

.message-image-loading,
.message-image-result {
  width: 100%;
  max-width: 820px;

  background: var(--bg-main);
  border: 1px solid var(--border-soft);

  border-radius: 22px;

  overflow: hidden;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

/* =========================
   LOADING
========================= */

.message-image-loading {
  padding: 22px;
}

.message-image-loading__title {
  font-size: 15px;
  font-weight: 700;

  margin-bottom: 8px;
}

.message-image-loading__text {
  color: var(--text-muted);
  font-size: 14px;

  margin-bottom: 18px;
}

.message-image-loading__bar {
  width: 100%;
  height: 10px;

  background: #ececec;

  border-radius: 999px;

  overflow: hidden;
}

.message-image-loading__progress {
  width: 35%;
  height: 100%;

  border-radius: inherit;

  background: linear-gradient(
    90deg,
    #7c5cff,
    #00c2ff
  );

  animation: sensiImageLoading 1.1s infinite ease-in-out;
}

@keyframes sensiImageLoading {
  0% {
    transform: translateX(-120%);
  }

  100% {
    transform: translateX(320%);
  }
}

/* =========================
   GENERATED IMAGE
========================= */

.message-image-result__img {
  display: block;

  width: 100%;
  height: auto;

  background: #f4f4f4;
}

.message-image-result__footer {
  padding: 18px;
}

.message-image-result__prompt {
  font-size: 14px;
  line-height: 1.5;

  margin-bottom: 14px;

  color: var(--text-main);
}

.message-image-result__download {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 10px 16px;

  border-radius: 12px;

  background: #111111;
  color: white;

  text-decoration: none;

  font-size: 14px;
  font-weight: 600;

  transition: opacity 0.2s ease;
}

.message-image-result__download:hover {
  opacity: 0.82;
}

/* =========================
   IMAGE SHARE
========================= */

.message-image-result__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.message-image-result__share {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #f1f1f1;
  color: #111;
  cursor: pointer;
  font-size: 18px;
}

.message-image-result__share:hover {
  background: #e5e5e5;
}

/* =========================
   IMAGE SHARE MODAL
========================= */

.image-share-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.image-share-modal[hidden] {
  display: none;
}

.image-share-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.image-share-modal__content {
  position: relative;
  z-index: 2;
  width: min(560px, calc(100vw - 32px));
  margin: 100px auto 0;
  padding: 30px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18);
}

.image-share-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 24px;
}

.image-share-modal__close:hover {
  background: var(--bg-hover);
}

.image-share-modal__title {
  margin: 0 42px 22px 0;
  font-size: 28px;
  font-weight: 700;
}

.image-share-modal__preview {
  width: 180px;
  max-height: 220px;
  object-fit: cover;
  margin: 0 auto 28px;
  border-radius: 18px;
}

.image-share-modal__actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.image-share-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 76px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 12px;
}

.image-share-action__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 20px;
}

.image-share-action:hover .image-share-action__icon {
  background: #333;
}
.message-image-result__media {
  position: relative;
}

.message-image-result__share {
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.message-image-result__share:hover {
  background: rgba(0, 0, 0, 0.65);
}
.message-image-result__media {
  position: relative;
  display: inline-block;
  width: 100%;
}

.message-image-result__share {
  position: absolute;
  right: 14px;
  bottom: 14px;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.75);

  background: rgba(0, 0, 0, 0.45);
  color: #ffffff;

  font-size: 22px;
  line-height: 1;

  cursor: pointer;

  backdrop-filter: blur(4px);
  z-index: 3;
}.message-image-result__share {
  position: absolute;
  right: 14px;
  bottom: 14px;

  width: 44px;
  height: 44px;

  border: none;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(32, 33, 35, 0.72);

  color: #ffffff;

  cursor: pointer;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  transition:
    background 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;

  z-index: 5;
}

.message-image-result__share:hover {
  background: rgba(80, 80, 82, 0.92);
}

.message-image-result__share:active {
  transform: scale(0.96);
}

.message-image-result__share svg {
  width: 20px;
  height: 20px;

  stroke: #ffffff;
  stroke-width: 2.2;
  fill: none;

  stroke-linecap: round;
  stroke-linejoin: round;
}
.message-image-result__img {
  cursor: zoom-in;
}

.message-image-result__share {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(32, 33, 35, 0.72);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 5;
}

.message-image-result__share:hover {
  background: rgba(80, 80, 82, 0.92);
}

.message-image-result__share svg {
  width: 21px;
  height: 21px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}