*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e8eaf0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: #161b27;
  border-bottom: 1px solid #252d3d;
  flex-shrink: 0;
}
header .logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-family: Arial, Helvetica, sans-serif;
}
.logo-kymora {
  color: #ffffff;
}
.logo-io {
  color: #4A90E2;
}
header .subtitle {
  font-size: 0.78rem;
  color: #7a8394;
}

/* ── Layout principal ── */
.main-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Sidebar ── */
#sidebar {
  width: 260px;
  background: #161b27;
  border-right: 1px solid #252d3d;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(.4,0,.2,1);
}
#sidebar.closed { width: 56px; }

/* ── Sidebar top (toggle button) ── */
.sidebar-top {
  display: flex;
  align-items: center;
  padding: 10px 10px 4px;
  flex-shrink: 0;
}

/* ── Sidebar actions (new conv) ── */
.sidebar-actions {
  padding: 4px 10px 8px;
  flex-shrink: 0;
}
#new-conv-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: #c8cfe0;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
}
#new-conv-btn:hover { background: #1e2a40; }
#new-conv-btn .action-icon { flex-shrink: 0; }
#new-conv-btn .action-label { flex: 1; overflow: hidden; text-overflow: ellipsis; transition: opacity 0.2s; }
#new-conv-btn .sidebar-tooltip { display: none; }

