/* =====================================================================
   Messages sur téléphone (09/11/2026) — une vraie messagerie de téléphone, pas la page d'ordinateur rétrécie.
   - La liste prend toute la largeur (avant : elle débordait de l'écran, filtres et heures coupés à droite).
   - Une ligne par conversation : avatar (plateforme), nom, heure à droite, dernier message sur une ligne, pastille du
     nombre de messages non lus.
   - La conversation s'ouvre en plein écran par-dessus tout (barre du bas et en-tête de page cachés), comme une app de
     discussion ; retour par la flèche ou en glissant depuis le bord gauche.
   - La zone d'écriture reste en bas, au-dessus de la zone sûre ; le clavier ne la cache jamais (l'appli suit la zone
     visible : --vvh, public/app.js).
   - Cibles tactiles de 44 px ; champs en 16 px (pas de zoom d'iPhone).
   Chargé après les autres feuilles : les règles fines de la page d'ordinateur (ds.css, ui.css) restent pour le grand écran.
   ===================================================================== */

/* toutes tailles : la pastille « nouveaux messages » et la bande « hors ligne » */
.ib-newpill { position: absolute; left: 50%; bottom: 12px; z-index: 5; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 999px; background: var(--surface); color: var(--fg); font: inherit; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); cursor: pointer; animation: ibPillIn .18s var(--ease, ease-out); }
.ib-newpill[hidden] { display: none; }
.ib-newpill svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes ibPillIn { from { opacity: 0; transform: translate(-50%, 6px); } }
.msg-thread { position: relative; }
.mt-msgs-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ib-offline { position: fixed; left: 0; right: 0; top: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top, 0px)) 14px 6px; background: color-mix(in srgb, #e5a50a 92%, #000); color: #1b1300; font-size: 13px; font-weight: 600; text-align: center; }
.ib-offline[hidden] { display: none; }
.mr-l2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mr-l2 .mr-prev { flex: 1; min-width: 0; }
.msg-row .mr-badge.mr-unread { background: var(--accent); }
.mr-badge.dot { min-width: 10px; width: 10px; height: 10px; padding: 0; }
.mr-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent, #fff); font-style: normal; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.mt-hbtns { display: none; } /* (téléphone seulement : sur ordinateur, la fiche est dans la rangée d'outils) */
.mb-q .mb-retry { margin-left: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

@media (max-width: 760px) {
  /* ---------- la liste ---------- */
  /* (overflow: hidden : la fiche du fan, rangée hors de l'écran à droite, ne doit jamais élargir la page ; sinon Safari la
     décale de côté quand le clavier s'ouvre) */
  html body .app #view-inbox .ibx { margin: 0 !important; border: 0 !important; border-radius: 0 !important; grid-template-columns: minmax(0, 1fr) !important; background: var(--bg) !important; min-width: 0; overflow: hidden !important; overflow: clip !important; }
  html body .app #view-inbox #ib-kpis { display: none !important; } /* (le nombre à répondre est déjà sur le filtre « À répondre ») */
  html body .app #view-inbox .msg-list { min-width: 0; border-right: 0 !important; background: var(--bg) !important; }
  html body .app #view-inbox > .viewbar { padding-bottom: 4px; }
  html body .app #view-inbox .msg-lh { flex-wrap: nowrap !important; align-items: center; gap: 8px; padding: 6px 12px 8px; min-width: 0; }
  html body .app #view-inbox .msg-lh .ibp-back { flex: none; min-height: 44px; max-width: 46%; padding: 0 8px; }
  html body .app #view-inbox .msg-lh .ibp-cur small { display: none; }
  html body .app #view-inbox .msg-lh .ibp-cur b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  html body .app #view-inbox .msg-lh .v-search { flex: 1 1 auto; min-width: 0; min-height: 44px; }
  html body .app #view-inbox .msg-lh .v-search input { height: 44px !important; min-height: 44px !important; font-size: 16px !important; }
  html body .app #view-inbox .msg-lh > button:not(.ibp-back) { flex: none; min-width: 44px; min-height: 44px; }
  /* filtres : une rangée qui défile de côté (plus rien de coupé) */
  html body .app #view-inbox .msg-chips { margin: 0 0 6px !important; padding: 0 12px !important; border: 0 !important; background: transparent !important; overflow-x: auto; scrollbar-width: none; gap: 6px !important; }
  html body .app #view-inbox .msg-chips::-webkit-scrollbar { display: none; }
  html body .app #view-inbox .msg-chips > button { height: 44px !important; padding: 0 16px !important; border: 1px solid var(--line) !important; border-radius: 999px !important; font-size: 14px; }
  html body .app #view-inbox .msg-chips > button[aria-selected="true"] { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)) !important; }
  html body .app #view-inbox .msg-filt { padding: 0 12px 8px !important; gap: 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
  html body .app #view-inbox .msg-filt select { flex: 0 0 auto !important; width: auto !important; max-width: 70vw; height: 44px !important; min-height: 44px !important; font-size: 16px !important; border-radius: 999px !important; }
  html body .app #view-inbox .msg-rows { padding: 0 !important; overscroll-behavior: contain; }
  html body .app #view-inbox :is(.msg-filt, .mt-ctl) select { padding: 0 34px 0 14px !important; }
  /* une ligne par conversation */
  html body .app #view-inbox .msg-row { gap: 12px; padding: 12px 16px !important; border-radius: 0 !important; min-height: 72px; align-items: center; }
  html body .app #view-inbox .msg-row:active { background: var(--surface-2); }
  html body .app #view-inbox .msg-row .v-avatar { width: 50px; height: 50px; flex: none; font-size: 18px; }
  html body .app #view-inbox .mr-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
  html body .app #view-inbox .mr-top b { font-size: 16px; }
  html body .app #view-inbox .mr-when { margin-left: auto; flex: none; font-size: 12.5px; }
  html body .app #view-inbox .msg-row.unread .mr-when { color: var(--accent); font-weight: 600; }
  html body .app #view-inbox .mr-prev { font-size: 14.5px; }
  html body .app #view-inbox .mr-meta { font-size: 12px; gap: 3px 8px; }
  html body .app #view-inbox .mr-meta .v-tag { font-size: 11px; }
  html body .app #view-inbox .msg-rowwrap { border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
  html body .app #view-inbox .msg-rowwrap > .ib-more { display: none !important; } /* (appui long sur la ligne, ou « ⋯ » dans la conversation) */
  html body .app #view-inbox .ib-mnote { margin: 8px 12px; }

  /* ---------- la conversation, en plein écran ---------- */
  html:has(#view-inbox:not([hidden]) #ibx.has-sel) .bottomnav { display: none !important; }
  /* (la page garde une transformation neutre de son animation d'entrée : elle enfermerait la conversation sous l'en-tête) */
  html body .app #view-inbox:has(#ibx.has-sel) { transform: none !important; animation: none !important; filter: none !important; }
  html body .app #view-inbox #ibx.has-sel { position: fixed !important; left: 0; right: 0; top: 0; height: var(--vvh, 100dvh); z-index: 80; display: flex !important; flex-direction: column; background: var(--bg) !important; }
  html body .app #view-inbox #ibx.has-sel .msg-thread { flex: 1; min-height: 0; animation: ibPush .22s var(--ease, ease-out); background: var(--bg); }
  @keyframes ibPush { from { transform: translateX(28px); opacity: .4; } }
  html body .app #view-inbox #ibx.has-sel .mt-head { position: sticky; top: 0; z-index: 3; display: grid !important; grid-template-columns: 44px 40px minmax(0, 1fr) auto; align-items: center; gap: 6px 8px; padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px !important; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
  html body .app #view-inbox #ibx.has-sel .mt-head .mt-back { width: 44px; height: 44px; border: 0 !important; background: transparent !important; }
  html body .app #view-inbox #ibx.has-sel .mt-head .v-avatar { width: 40px; height: 40px; }
  html body .app #view-inbox #ibx.has-sel .mt-who { min-width: 0; }
  html body .app #view-inbox #ibx.has-sel .mt-who b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body .app #view-inbox #ibx.has-sel .mt-who small { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html body .app #view-inbox #ibx.has-sel .mt-head .mt-hbtns { display: flex; gap: 2px; grid-column: 4; grid-row: 1; }
  html body .app #view-inbox #ibx.has-sel .mt-head .mt-hbtns .v-ibtn { width: 44px; height: 44px; border: 0 !important; background: transparent !important; }
  /* statut, priorité, chatter : une rangée fine qui défile de côté */
  html body .app #view-inbox #ibx.has-sel .mt-ctl { grid-column: 1 / -1; min-width: 0; max-width: 100%; display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0; padding: 2px 0 0; }
  html body .app #view-inbox #ibx.has-sel .mt-head > * { min-width: 0; }
  html body .app #view-inbox #ibx.has-sel .mt-ctl::-webkit-scrollbar { display: none; }
  html body .app #view-inbox #ibx.has-sel .mt-ctl select { flex: 0 0 auto !important; width: auto !important; height: 44px !important; min-height: 44px !important; font-size: 16px !important; border-radius: 999px !important; }
  html body .app #view-inbox #ibx.has-sel .mt-ctl .mt-fanbtn { display: none; } /* (le bouton de la fiche est dans l'en-tête) */
  html body .app #view-inbox #ibx.has-sel .mt-msgs { padding: 12px 12px 10px !important; overscroll-behavior: contain; }
  html body .app #view-inbox #ibx.has-sel .mb { max-width: 84% !important; }
  html body .app #view-inbox #ibx.has-sel .mb p { font-size: 16px; line-height: 1.42; }
  html body .app #view-inbox #ibx.has-sel .mt-day span, html body .app #view-inbox #ibx.has-sel .mt-day { font-size: 12px; }
  html body .app #view-inbox #ibx.has-sel .mt-note { font-size: 12.5px; }
  /* la zone d'écriture : en bas, au-dessus de la zone sûre */
  html body .app #view-inbox #ibx.has-sel .mt-comp { flex: none; border-top: 1px solid var(--line); background: var(--surface); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important; }
  html body .app #view-inbox #ibx.has-sel .mt-comp textarea { font-size: 16px !important; max-height: 34vh; }
  html body .app #view-inbox #ibx.has-sel .mc-bar .v-ibtn, html body .app #view-inbox #ibx.has-sel .mc-bar .mc-vbtn { min-width: 44px !important; min-height: 44px !important; width: 44px; height: 44px; }
  html body .app #view-inbox #ibx.has-sel .mc-bar { gap: 0 !important; flex-wrap: nowrap !important; }
  html body .app #view-inbox #ibx.has-sel .rl-send { width: 48px !important; height: 44px !important; flex: none; }
  html body .app #view-inbox #ibx.has-sel .mc-hint { font-size: 11.5px; white-space: normal; margin: 4px 6px 0 !important; }
  html body .app #view-inbox #ibx.has-sel .mc-emo { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
  html body .app #view-inbox #ibx.has-sel .mc-emo button { flex: none; width: 44px !important; height: 44px !important; }
  html body .app #view-inbox #ibx.has-sel .mc-var { min-height: 44px; padding: 0 12px; }
  html body .app #view-inbox #ibx.has-sel .mc-vrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
  html body .app #view-inbox #ibx.has-sel .mc-vrow[hidden] { display: none; }
  html body .app #view-inbox #ibx.has-sel .mc-lib { max-height: 46vh; overflow: auto; }
  html body .app #view-inbox #ibx.has-sel .mc-lib input { font-size: 16px !important; min-height: 44px; }
  html body .app #view-inbox #ibx.has-sel .mc-price input, html body .app #view-inbox #ibx.has-sel #ib-price { font-size: 16px !important; min-height: 44px; }
  html body .app #view-inbox #ibx.has-sel .mc-pick, html body .app #view-inbox #ibx.has-sel .mc-vault { max-height: 42vh; overflow: auto; }
  /* clavier ouvert : l'essentiel (messages + zone d'écriture), l'en-tête reste */
  body.kb-open #view-inbox #ibx.has-sel .mt-ctl, body.kb-open #view-inbox #ibx.has-sel .mc-hint { display: none !important; }
  body.kb-open #view-inbox #ibx.has-sel .mt-comp { padding-bottom: 6px !important; }
  /* la fiche du fan : un panneau plein écran par-dessus la conversation */
  html body .app #view-inbox #ibx.has-sel .msg-fan { position: absolute !important; inset: 0 !important; width: auto !important; max-width: none !important; z-index: 6; padding-top: env(safe-area-inset-top, 0px); }
  /* le menu d'une conversation (appui long, « ⋯ ») : une feuille en bas */
  html body .ib-menu { position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important; z-index: 1150 !important; max-width: none !important; }
  html body .ib-menu > button { min-height: 48px; font-size: 15.5px; }
  .ib-newpill { min-height: 40px; bottom: 14px; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) { html body .app #view-inbox #ibx.has-sel .msg-thread { animation: none; } }

/* (09/11/2026) le bouton « Connecter OnlyFans » de la messagerie : grand et pleine largeur sur téléphone */
@media (max-width: 760px) { .ib-mnote .ib-connect { width: 100%; min-height: 50px; font-size: 16px; } }

/* (09/11/2026) « Toutes les créatrices » : la ligne compacte des créatrices pas encore connectées */
.ib-mnote.ib-conn-line { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.ib-mnote.ib-conn-line > span { flex: 1; min-width: 0; font-size: 13px; }
.ib-mnote.ib-conn-line .btn-ghost { flex: none; min-height: 36px; }
@media (max-width: 760px) { .ib-mnote.ib-conn-line .btn-ghost { min-height: 44px; } }
