.chat-tab { padding: 0; height: 100%; display: flex; flex-direction: column; }

.chat-toolbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .65rem .9rem;
  background: rgba(24, 24, 27, .22);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  flex-wrap: wrap;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}
.chat-toolbar label { font-size: .85rem; color: #d4d4d8; display: flex; align-items: center; gap: .35rem; }
.chat-toolbar select, .chat-toolbar button { background: rgba(39, 39, 42, .45); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; padding: .25rem .6rem; font-size: .85rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.chat-toolbar button:hover:not(:disabled) { background: rgba(63, 63, 70, .6); cursor: pointer; }
.chat-toolbar button:disabled { opacity: .5; }
.chat-toolbar .muted { color: #64748b; font-size: .8rem; margin-left: auto; }
.chat-toolbar .ok { color: #4ade80; font-size: .8rem; margin-left: auto; }
.chat-toolbar .err { color: #f87171; font-size: .8rem; margin-left: auto; }

.icon-btn { background: rgba(39, 39, 42, .45); color: #d4d4d8; border: 1px solid rgba(255, 255, 255, .08); border-radius: 6px; padding: .15rem .45rem; font-size: .85rem; cursor: pointer; line-height: 1; min-width: 1.6rem; min-height: 1.7rem; display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.icon-btn svg { display: block; }
.icon-btn:hover:not(:disabled) { background: rgba(63, 63, 70, .6); color: #fff; }
.icon-btn.danger { color: var(--p-base); border-color: rgba(var(--p-base-rgb), .35); }
.icon-btn.danger:hover:not(:disabled) { background: rgba(var(--p-base-rgb), .18); color: var(--p-bright); border-color: rgba(var(--p-base-rgb), .55); }

.chat-layout { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; transition: grid-template-columns .2s; }
.chat-layout.sidebar-hidden { grid-template-columns: 0 1fr; }
.chat-layout.sidebar-hidden #chat-sidebar { visibility: hidden; border-right: none; }

#chat-sidebar {
  background: rgba(20, 20, 23, .25);
  border-right: 1px solid rgba(255, 255, 255, .1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .04),
    inset -1px 0 0 rgba(255, 255, 255, .04);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .85rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky; top: 0; z-index: 1;
  background: rgba(20, 20, 23, .45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.sidebar-left { display: flex; align-items: center; gap: .5rem; }
.sidebar-title { font-size: .72rem; text-transform: uppercase; color: #64748b; letter-spacing: .06em; }

#chat-sessions { list-style: none; padding: 0; margin: 0; }
#chat-sessions li { padding: .5rem .75rem; border-bottom: 1px solid #111c2b; cursor: pointer; font-size: .8rem; display: grid; gap: .15rem; position: relative; }
#chat-sessions li:hover { background: rgba(255, 255, 255, .04); }
#chat-sessions li.active {
  background: rgba(var(--p-glow-rgb), .15);
  border-left: 2px solid var(--p-base);
  padding-left: calc(.75rem - 2px);
  box-shadow:
    inset 0 0 18px rgba(var(--p-glow-rgb), .08),
    0 0 12px rgba(var(--p-shadow-rgb), .12);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
#chat-sessions li .s-del { position: absolute; top: .4rem; right: .5rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: transparent; color: #71717a; border: none; font-size: 1rem; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; padding: 0; display: flex; align-items: center; justify-content: center; }
#chat-sessions li:hover .s-del { opacity: 1; }
#chat-sessions li .s-del:hover { opacity: 1; color: var(--p-glow, var(--p-base)); background: transparent; }
#chat-sessions li .s-edit { position: absolute; top: .4rem; right: 1.9rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: transparent; color: #71717a; border: none; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s; padding: 0; display: flex; align-items: center; justify-content: center; }
#chat-sessions li:hover .s-edit { opacity: 1; }
#chat-sessions li .s-edit:hover { opacity: 1; color: var(--p-glow, var(--p-base)); background: transparent; }
#chat-sessions .s-id { font-family: monospace; color: var(--p-light); font-size: .7rem; }
#chat-sessions .s-model { color: #d4d4d8; }
#chat-sessions .s-kind { color: #f59e0b; font-size: .7rem; }
#chat-sessions .s-status { color: #64748b; font-size: .7rem; }
#chat-sessions .s-date { color: #64748b; font-size: .7rem; }

#chat-main { display: flex; flex-direction: column; background: transparent; position: relative; overflow: hidden; min-height: 0; }

.sidebar-handle { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 12px; height: 64px; background: rgba(39, 39, 42, .55); border: 1px solid rgba(255, 255, 255, .08); border-left: none; border-radius: 0 6px 6px 0; color: var(--p-light); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: .9rem; line-height: 1; padding: 0; z-index: 10; transition: background .15s, color .15s; backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); }
.sidebar-handle:hover { background: rgba(var(--p-base-rgb), .18); color: var(--p-base); }
#chat-bubbles, #chat-terminal { display: none; flex: 1; min-height: 0; }
#chat-bubbles.active { display: flex; flex-direction: column; }
#chat-terminal.active {
  display: block;
  padding: .5rem;
  background: rgba(24, 24, 27, .25);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 8px;
  margin: .5rem;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
/* Surface du terminal (xterm) transparente pour laisser passer le glass parent */
#chat-terminal .xterm,
#chat-terminal .xterm-viewport { background: transparent !important; }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: transparent;
  position: relative;
}

.bubble-row { display: flex; flex-direction: column; max-width: 75%; }
.bubble-row.user { align-self: flex-end; align-items: flex-end; }
.bubble-row.assistant { align-self: flex-start; align-items: flex-start; }
.bubble-row.system { align-self: center; }

.bubble {
  padding: .7rem 1.05rem;
  border-radius: 18px;
  font-size: .94rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  position: relative;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
/* User : verre cristal subtil — texte var(--p-pale) cohérent palette */
.bubble.user {
  background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .04));
  color: var(--p-pale);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 20px;
  border-bottom-right-radius: 6px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .35),
    inset 0 1px 0 rgba(255, 255, 255, .15),
    inset 0 -1px 0 rgba(0, 0, 0, .12);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}

/* Claude : verre teinté or — palette principale, edges lumineux dorés */
.bubble.assistant {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .14), rgba(var(--p-glow-rgb), .08));
  color: var(--p-pale);
  border: 1px solid rgba(var(--p-base-rgb), .35);
  border-radius: 20px;
  border-bottom-left-radius: 6px;
  box-shadow:
    0 8px 32px rgba(var(--p-shadow-rgb), .18),
    0 2px 8px rgba(0, 0, 0, .2),
    inset 0 1px 0 rgba(var(--p-soft-rgb), .25),
    inset 0 -1px 0 rgba(0, 0, 0, .12);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
.bubble.system { background: transparent; color: #64748b; font-size: .8rem; font-style: italic; padding: .25rem .5rem; box-shadow: none; backdrop-filter: none; border: none; }

.bubble-footer { display: flex; align-items: center; gap: .35rem; margin-top: .25rem; padding: 0 .5rem; }
.bubble-row.user .bubble-footer { flex-direction: row-reverse; }
.bubble-time { font-size: .68rem; color: rgba(var(--p-deep-rgb), .85); opacity: .7; transition: opacity .15s; }
.bubble-row:hover .bubble-time { opacity: 1; }
.bubble-replay { background: transparent; border: none; color: rgba(var(--p-deep-rgb), .8); cursor: pointer; font-size: .9rem; line-height: 1; padding: 0 .15rem; opacity: 0; transition: opacity .15s, color .15s; border-radius: 4px; }
.bubble-row.user:hover .bubble-replay { opacity: .75; }
.bubble-replay:hover { opacity: 1 !important; color: var(--p-base); background: rgba(var(--p-base-rgb), .12); }

.typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: .5rem;
  color: #a1a1aa;
  font-size: .85rem;
  padding: .65rem 1rem;
  background: linear-gradient(135deg, rgba(39, 39, 42, .45), rgba(20, 20, 23, .55));
  border: 1px solid rgba(161, 161, 170, .18);
  border-radius: 18px;
  border-bottom-left-radius: 6px;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}
.typing .dots { display: inline-flex; gap: .25rem; }
.typing .dots span { width: .45rem; height: .45rem; border-radius: 50%; background: #a1a1aa; animation: typing-bounce 1.2s infinite ease-in-out; }
.typing .dots span:nth-child(2) { animation-delay: .15s; }
.typing .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .4; }
  30% { transform: translateY(-.3rem); opacity: 1; }
}


#chat-form-handle { height: 6px; background: transparent; cursor: ns-resize; flex: 0 0 auto; position: relative; border-top: 1px solid rgba(255, 255, 255, .05); }
#chat-form-handle::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .15); opacity: .6; transition: opacity .15s, background .15s; }
#chat-form-handle:hover::after { background: var(--p-base); opacity: 1; }

/* Le form est lui-même la "zone de saisie" englobante : un seul bloc bordé qui contient textarea + 4 boutons.
   min-height calé sur la hauteur naturelle des 4 boutons + paddings symétriques (~9px haut/bas comme la padding du form). */
#chat-form {
  display: flex; gap: .5rem;
  padding: .55rem .65rem;
  margin: 0 .8rem .8rem;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  align-items: stretch;
  height: 145px; min-height: 145px; max-height: 50vh;
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  transition: border-color .15s, box-shadow .15s;
}
/* form-actions : ne pas étirer sur toute la hauteur du form, juste la hauteur naturelle des boutons,
   et aligner en bas pour avoir la même marge en haut (.55rem padding) qu'en bas. */
.form-actions {
  align-self: flex-end !important;
}
#chat-form:focus-within {
  border-color: rgba(var(--p-base-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--p-base-rgb), .12);
}
#chat-input {
  flex: 1;
  background: transparent;
  color: #e2e8f0;
  border: none;
  padding: .35rem .45rem;
  font-size: .92rem; resize: none; font-family: inherit;
  min-height: 2.4rem; height: 100%;
}
#chat-input:focus { outline: none; }
.form-actions { display: flex; flex-direction: column; gap: .35rem; justify-content: flex-end; }
#chat-send {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .85), rgba(var(--p-glow-rgb), .75));
  color: var(--p-text-on);
  border: 1px solid rgba(var(--p-soft-rgb), .8);
  border-radius: 8px;
  padding: .45rem 1.1rem;
  font-size: .9rem;
  cursor: pointer;
  font-weight: 600;
  box-shadow:
    0 0 18px rgba(var(--p-glow-rgb), .5),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: background .15s, box-shadow .15s;
}
#chat-send:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(var(--p-base-rgb), .95), rgba(var(--p-glow-rgb), .9));
  box-shadow:
    0 0 24px rgba(var(--p-glow-rgb), .65),
    inset 0 1px 0 rgba(255, 255, 255, .45);
}
#chat-send:disabled { opacity: .4; cursor: not-allowed; }
#chat-stop { background: transparent; color: var(--p-base); border: 1px solid rgba(var(--p-base-rgb), .35); border-radius: 8px; padding: .25rem .65rem; font-size: .75rem; cursor: pointer; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
#chat-stop:hover:not(:disabled) { background: rgba(var(--p-base-rgb), .18); color: var(--p-bright); border-color: rgba(var(--p-base-rgb), .55); }
#chat-stop:disabled { opacity: .35; cursor: not-allowed; }