/* ── Collapsed state ── */
#sidebar.closed #new-conv-btn .action-label { opacity: 0; width: 0; }
#sidebar.closed #conv-list { opacity: 0; pointer-events: none; }
#sidebar.closed #new-conv-btn:hover .sidebar-tooltip { display: block; }
#sidebar.closed #user-card { padding: 10px 0; justify-content: center; }
#sidebar.closed #user-info,
#sidebar.closed #user-chevron { display: none; }
#sidebar.closed #user-menu { display: none !important; }
#conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
}
.conv-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.conv-item:hover { background: #1e2a40; }
.conv-item.active { background: #1e2a40; border: 1px solid #2a3a58; }
.conv-title {
  flex: 1;
  font-size: 0.82rem;
  color: #a0adc4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item.active .conv-title { color: #e8eaf0; }
.conv-menu-btn {
  background: none;
  border: none;
  color: #3d4f6e;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
  display: none;
  letter-spacing: 1px;
}
.conv-item:hover .conv-menu-btn,
.conv-item.active .conv-menu-btn { display: block; }
.conv-menu-btn:hover { color: #e8eaf0; }

.conv-menu-popup {
  display: none;
  position: absolute;
  right: 0; top: 100%;
  background: #1e2640;
  border: 1px solid #252d3d;
  border-radius: 10px;
  padding: 4px;
  z-index: 200;
  min-width: 150px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.conv-menu-popup.open { display: block; }
.conv-menu-popup button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: none; border: none;
  padding: 8px 12px; border-radius: 7px;
  color: #c8cfe0; font-size: 0.83rem;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s; text-align: left;
}
.conv-menu-popup button:hover { background: #252d3d; color: #e8eaf0; }
.conv-menu-popup button.danger { color: #e05555; }
.conv-menu-popup button.danger:hover { background: rgba(224,85,85,0.1); }

.conv-rename-input {
  flex: 1; background: #1a2035; border: 1px solid #3b4cca;
  border-radius: 6px; padding: 3px 8px; color: #e8eaf0;
  font-size: 0.82rem; font-family: inherit; outline: none;
  min-width: 0;
}

body.light .conv-menu-popup { background: #fff; border-color: #e0e3ef; box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
body.light .conv-menu-popup button { color: #1a1d2e; }
body.light .conv-menu-popup button:hover { background: #f0f2fa; }
body.light .conv-rename-input { background: #f0f2fa; border-color: #3b4cca; color: #1a1d2e; }

/* ── Zone chat ── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Light mode sidebar */
body.light #sidebar { background: #ffffff; border-right-color: #e0e3ef; }
body.light #new-conv-btn { color: #1a1d2e; }
body.light #new-conv-btn:hover { background: #f0f2fa; }
body.light .conv-item:hover { background: #f0f2fa; }
body.light .conv-item.active { background: #e8ecff; border-color: #c8cde8; }
body.light .conv-title { color: #5a6880; }
body.light .conv-item.active .conv-title { color: #1a1d2e; }
body.light #conv-list::-webkit-scrollbar-thumb { background: #c8cde8; }

/* ── User card (bottom of sidebar) ── */
#user-card {
  position: relative;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid #252d3d;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
#user-card:hover { background: #1e2a40; }
#user-avatar {
  width: 34px; height: 34px;
  background: #3b4cca; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  flex-shrink: 0; letter-spacing: 0.5px;
}
#user-info { flex: 1; overflow: hidden; }
#user-display-name {
  font-size: 0.83rem; font-weight: 600; color: #e8eaf0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#user-plan { font-size: 0.7rem; color: #7a8394; margin-top: 1px; }
#user-chevron { color: #5a6880; flex-shrink: 0; }
#user-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px); left: 8px; right: 8px;
  background: #1e2640; border: 1px solid #252d3d;
  border-radius: 12px; padding: 6px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4); z-index: 50;
}
#user-menu.open { display: block; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: #c8cfe0; font-size: 0.85rem;
  transition: background 0.15s;
}
.user-menu-item:hover { background: #252d3d; color: #e8eaf0; }
.user-menu-item.danger { color: #e05555; }
.user-menu-item.danger:hover { background: rgba(224,85,85,0.08); }
.user-menu-sep { border: none; border-top: 1px solid #252d3d; margin: 4px 0; }

body.light #user-card { border-top-color: #e0e3ef; }
body.light #user-card:hover { background: #f0f2fa; }
body.light #user-display-name { color: #1a1d2e; }
body.light #user-plan { color: #7a8394; }
body.light #user-chevron { color: #9aa3c2; }
body.light #user-menu { background: #fff; border-color: #e0e3ef; box-shadow: 0 -8px 24px rgba(0,0,0,0.1); }
body.light .user-menu-item { color: #1a1d2e; }
body.light .user-menu-item:hover { background: #f0f2fa; }
body.light .user-menu-sep { border-top-color: #e0e3ef; }

/* Scrollbar sidebar */
#conv-list::-webkit-scrollbar { width: 6px; }
#conv-list::-webkit-scrollbar-track { background: #0f1117; border-radius: 3px; }
#conv-list::-webkit-scrollbar-thumb { background: #2a3a58; border-radius: 3px; }
#conv-list::-webkit-scrollbar-thumb:hover { background: #3b4cca; }

/* ── Chat area ── */
#chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 860px;
  width: 100%;
}
.msg.user  { align-self: flex-end; flex-direction: row-reverse; }
.msg.bot   { align-self: flex-start; }

.avatar { display: none; }

.bubble {
  padding: 14px 18px;
  border-radius: 16px;
  line-height: 1.65;
  font-size: 0.92rem;
}
.msg.user .bubble {
  background: #1e2e5c;
  border-radius: 16px 4px 16px 16px;
  color: #d6e0ff;
}
.msg.bot .bubble {
  background: #161b27;
  border: 1px solid #252d3d;
  border-radius: 4px 16px 16px 16px;
  white-space: pre-wrap;
}

/* Markdown-like formatting inside bot bubble */
.bubble h3 {
  font-size: 0.9rem;
  color: #6c8ef5;
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bubble h3:first-child { margin-top: 0; }
.bubble strong { color: #a8b8ff; }
.bubble em     { color: #8fa3cc; font-style: italic; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.bubble li     { margin: 3px 0; }
.bubble hr     { border: none; border-top: 1px solid #252d3d; margin: 12px 0; }

/* Sources panel */
.sources {
  margin-top: 14px;
  border-top: 1px solid #252d3d;
  padding-top: 12px;
}
.sources-title {
  font-size: 0.72rem;
  color: #5a6880;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1a2035;
  border: 1px solid #2a3a58;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.72rem;
  margin: 3px 3px 3px 0;
  color: #8fa3cc;
  cursor: default;
  position: relative;
}
.source-chip .badge {
  background: #2a3a58;
  color: #6c8ef5;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 0.65rem;
  font-weight: 600;
}
.source-chip .score {
  color: #4a6298;
  font-size: 0.65rem;
}

/* ── Copy ── */
.copy-bar {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.copy-btn {
  background: none;
  border: 1px solid #252d3d;
  border-radius: 8px;
  color: #5a6880;
  font-size: 0.85rem;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.copy-btn:hover { border-color: #3b4cca; color: #6c8ef5; }
body.light .copy-btn { border-color: #c8cde8; color: #7a8394; }
body.light .copy-btn:hover { border-color: #3b4cca; color: #3b4cca; }

/* ── Feedback ── */
.feedback-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #252d3d;
}
.feedback-btn {
  background: none;
  border: 1px solid #252d3d;
  border-radius: 8px;
  color: #5a6880;
  font-size: 0.85rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}
.feedback-btn:hover { border-color: #3b4cca; color: #6c8ef5; }
.feedback-btn.liked    { background: #1a2e1a; border-color: #3a8a3a; color: #5ec85e; }
.feedback-btn.disliked { background: #2e1a1a; border-color: #8a3a3a; color: #e05555; }
.feedback-btn:disabled { opacity: 0.5; cursor: default; }
.feedback-comment {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.feedback-comment textarea {
  flex: 1;
  background: #1a2035;
  border: 1px solid #2a3a58;
  border-radius: 8px;
  padding: 8px 12px;
  color: #e8eaf0;
  font-size: 0.82rem;
  resize: none;
  height: 60px;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
}
.feedback-comment textarea:focus { border-color: #3b4cca; }
.feedback-comment textarea::placeholder { color: #3d4f6e; }
.feedback-comment button {
  background: #3b4cca;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.8rem;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}
.feedback-comment button:hover { background: #4a5fd4; }
body.light .feedback-bar    { border-top-color: #e0e3ef; }
body.light .feedback-btn    { border-color: #c8cde8; color: #7a8394; }
body.light .feedback-btn:hover { border-color: #3b4cca; color: #3b4cca; }
body.light .feedback-comment textarea { background: #f0f2fa; border-color: #c8cde8; color: #1a1d2e; }

/* Loading status text */
.loading-status-text {
  color: #6c8ef5;
  font-style: italic;
  font-size: 0.88rem;
  opacity: 1;
  transition: opacity 0.15s ease;
  display: block;
}
.loading-dots-wave {
  display: inline-flex;
  gap: 1px;
  margin-left: 1px;
  vertical-align: baseline;
}
.loading-dots-wave span {
  display: inline-block;
  animation: wave-bounce 1.4s infinite ease-in-out;
}
.loading-dots-wave span:nth-child(1) { animation-delay: 0s; }
.loading-dots-wave span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots-wave span:nth-child(3) { animation-delay: 0.4s; }
@keyframes wave-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-3px); opacity: 1; }
}

/* Loading dots */
.loading-dots span {
  display: inline-block;
  width: 7px; height: 7px;
  background: #6c8ef5;
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce 1.2s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-7px); opacity: 1; }
}

/* ── Input bar ── */
#input-bar {
  padding: 16px 24px;
  background: #161b27;
  border-top: 1px solid #252d3d;
  flex-shrink: 0;
}
#input-wrap {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
#question {
  flex: 1;
  background: #1a2035;
  border: 1px solid #2a3a58;
  border-radius: 12px;
  padding: 12px 16px;
  color: #e8eaf0;
  font-size: 0.92rem;
  resize: none;
  min-height: 48px;
  max-height: 180px;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.2s;
  font-family: inherit;
}
#question:focus   { border-color: #3b4cca; }
#question::placeholder { color: #3d4f6e; }

#send-btn {
  background: #3b4cca;
  border: none;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, opacity 0.2s;
}
#send-btn:hover   { background: #4a5fd4; }
#send-btn:disabled { opacity: 0.4; cursor: default; }
#send-btn svg { width: 20px; height: 20px; fill: #fff; }

.hint { font-size: 0.72rem; color: #3d4f6e; }
#token-counter { font-size: 0.72rem; color: #3d4f6e; }
#token-counter.over { color: #e05555; font-weight: 600; }
.disclaimer { font-size: 0.48rem; color: #7a8ba8; text-align: center; margin-top: 4px; font-style: italic; }

/* ── Conversation terminée ── */
.conv-finished {
  background: #1e2a40;
  border: 1px solid #2a3a58;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: #8fa3cc;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.conv-finished button {
  background: #161b27;
  border: 1px solid #3b4cca;
  border-radius: 10px;
  color: #6c8ef5;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.conv-finished button:hover { background: #1e2a40; border-color: #5570e8; }
#question:disabled { opacity: 0.4; cursor: not-allowed; }
body.light .conv-finished { background: #f0f2fa; border-color: #c8cde8; color: #5a6880; }
body.light .conv-finished button { background: #f0f2fa; border-color: #c8cde8; }
body.light .conv-finished button:hover { background: #e4e8f8; }

/* Scrollbar */
#chat::-webkit-scrollbar { width: 6px; }
#chat::-webkit-scrollbar-track { background: transparent; }
#chat::-webkit-scrollbar-thumb { background: #252d3d; border-radius: 3px; }

/* ── Light mode ── */
body.light {
  background: #f5f6fa;
  color: #1a1d2e;
}
body.light .logo-kymora { color: #0E1420; }
body.light header {
  background: #ffffff;
  border-bottom-color: #e0e3ef;
}
body.light #input-bar {
  background: #ffffff;
  border-top-color: #e0e3ef;
}
body.light #question {
  background: #f0f2fa;
  border-color: #c8cde8;
  color: #1a1d2e;
}
body.light #question::placeholder { color: #9aa3c2; }
body.light #question:focus { border-color: #3b4cca; }
body.light .msg.bot .bubble {
  background: #ffffff;
  border-color: #e0e3ef;
}
body.light .msg.user .bubble {
  background: #dde4ff;
  color: #1a1d2e;
}
body.light .source-chip { background: #eef0fb; border-color: #c8cde8; color: #4a5580; }
body.light .source-chip .badge { background: #c8cde8; }
body.light .sources { border-top-color: #e0e3ef; }
body.light .bubble hr { border-top-color: #e0e3ef; }
body.light #chat::-webkit-scrollbar-thumb { background: #c8cde8; }

/* ── Logout ── */
.logout-btn {
  font-size: 1.1rem;
  color: #4a5580;
  text-decoration: none;
  margin-left: auto;
  line-height: 1;
  transition: color 0.2s;
}
.logout-btn:hover { color: #e05555; }

#guest-login-btn { margin-left: auto; }

/* ── Toggle switch (iPhone style) ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle .icon { line-height: 0; color: #5a6880; }
body.light .theme-toggle .icon { color: #9aa3c2; }
.toggle-track {
  position: relative;
  width: 44px;
  height: 26px;
  background: #252d3d;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.25s;
  flex-shrink: 0;
}
body.light .toggle-track { background: #3b4cca; }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), box-shadow 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
body.light .toggle-thumb { transform: translateX(18px); }

/* ── Sélecteur de langue (dropdown) ── */
.lang-dropdown {
  position: relative;
  margin-left: auto;
  margin-right: 8px;
}
.lang-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1a2035;
  border: 1px solid #252d3d;
  border-radius: 8px;
  padding: 5px 9px;
  cursor: pointer;
  font-size: 1.1rem;
  color: #c8cfe0;
  transition: background 0.2s, border-color 0.2s;
  line-height: 1;
}
.lang-dropdown-btn:hover { background: #252d3d; border-color: #3b4cca; }
.lang-arrow { font-size: 0.65rem; color: #7a8394; margin-top: 1px; }
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #161b27;
  border: 1px solid #252d3d;
  border-radius: 10px;
  padding: 4px;
  z-index: 100;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lang-menu.open { display: block; }
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 7px;
  padding: 8px 12px;
  color: #c8cfe0;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}
.lang-option:hover  { background: #1a2035; }
.lang-option.active { background: #252d3d; color: #fff; font-weight: 600; }
body.light .lang-dropdown-btn        { background: #e8eaf0; border-color: #c8cfe0; color: #1a2035; }
body.light .lang-menu                { background: #ffffff; border-color: #c8cfe0; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
body.light .lang-option              { color: #1a2035; }
body.light .lang-option:hover        { background: #f0f2fa; }
body.light .lang-option.active       { background: #e8ecff; color: #3b4cca; }

/* ── Hamburger ── */
.sidebar-toggle-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: #7a8394;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-toggle-btn:hover { background: #1e2a40; color: #e8eaf0; }
body.light .sidebar-toggle-btn { color: #9aa3c2; }
body.light .sidebar-toggle-btn:hover { background: #e8eaf0; color: #1a1d2e; }

.sidebar-tooltip {
  display: none;
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  background: #1e2640;
  border: 1px solid #252d3d;
  color: #c8cfe0;
  font-size: 0.75rem;
  font-family: inherit;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sidebar-toggle-btn:hover .sidebar-tooltip { display: block; }
body.light .sidebar-tooltip { background: #ffffff; border-color: #e0e3ef; color: #1a1d2e; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ── Overlay sidebar mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
}
.sidebar-overlay.open { display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .subtitle  { display: none; }

  header {
    padding: 12px 16px;
    gap: 10px;
  }

  /* Sidebar en overlay fixe sur mobile */
  #sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100dvh;
    width: 260px;
    z-index: 100;
    transition: left 0.25s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  #sidebar.open { left: 0; }

  #chat { padding: 16px 12px; gap: 14px; }

  #input-bar { padding: 12px 12px; }

  .msg { max-width: 100%; }

  .hint { display: none; }
}
