/* ============================================================
   API-PIASOFT - Design system
   Direction : "poste de reception" calme et net. Navy de confiance,
   vert "signal" pour le temps reel, corail pour les non-lus.
   ============================================================ */

:root {
  --ink: #14181f;
  --ink-soft: #5a6473;
  --ink-faint: #8b95a3;
  --canvas: #eceff3;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --line: #e2e6ec;
  --line-strong: #d2d8e0;

  --brand: #1f2a52;       /* navy profond */
  --brand-700: #18203f;
  --signal: #0e9f6e;      /* vert "en ligne" */
  --signal-soft: #e3f5ee;
  --alert: #f05a3c;       /* corail : non-lu / erreur */
  --alert-soft: #fdeae5;
  --warn: #e6a100;
  --warn-soft: #fcf2da;
  --info: #2f6bd6;
  --info-soft: #e6effb;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, .06), 0 1px 3px rgba(20, 24, 31, .05);
  --shadow-md: 0 6px 24px rgba(20, 24, 31, .10);
  --shadow-lg: 0 18px 50px rgba(20, 24, 31, .18);

  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', ui-monospace, monospace;
}

* { box-sizing: border-box; }

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

h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -.01em; }
a { color: var(--brand); }

button { font-family: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, .nlist-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ----------------------------- Boutons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 15px; font-size: 14px; font-weight: 600;
  background: var(--surface-2); color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #eef1f5; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-700); }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: transparent; color: var(--alert); border-color: var(--alert-soft); }
.btn--danger:hover { background: var(--alert-soft); }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }
.notif-enable { background: var(--signal-soft); color: #0a6e4c; border-color: #bfe8d8; }
.notif-enable:hover { background: #d3efe6; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ----------------------------- Champs ----------------------------- */
.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31, 42, 82, .12); outline: none; }