/* ===== Attachments / upload ===== */
#chat-attach {
  background: transparent; color: var(--p-base);
  border: 1px solid rgba(var(--p-base-rgb), .35);
  border-radius: 8px; padding: .25rem .55rem;
  font-size: 1rem; cursor: pointer; line-height: 1;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#chat-attach:hover { background: rgba(var(--p-base-rgb), .18); color: var(--p-bright); border-color: rgba(var(--p-base-rgb), .55); }

/* ===== Mode vocal ===== */
#chat-mic {
  background: transparent; color: var(--p-base);
  border: 1px solid rgba(var(--p-base-rgb), .35);
  border-radius: 8px; padding: .25rem .55rem;
  font-size: 1rem; cursor: pointer; line-height: 1;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background .12s, border-color .12s;
}
#chat-mic:hover:not(:disabled) { background: rgba(var(--p-base-rgb), .18); border-color: rgba(var(--p-base-rgb), .55); }
#chat-mic.mic-on {
  background: rgba(var(--v2-rgb), .18);
  border-color: var(--v2);
  color: var(--v2);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
#chat-mic.conv-on:not(.mic-on) {
  /* En attente Claude / TTS pendant la conversation continue : pulse cyan plus lent */
  background: rgba(var(--v3-rgb), .15);
  border-color: var(--v3);
  color: var(--v3);
  animation: mic-pulse-slow 2.4s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--v2-rgb), .55); }
  50%      { box-shadow: 0 0 0 6px rgba(var(--v2-rgb), 0); }
}
@keyframes mic-pulse-slow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--v3-rgb), .45); }
  50%      { box-shadow: 0 0 0 5px rgba(var(--v3-rgb), 0); }
}
.chat-attachments {
  display: flex; flex-wrap: wrap; gap: .35rem;
  padding: .35rem .8rem 0;
}
.chat-attachments:empty { display: none; }
.chat-att {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .45rem; border-radius: 4px;
  background: rgba(var(--p-base-rgb), .12);
  border: 1px solid rgba(var(--p-base-rgb), .35);
  color: var(--p-pale); font-size: .75rem;
  font-family: 'Menlo','Consolas',monospace;
}
.chat-att .att-name { color: var(--p-base); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-att .att-size { color: #94a3b8; font-size: .65rem; }
.chat-att .att-remove {
  background: transparent; border: none; color: #94a3b8;
  cursor: pointer; padding: 0 .15rem; font-size: 1rem; line-height: 1;
}
.chat-att .att-remove:hover { color: var(--v2); }

/* Drag & drop overlay */
#chat-bubbles { position: relative; }
#chat-drop-overlay[hidden] { display: none !important; }
#chat-drop-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--p-glow-rgb), .15);
  border: 3px dashed var(--p-base);
  border-radius: 8px;
  color: var(--p-base); font-size: 1.4rem; font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

/* ===================================================================
   A3a Responsive — REVERT complet (Vincent demande : on revient dessus en dernier)
   Le chat utilise donc les règles PC sur mobile (moche mais fonctionnel).
   =================================================================== */

/* ============================================================================
   FIX MOBILE — chat-tab hauteur fixe pour scroll interne (≤ 768px)
   Bug : portal.css force body overflow-y:auto + main#content height:auto pour
   activer le scroll natif mobile. Mais .chat-tab utilise un flex column avec
   .chat-content / #chat-messages en flex:1 overflow-y:auto qui necessite que
   le parent ait une hauteur DETERMINEE (pas auto).
   Solution : sur ces 3 tabs uniquement, forcer height fixe = viewport - header,
   et le main du layout prend toute la grid (le sidebar mobile est en fixed
   donc out-of-flow).
   ============================================================================ */
@media (max-width: 768px) {
  .chat-tab {
    height: calc(100vh - 50px) !important;
    height: calc(100dvh - 50px) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 50px) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .chat-layout {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  /* Le main prend toute la largeur (sidebar est en position:fixed, out of flow) */
  #chat-main {
    grid-column: 1 / -1 !important;
    grid-row: 1 / -1 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }
}

/* ============================================================================
   FIX MOBILE — chat zone saisie en bas + backdrop sidebar (≤ 768px)
   Vincent : le form se retrouvait au milieu, et le drawer sidebar n a pas
   de backdrop pour fermer en tap exterieur.
   ============================================================================ */
@media (max-width: 768px) {
  /* Force chain flex 1 : main -> bubbles -> messages, form fixed bottom */
  #chat-main {
    display: flex !important;
    flex-direction: column !important;
  }
  #chat-bubbles.active {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #chat-messages {
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: .8rem .6rem !important;
  }
  /* Form NE GRANDIT PAS, fixe en bas */
  #chat-form {
    flex: 0 0 auto !important;
    height: 90px !important;
    min-height: 90px !important;
    max-height: 90px !important;
  }
  #chat-attachments {
    flex: 0 0 auto !important;
    max-height: 60px !important;
    overflow-y: auto !important;
  }
  #chat-attachments:empty { display: none !important; }

  /* Backdrop quand sidebar drawer ouvert */
  .chat-layout::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
  }
  .chat-layout.sidebar-shown::before {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ============================================================================
   A3a COMPLET — chat mobile (≤ 768px) — sidebar drawer + form-actions row +
   toolbar wrap + form compact + bubbles 95%. Vincent 2026-05-10.
   ============================================================================ */
@media (max-width: 768px) {
  /* === Sidebar drawer (fixed, slide-in via .sidebar-shown) === */
  .chat-layout {
    grid-template-columns: 0 1fr !important;
  }
  .chat-layout #chat-sidebar {
    visibility: hidden;
    border-right: none;
    position: fixed;
    top: 0; left: 0;
    width: 80%; max-width: 280px;
    height: 100vh; height: 100dvh;
    background: rgba(20, 20, 23, .98);
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .25s ease-out, visibility .25s;
    overflow-y: auto;
    padding: 0;
  }
  .chat-layout.sidebar-shown #chat-sidebar {
    visibility: visible;
    transform: translateX(0);
  }

  /* === Toolbar : wrap === */
  .chat-toolbar {
    flex-wrap: wrap !important;
    gap: .35rem !important;
    padding: .4rem !important;
    min-height: 0 !important;
  }
  .chat-toolbar > * { flex-shrink: 1 !important; }
  .chat-toolbar .muted, .chat-toolbar .ok, .chat-toolbar .err {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .chat-toolbar label { font-size: .8rem !important; gap: .25rem !important; }
  .chat-toolbar select { padding: .15rem .35rem !important; font-size: .8rem !important; }

  /* === Bubbles : largeur quasi pleine === */
  .bubble-row { max-width: 95% !important; }
  .bubble { font-size: .88rem !important; padding: .55rem .85rem !important; }

  /* === Form : compact, margin/padding reduit === */
  #chat-form-handle { display: none !important; }
  #chat-form {
    margin: 0 .4rem .4rem !important;
    padding: .35rem .45rem !important;
    gap: .35rem !important;
    border-radius: 10px !important;
  }
  /* CRITIQUE : boutons en row au lieu de column */
  .form-actions {
    flex-direction: row !important;
    align-self: stretch !important;
    align-items: center !important;
    gap: .3rem !important;
    flex-wrap: nowrap !important;
  }
  #chat-send {
    padding: .35rem .55rem !important;
    font-size: .8rem !important;
    flex: 0 0 auto !important;
    min-width: 60px !important;
  }
  #chat-stop {
    padding: .25rem .4rem !important;
    font-size: .7rem !important;
    flex: 0 0 auto !important;
  }
  #chat-attach, #chat-mic {
    padding: .25rem .35rem !important;
    font-size: .9rem !important;
    flex: 0 0 auto !important;
  }
  #chat-input {
    font-size: .9rem !important;
    min-height: 0 !important;
    padding: .25rem .35rem !important;
  }

  /* === Sidebar handle plus visible sur mobile === */
  .sidebar-handle {
    z-index: 201 !important;
    width: 18px !important;
    height: 56px !important;
    font-size: 1rem !important;
  }
}

/* ============================================================================
   STANDARD TOOLBAR — uniforme reference Biometrie sante (Vincent 2026-05-10)
   Zone figee (min-height 3.15rem) + controls cohérents (bg .45, radius 6, h 28).
   ============================================================================ */
.chat-toolbar {
  min-height: 3.15rem !important;
  box-sizing: border-box !important;
}
.chat-toolbar input[type="search"],
.chat-toolbar input[type="text"],
.chat-toolbar input[type="date"],
.chat-toolbar input[type="number"],
.chat-toolbar select,
.chat-toolbar button.t-btn {
  background: rgba(39, 39, 42, .45);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  padding: .22rem .55rem;
  font-size: .82rem;
  font-family: 'Menlo','Consolas',monospace;
  height: 28px;
  box-sizing: border-box;
  line-height: 1.2;
}
.chat-toolbar button.t-btn:hover:not(:disabled) {
  background: rgba(var(--p-base-rgb), .18);
  color: var(--p-base);
  border-color: rgba(var(--p-base-rgb), .35);
}
.chat-toolbar label {
  font-size: .82rem;
  color: #d4d4d8;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  line-height: 1.2;
}
