@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700&family=Inter:wght@400;450;500;600&display=swap');

/* ============================================================
   Assistant Réception IA — feuille de style principale
   Thème clair par défaut, bascule automatique en sombre la nuit
   (prefers-color-scheme) pour le confort du poste de nuit.
   ============================================================ */

:root {
  --bg: #FBFBFC;
  --surface: #FFFFFF;
  --surface-2: #F4F5F7;
  --border: #E7E8EC;
  --border-strong: #D5D7DE;
  --ink: #14161A;
  --ink-2: #5B616E;
  --ink-3: #8A909D;

  --accent: #0B6B5B;
  --accent-hover: #095448;
  --accent-tint: #E8F3F1;
  --accent-ink: #FFFFFF;

  --danger: #B4342F;
  --danger-tint: #FBEDEC;
  --warn: #8A5A00;
  --warn-tint: #FDF3E0;

  --shadow-sm: 0 1px 2px rgba(16, 20, 30, 0.05);
  --shadow-md: 0 1px 2px rgba(16, 20, 30, 0.04), 0 8px 24px rgba(16, 20, 30, 0.06);
  --shadow-lg: 0 2px 6px rgba(16, 20, 30, 0.06), 0 24px 48px rgba(16, 20, 30, 0.12);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1013;
    --surface: #171A1F;
    --surface-2: #1F232A;
    --border: #282D35;
    --border-strong: #363C46;
    --ink: #ECEEF1;
    --ink-2: #9CA3AF;
    --ink-3: #6E7681;

    --accent: #3FAF98;
    --accent-hover: #52C2AB;
    --accent-tint: rgba(63, 175, 152, 0.13);
    --accent-ink: #06231D;

    --danger: #E8827C;
    --danger-tint: rgba(232, 130, 124, 0.12);
    --warn: #E0B168;
    --warn-tint: rgba(224, 177, 104, 0.12);

    --shadow-sm: none;
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; }

h1, h2, h3 { font-family: var(--display); letter-spacing: -0.021em; }

/* ---------- Barre supérieure ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

/* Identité de l'employé connecté — la couleur est calculée depuis le
   prénom (script.js) pour que chacun ait la sienne, toujours la même. */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--user-tint, var(--surface-2));
  border: 1px solid var(--user-border, var(--border));
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--user-color, var(--accent));
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--user-color, var(--ink));
  letter-spacing: -0.01em;
}

.shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
}

.shift-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.ghost-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ghost-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.ghost-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#logoutBtn:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-tint); }

.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  min-width: 16px; height: 16px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
}

/* ---------- Structure ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 244px 1fr; min-height: 0; }

.sidebar {
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  overflow-y: auto;
  background: var(--bg);
}

.sidebar h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 22px 0 8px 8px;
}
.sidebar h3:first-child { margin-top: 0; }

.chip {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: var(--body);
  margin-bottom: 2px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.chip:hover { background: var(--surface-2); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.chat-area { display: flex; flex-direction: column; min-height: 0; }

.mobile-chips { display: none; gap: 8px; overflow-x: auto; padding: 12px 16px 2px; scrollbar-width: none; }
.mobile-chips::-webkit-scrollbar { display: none; }

/* ---------- Messages ---------- */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg {
  max-width: 680px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  font-size: 14.5px;
  line-height: 1.62;
  white-space: pre-wrap;
  animation: rise 0.24s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.msg.assistant {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.msg.user {
  background: var(--accent);
  color: var(--accent-ink);
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.msg.system-note {
  align-self: center;
  color: var(--ink-3);
  font-size: 12.5px;
  background: none;
  padding: 4px 0;
  max-width: 560px;
  text-align: center;
}

.msg-screenshot {
  display: block;
  max-width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin-top: 12px;
}

.copy-btn {
  display: inline-flex;
  margin-top: 12px;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  font-family: var(--body);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent); }

.verify-mark {
  background: var(--warn-tint);
  color: var(--warn);
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 600;
}

.typing { align-self: flex-start; display: flex; gap: 5px; padding: 16px 18px; }
.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: pulse 1.2s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.16s; }
.typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .typing span { animation: none; opacity: 0.7; }
  .msg { animation: none; }
  * { transition: none !important; }
}