/* ----------------------------- Pastilles ----------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.pill--live { background: var(--signal-soft); color: #0a6e4c; }
.pill--off  { background: #f0e7e7; color: #9a4b3b; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.dot--pulse { position: relative; }
.dot--pulse::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: currentColor; opacity: .35; animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(2.2); opacity: 0; } }

/* niveaux */
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.tag--info { background: var(--info-soft); color: #1d4f9e; }
.tag--success { background: var(--signal-soft); color: #0a6e4c; }
.tag--warning { background: var(--warn-soft); color: #8a6200; }
.tag--error { background: var(--alert-soft); color: #b03522; }
.tag--source { background: #eef0f4; color: var(--ink-soft); }

/* ----------------------------- En-tete appli ----------------------------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  height: 62px; padding: 0 22px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 700; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18);
}
.brand__name { font-size: 17px; letter-spacing: -.02em; }
.brand__name small { display: block; font-family: var(--font-body); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.topbar__spacer { flex: 1; }
.topbar__user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 700; font-family: var(--font-display);
}

/* ----------------------------- Layout inbox ----------------------------- */
.workspace { display: grid; grid-template-columns: 384px 1fr; height: calc(100vh - 62px); height: calc(100dvh - 62px); }

.listpane { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.listpane__head { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.listpane__title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.listpane__title h2 { font-size: 18px; margin: 0; }
.count-badge {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--alert); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}
.count-badge[data-zero="true"] { background: var(--surface-2); color: var(--ink-faint); }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.chip.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

.nlist { flex: 1; overflow-y: auto; min-height: 0; }
.nlist-item {
  display: grid; grid-template-columns: 4px 1fr; gap: 12px;
  padding: 13px 18px 13px 14px; border-bottom: 1px solid var(--line);
  cursor: pointer; background: var(--surface); transition: background .12s;
}
.nlist-item:hover { background: var(--surface-2); }
.nlist-item.is-active { background: #eef1f8; }
.nlist-item__stripe { border-radius: 3px; background: var(--line-strong); }
.nlist-item[data-level="success"] .nlist-item__stripe { background: var(--signal); }
.nlist-item[data-level="warning"] .nlist-item__stripe { background: var(--warn); }
.nlist-item[data-level="error"] .nlist-item__stripe { background: var(--alert); }
.nlist-item[data-level="info"] .nlist-item__stripe { background: var(--info); }
.nlist-item__row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.nlist-item__source { font-size: 11.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.nlist-item__time { margin-left: auto; font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.nlist-item__title { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.nlist-item__snippet { font-size: 13px; color: var(--ink-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nlist-item.is-unread .nlist-item__title { font-weight: 700; }
.nlist-item.is-unread::before { content: ''; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--alert); flex: none; }
.nlist-item:not(.is-unread) .unread-dot { background: transparent; }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-10px); background: var(--signal-soft); }
  to   { opacity: 1; transform: translateY(0); }
}
.nlist-item.is-new { animation: slide-in .5s ease; }

/* Detail */
.detailpane { overflow-y: auto; min-height: 0; padding: 0; }
.detail { max-width: 720px; margin: 0 auto; padding: 34px 34px 60px; }
.detail__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.detail__time { color: var(--ink-faint); font-size: 13px; }
.detail__title { font-size: 27px; line-height: 1.18; margin: 6px 0 16px; }
.detail__body { font-size: 16px; line-height: 1.65; color: #2b323d; white-space: pre-wrap; }
.detail__image { display: block; margin: 4px 0 18px; }
.detail__image img { max-width: 100%; max-height: 460px; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.nlist-item__photo { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.detail__actions { display: flex; gap: 10px; margin: 26px 0; padding-top: 22px; border-top: 1px solid var(--line); }
.data-card { margin-top: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.data-card__head { padding: 11px 16px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.data-row { display: grid; grid-template-columns: 200px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.data-row:last-child { border-bottom: none; }
.data-row__key { font-family: var(--font-mono); color: var(--ink-soft); word-break: break-word; }
.data-row__val { font-family: var(--font-mono); color: var(--ink); word-break: break-word; }

/* Etats vides */
.empty { height: 100%; display: grid; place-items: center; text-align: center; padding: 40px; color: var(--ink-faint); }
.empty__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 16px; }
.empty h3 { margin: 0 0 6px; color: var(--ink-soft); font-size: 18px; }
.empty p { margin: 0; font-size: 14px; max-width: 320px; }

/* ----------------------------- Auth (login) ----------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(14,159,110,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(31,42,82,.12), transparent 55%),
    var(--canvas);
}
.auth-card { width: 100%; max-width: 408px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md); padding: 34px 32px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card .sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }
.auth-error { background: var(--alert-soft); color: #b03522; border-radius: var(--radius-sm); padding: 10px 13px; font-size: 13.5px; font-weight: 500; margin-bottom: 16px; display: none; }
.auth-error.is-shown { display: block; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--ink-faint); }

/* ----------------------------- Admin ----------------------------- */
.page { max-width: 1080px; margin: 0 auto; padding: 26px 24px 60px; }
.page__head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.page__head h1 { font-size: 24px; margin: 0; }
.admin-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card__head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.card__head h2 { font-size: 16px; margin: 0; }
.card__body { padding: 18px; }
.account-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; }
.account-row:hover { background: var(--surface-2); }
.account-row.is-active { background: #eef1f8; border-color: #dbe1f1; }
.account-row__meta { min-width: 0; }
.account-row__name { font-weight: 600; font-size: 14.5px; }
.account-row__email { font-size: 12.5px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; }
.account-row__badge { margin-left: auto; }

.keyrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.keyrow:last-child { border-bottom: none; }
.keyrow__label { font-weight: 600; font-size: 14px; }
.keyrow__meta { font-size: 12px; color: var(--ink-faint); font-family: var(--font-mono); }
.keyrow__meta.revoked { color: var(--alert); }

.key-reveal { background: #11151c; color: #d7f7ec; border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0; }
.key-reveal__label { font-size: 12px; color: #8fb9ac; margin-bottom: 8px; font-weight: 600; }
.key-reveal__value { display: flex; align-items: center; gap: 10px; }
.key-reveal code { font-family: var(--font-mono); font-size: 13px; word-break: break-all; flex: 1; }
.key-reveal small { display: block; color: #c79a8e; margin-top: 10px; font-size: 12px; }

.muted { color: var(--ink-faint); font-size: 13.5px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ----------------------------- Toasts ----------------------------- */
.toast-host { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s; max-width: 90vw; }
.toast.is-in { opacity: 1; transform: translateY(0); }
.toast--success { background: #0a6e4c; }
.toast--error { background: #b03522; }

/* ===================== Messagerie : groupes + fil ===================== */
.gsearch { margin-top: 2px; }

.glist { flex: 1; overflow-y: auto; min-height: 0; }
.grow {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 16px; border: none; border-bottom: 1px solid var(--line);
  background: var(--surface); text-align: left; cursor: pointer; transition: background .12s;
}
.grow:hover { background: var(--surface-2); }
.grow.is-active { background: #eef1f8; }
.grow__avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff;
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}
.grow__main { flex: 1; min-width: 0; }
.grow__line1 { display: flex; align-items: baseline; gap: 8px; }
.grow__name { font-weight: 600; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.grow__time { font-size: 12px; color: var(--ink-faint); white-space: nowrap; flex: none; }
.grow__srcline { margin-top: 2px; line-height: 1.15; }
.grow__src { font-weight: 600; font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; vertical-align: bottom; }
.grow__line2 { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.grow__preview { font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.grow__badge {
  flex: none; min-width: 20px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: var(--signal); color: #fff; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* Panneau du fil */
.threadpane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface-2); }
.thread { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread__head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none;
}
.thread__head .grow__avatar { width: 40px; height: 40px; font-size: 15px; }
.thread__id { min-width: 0; }
.thread__name { font-weight: 700; font-size: 16px; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread__sub { font-size: 12.5px; color: var(--ink-faint); }
.iconbtn {
  width: 36px; height: 36px; border-radius: 9px; border: none; flex: none;
  background: transparent; color: var(--ink); font-size: 20px; line-height: 1;
  display: grid; place-items: center; cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); }

.thread__body {
  flex: 1; overflow-y: auto; min-height: 0;
  padding: 18px clamp(14px, 6vw, 60px);
  display: flex; flex-direction: column; gap: 10px;
  background:
    radial-gradient(circle at 20% 0%, rgba(31,42,82,.03), transparent 40%),
    var(--surface-2);
}

.day-sep { text-align: center; margin: 8px 0; }
.day-sep span {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft); text-transform: capitalize;
}

.msg { display: flex; }
.msg__bubble {
  position: relative; max-width: min(560px, 80%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 11px 14px 9px;
  box-shadow: var(--shadow-sm);
}
.msg[data-level="success"] .msg__bubble { border-left: 3px solid var(--signal); }
.msg[data-level="warning"] .msg__bubble { border-left: 3px solid var(--warn); }
.msg[data-level="error"] .msg__bubble { border-left: 3px solid var(--alert); }
.msg[data-level="info"] .msg__bubble { border-left: 3px solid var(--info); }
.msg__top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.msg__sender { font-weight: 700; font-size: 13px; letter-spacing: .01em; }
.msg__title { font-weight: 600; font-size: 15px; line-height: 1.35; }
.msg__body { font-size: 14px; line-height: 1.55; color: #2b323d; margin-top: 4px; white-space: pre-wrap; }
.msg__image { display: block; margin-top: 9px; }
.msg__image img { max-width: 100%; max-height: 320px; border-radius: 10px; display: block; }
.msg__data { margin-top: 9px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.msg__data-row { display: grid; grid-template-columns: minmax(70px, 38%) 1fr; gap: 10px; padding: 6px 11px; font-size: 12.5px; font-family: var(--font-mono); }
.msg__data-row:nth-child(odd) { background: var(--surface-2); }
.msg__data-row span:first-child { color: var(--ink-soft); word-break: break-word; }
.msg__data-row span:last-child { color: var(--ink); word-break: break-word; }
.msg__meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; }
.msg__meta time { margin-left: auto; font-size: 11px; color: var(--ink-faint); }
.msg__del { border: none; background: transparent; color: var(--ink-faint); font-size: 11.5px; cursor: pointer; padding: 2px 4px; border-radius: 6px; opacity: 0; transition: opacity .12s, color .12s; }
.msg__bubble:hover .msg__del, .msg__del:focus { opacity: 1; }
.msg__del:hover { color: var(--alert); background: var(--alert-soft); }

@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg--new { animation: msg-in .35s ease; }

/* ----------------------------- Responsive ----------------------------- */
.back-mobile { display: none; }

/* Tablettes et petits écrans : passage en une colonne */
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace.show-detail .listpane { display: none; }
  .workspace:not(.show-detail) .threadpane { display: none; }
  .admin-grid { grid-template-columns: 1fr; }
  .detail { padding: 22px 18px 60px; }
  .back-mobile { display: inline-flex !important; }
}

/* Smartphones */
@media (max-width: 560px) {
  /* Barre du haut condensée pour tenir sur un écran étroit */
  .topbar { height: 56px; padding: 0 13px; gap: 10px; }
  .brand__mark { width: 30px; height: 30px; font-size: 15px; }
  .brand__name { font-size: 15px; }
  .brand__name small { display: none; }       /* on masque le sous-titre */
  .topbar__user { gap: 6px; }
  .topbar__user .avatar,
  .topbar__user #userName { display: none; }   /* on garde l'essentiel */
  .notif-enable__txt { display: none; }          /* bouton alertes : icone seule */
  .btn--sm { padding: 7px 10px; font-size: 12.5px; }
  .pill { padding: 3px 9px; font-size: 11px; }

  /* La zone principale reprend la hauteur sous la barre de 56px */
  .workspace { height: calc(100vh - 56px); height: calc(100dvh - 56px); }

  /* Champs en 16px : empeche le zoom automatique sur iPhone */
  .input, select.input, textarea.input { font-size: 16px; padding: 12px 13px; }

  /* Listes et fiches plus aerees au doigt */
  .listpane__head { padding: 14px 15px 9px; }
  .listpane__title h2 { font-size: 17px; }
  .nlist-item { padding: 14px 15px 14px 12px; }
  .nlist-item__title { font-size: 15px; }
  .nlist-item__snippet { font-size: 13.5px; }

  /* Detail d'une notification */
  .detail { padding: 16px 16px 70px; }
  .detail__title { font-size: 22px; }
  .detail__body { font-size: 15.5px; }
  .detail__head { gap: 8px; }
  .data-row { grid-template-columns: 1fr; gap: 3px; padding: 11px 14px; } /* cle au-dessus, valeur en dessous */
  .data-row__key { font-size: 12px; }

  /* Pages admin / connexion */
  .page { padding: 18px 14px 50px; }
  .page__head h1 { font-size: 21px; }
  .card__body { padding: 15px; }
  .auth-card { padding: 28px 22px; }

  /* Les couples champ + bouton passent a la ligne proprement */
  .card__body div[style*="display:flex"] { flex-wrap: wrap; }
  .card__body div[style*="display:flex"] > .input { min-width: 0; flex: 1 1 100%; }
  .card__body div[style*="display:flex"] > .btn { flex: 1 1 100%; justify-content: center; }

  /* Toasts au-dessus du pouce, pleine largeur lisible */
  .toast-host { left: 12px; right: 12px; bottom: 16px; transform: none; }
  .toast { width: 100%; text-align: center; }

  /* Messagerie sur mobile */
  .msg__bubble { max-width: 88%; }
  .msg__del { opacity: 1; }                 /* pas de survol au doigt : toujours visible */
  .thread__body { padding: 14px 14px; gap: 9px; }
  .grow { padding: 11px 14px; }
  .grow__avatar { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