/* ---------- Zone de saisie ---------- */
.composer {
  border-top: 1px solid var(--border);
  padding: 14px 24px 22px;
  background: var(--surface);
}

.mode-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; }
.mode-tabs::-webkit-scrollbar { display: none; }

/* Chaque mode a sa couleur : l'employé voit d'un coup d'œil dans quel
   contexte il écrit (question interne, mail client, message Booking, avis
   public) — se tromper de mode produit une réponse inadaptée. */
.mode-tab {
  --tab-color: var(--ink-2);
  --tab-tint: var(--surface-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--body);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tab-color);
  opacity: 0.45;
  transition: opacity 0.16s, box-shadow 0.16s;
}

.mode-tab:hover {
  border-color: var(--tab-color);
  color: var(--tab-color);
}
.mode-tab:hover .tab-dot { opacity: 0.85; }

.mode-tab.active {
  background: var(--tab-tint);
  border-color: var(--tab-color);
  color: var(--tab-color);
  font-weight: 600;
  box-shadow: 0 0 0 3px var(--tab-tint);
}
.mode-tab.active .tab-dot {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--tab-tint);
}

.mode-tab:focus-visible { outline: 2px solid var(--tab-color); outline-offset: 2px; }

/* Vert : usage interne — la question ne sort pas de l'hôtel */
.tab-chat    { --tab-color: #0B6B5B; --tab-tint: #E8F3F1; }
/* Bleu : mail privé à un client */
.tab-email   { --tab-color: #2C5AA8; --tab-tint: #E9EFFA; }
/* Violet : messagerie d'une plateforme de réservation */
.tab-message { --tab-color: #6B4BA8; --tab-tint: #F0EAFA; }
/* Ambre : avis public, lu par de futurs clients */
.tab-review  { --tab-color: #A05A00; --tab-tint: #FDF1E0; }

@media (prefers-color-scheme: dark) {
  .tab-chat    { --tab-color: #3FAF98; --tab-tint: rgba(63,175,152,0.14); }
  .tab-email   { --tab-color: #7BA3E8; --tab-tint: rgba(123,163,232,0.14); }
  .tab-message { --tab-color: #A98BE0; --tab-tint: rgba(169,139,224,0.14); }
  .tab-review  { --tab-color: #E0B168; --tab-tint: rgba(224,177,104,0.14); }
}

.composer form { display: flex; gap: 10px; align-items: flex-end; }

.composer textarea {
  flex: 1;
  resize: none;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.5;
  max-height: 160px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer textarea::placeholder { color: var(--ink-3); }
.composer textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.composer button[type="submit"] {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--r-md);
  padding: 0 22px;
  height: 47px;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--body);
  cursor: pointer;
  transition: background 0.15s;
}
.composer button[type="submit"]:hover { background: var(--accent-hover); }
.composer button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; }

.hint { font-size: 12px; color: var(--ink-3); margin-top: 9px; }

/* ---------- Écran de connexion ---------- */
.gate { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }

.gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px 32px;
  width: 100%;
  max-width: 380px;
}

.gate-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 20px;
}

.gate-card h1 { font-size: 23px; font-weight: 700; margin: 0 0 6px; }
.gate-card p { color: var(--ink-2); font-size: 14px; margin: 0 0 26px; line-height: 1.5; }

.gate-card label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.gate-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 15px;
  font-family: var(--body);
  margin-bottom: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gate-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}

.gate-card button {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: var(--r-md);
  padding: 13px;
  font-weight: 600;
  font-size: 15px;
  font-family: var(--body);
  cursor: pointer;
  transition: background 0.15s;
}
.gate-card button:hover { background: var(--accent-hover); }

.gate-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- Panneaux latéraux (historique, transmissions) ---------- */
.history-overlay {
  position: fixed; inset: 0;
  background: rgba(16, 20, 30, 0.32);
  backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 40;
}
.history-overlay.open { opacity: 1; pointer-events: auto; }

.history-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(430px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 41;
  display: flex;
  flex-direction: column;
}
.history-panel.open { transform: translateX(0); }

.history-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.history-panel-header h2 { font-size: 17px; font-weight: 700; margin: 0; }

.history-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }
.history-empty { color: var(--ink-3); font-size: 13.5px; line-height: 1.6; }

.history-day {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-3);
  margin: 22px 0 10px;
}
.history-day:first-child { margin-top: 0; }

.history-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--bg);
}
.history-item summary { cursor: pointer; font-size: 13.5px; line-height: 1.55; list-style: none; }
.history-item summary::-webkit-details-marker { display: none; }
.history-item summary:hover { color: var(--accent); }
.history-time { font-size: 11.5px; color: var(--ink-3); margin-right: 7px; }
.history-answer {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px; line-height: 1.65; color: var(--ink-2);
}

/* ---------- Cahier de transmission ---------- */
.handover-add {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg);
}
.handover-add textarea {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 11px 13px;
  font-family: var(--body);
  font-size: 13.5px;
  resize: vertical;
}
.handover-add textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.handover-add button {
  align-self: flex-end;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: var(--r-sm);
  padding: 9px 15px;
  font-weight: 600; font-size: 13px; font-family: var(--body);
  cursor: pointer;
}
.handover-add button:hover { background: var(--accent-hover); }
.handover-add button:disabled { opacity: 0.5; }

.handover-item {
  border: 1px solid var(--border);
  border-left: 4px solid var(--alert-red, #C0392B);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.handover-item.resolved {
  border-left-color: var(--border-strong);
  border-left-width: 3px;
  background: var(--bg);
  box-shadow: none;
  opacity: 0.62;
}

@media (prefers-color-scheme: dark) {
  .handover-item { --alert-red: #F08A80; }
}

.handover-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }

.handover-shift {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px;
}
.shift-matin { background: var(--warn-tint); color: var(--warn); }
.shift-soir  { background: var(--accent-tint); color: var(--accent); }
.shift-nuit  { background: var(--surface-2); color: var(--ink-2); }

.handover-author { font-size: 12.5px; font-weight: 600; }
.handover-text { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

.handover-resolve-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background: var(--accent);
  border: none;
  color: var(--accent-ink);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--body);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.handover-resolve-btn::before {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.65;
}
.handover-resolve-btn:hover { background: var(--accent-hover); }
.handover-resolve-btn:hover::before { opacity: 1; }
.handover-resolve-btn:active { transform: scale(0.97); }
.handover-resolve-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.handover-resolved {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
}
.handover-resolved::before {
  content: '';
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.22;
}

.admin-q-date { font-size: 11.5px; color: var(--ink-3); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-chips { display: flex; }
  .mobile-chips .chip {
    flex: 0 0 auto; width: auto; margin-bottom: 0;
    white-space: nowrap; font-size: 13px; padding: 8px 14px;
    border: 1px solid var(--border); background: var(--surface);
    border-radius: 999px;
  }
  .messages { padding: 22px 16px; }
  .composer { padding: 12px 16px 18px; }
  .topbar { padding: 12px 16px; }
}

@media (max-width: 620px) {
  .brand-sub { display: none; }
  .shift-badge { display: none; }
  .topbar-right { overflow-x: auto; scrollbar-width: none; max-width: 62vw; }
  .topbar-right::-webkit-scrollbar { display: none; }
  .ghost-btn { flex: 0 0 auto; font-size: 12px; padding: 6px 11px; }
  .history-panel { width: 100%; }
  .msg { max-width: 100%; }
}

/* Document PDF joint à une procédure (affiché dans le chat) */
.msg-doc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--accent);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  background: var(--accent-tint);
  transition: border-color 0.15s;
}
.msg-doc:hover { border-color: var(--accent); }
.msg-doc::before {
  content: 'PDF';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 4px;
  padding: 3px 6px;
}

/* ---------- Transmissions non traitées : alerte visible ---------- */
.ghost-btn.has-pending {
  border-color: var(--alert-red, #C0392B);
  color: var(--alert-red, #C0392B);
  background: var(--alert-red-tint, #FCEDEB);
  font-weight: 600;
  animation: pending-pulse 1.6s ease-in-out infinite;
}
.ghost-btn.has-pending:hover {
  color: var(--alert-red, #C0392B);
  border-color: var(--alert-red, #C0392B);
}
.ghost-btn.has-pending .count-badge {
  background: var(--alert-red, #C0392B);
  color: #fff;
}

@keyframes pending-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.42); }
  50%      { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0); }
}

@media (prefers-color-scheme: dark) {
  .ghost-btn.has-pending {
    --alert-red: #F08A80;
    --alert-red-tint: rgba(240, 138, 128, 0.14);
  }
  @keyframes pending-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(240, 138, 128, 0.42); }
    50%      { box-shadow: 0 0 0 6px rgba(240, 138, 128, 0); }
  }
}

/* Le bouton reste rouge et lisible sans animation si le système
   demande moins de mouvement (poste de nuit, sensibilité visuelle). */
@media (prefers-reduced-motion: reduce) {
  .ghost-btn.has-pending { animation: none; }
}

/* ---------- Message d'accueil ---------- */
.welcome {
  align-self: center;
  max-width: 640px;
  padding: 8px 4px 12px;
  animation: rise 0.3s ease both;
}

.welcome-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 25px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 16px;
}
.welcome-title.short { margin-bottom: 8px; }

.welcome-lead {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin-bottom: 13px;
}
.welcome-lead strong { color: var(--ink); font-weight: 600; }

.welcome-note {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-3);
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 860px) {
  .welcome { padding: 4px 0 8px; }
  .welcome-title { font-size: 21px; }
  .welcome-lead { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .welcome { animation: none; }
}

/* Note déjà traitée : mention + suppression discrète sur la même ligne */
.handover-done-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.handover-done-row .handover-resolved { margin-top: 0; }

.handover-delete-btn {
  background: none;
  border: none;
  color: var(--ink-3);
  font-family: var(--body);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
  flex: 0 0 auto;
}
.handover-delete-btn:hover { color: var(--danger); text-decoration: underline; }

/* ---------- Alerte de mode inadapté ---------- */
.mode-alert {
  background: var(--warn-tint);
  border: 1px solid var(--warn);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  animation: rise 0.2s ease both;
}

.mode-alert-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--warn);
  margin-bottom: 12px;
}
.mode-alert-text strong { font-weight: 700; }

.mode-alert-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.mode-alert-switch {
  background: var(--warn);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--body);
  cursor: pointer;
}
.mode-alert-switch:hover { filter: brightness(1.1); }

.mode-alert-keep {
  background: none;
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: var(--r-sm);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--body);
  cursor: pointer;
}
.mode-alert-keep:hover { background: rgba(138, 90, 0, 0.08); }

@media (prefers-reduced-motion: reduce) {
  .mode-alert { animation: none; }
}

/* ---------- Orientation de la réponse ---------- */
.intent-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 15px;
  margin-bottom: 12px;
}

.intent-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.intent-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.intent-chip {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: var(--body);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.intent-chip:hover { border-color: var(--accent); color: var(--accent); }
.intent-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.intent-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.intent-note {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-family: var(--body);
  font-size: 13.5px;
}
.intent-note::placeholder { color: var(--ink-3); }
.intent-note:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
