/* =====================================================================
   Velora sur téléphone, passe « épurée » (10/11/2026) — chargé après mobile.css, seulement sous 760 px.
   Le retour : « pas épuré, étouffé ». Moins de cadres dans les cadres, des tailles de texte cohérentes
   (titre 22, texte 15, détails 12–13), de l'air autour des sections, des contrôles légers à l'œil mais
   toujours de 44 px au doigt (le fond visible est plus petit que la zone qui se touche).
   Messages : une seule ligne d'en-tête (titre + chercher + filtres + actualiser), les statuts en une rangée,
   les filtres (chatter, étiquette, créatrice) dans une feuille ; la conversation : en-tête fin, statut et
   chatter repliés sous le nom. Comportements : public/mobile3.js. Rien ne change sur ordinateur.
   ===================================================================== */
@media (max-width: 760px) {
  /* ---------- l'échelle de l'appli ---------- */
  html body .app .view > .viewbar h1 { font-size: 24px !important; letter-spacing: -.01em; font-weight: 700; }
  html body .app .view > .viewbar { padding-left: 16px !important; padding-right: 16px !important; }
  html body .app .view main.scroll > .wrap, html body .app .view main.scroll > div > .wrap { padding-left: 16px !important; padding-right: 16px !important; }
  html body .app .view :is(.card, .dbx-card, .sup-card, .tm-card) { border-radius: 16px !important; padding: 16px !important; box-shadow: none !important; }
  html body .app .view :is(.card, .dbx-card) :is(.card, .dbx-card) { padding: 0 !important; border: 0 !important; background: transparent !important; }
  html body .app .view :is(.card, .stack, .wrap) + :is(.card, .stack) { margin-top: 14px; }
  html body .app .view :is(.card-head, .dbx-card > header) h2, html body .app .view .card > h2, html body .app .view .ct-h { font-size: 16px !important; letter-spacing: -.005em; }
  html body .app .view :is(.muted, small).small, html body .app .view p.muted { font-size: 13px; line-height: 1.45; }
  /* chiffres clés : intitulé discret, valeur nette, détail court */
  html body .app .view :is(.kpi, .dbx-k, .fx4-k, .tm-k) :is(small, .k-l, .dbx-kl):first-child { font-size: 11px !important; letter-spacing: .04em !important; }
  html body .app .view :is(.kpi, .dbx-k, .fx4-k, .tm-k) :is(strong, b.big, .k-v) { font-size: 22px !important; line-height: 1.15; }
  html body .app .view .dbx-k b { font-size: 24px !important; }
  html body .app .view .kpis { gap: 0 !important; }
  html body .app .view .kpi { padding: 14px 16px !important; }
  /* boutons et listes déroulantes : un fond calme, pas un gros cadre */
  html body .app .view :is(.btn-ghost, .btn-soft) { font-size: 14.5px; border-radius: 12px; }
  html body .app .view select { border-radius: 12px !important; background-color: var(--surface-2) !important; border-color: transparent !important; }
  html body .app .view input:not([type=checkbox]):not([type=radio]):not([type=range]) { border-radius: 12px !important; }

  /* ---------- le sélecteur de créatrice en haut : plus fin ---------- */
  html body .app .m-ctx { padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 0 !important; }
  html body .app .m-ctx .ctx-btn { min-height: 44px; padding: 6px 10px !important; border-radius: 12px !important; border-color: transparent !important; background: var(--surface-2) !important; }
  html body .app .m-ctx .ctx-t b { font-size: 14.5px; }
  html body .app .m-ctx .ctx-t small { font-size: 12px; }
  html body .app .m-ctx .ctx-av { width: 30px; height: 30px; border-radius: 9px; }

  /* ---------- onglets et segments : une rangée légère ---------- */
  html body .app .view :is(.ct-tabs, .seg, .db-seg, .dbx-seg, .fx3-seg, .seg-mini, .tm-seg) { gap: 4px !important; padding: 3px !important; border: 0 !important; border-radius: 12px !important; background: var(--surface-2) !important; scroll-padding-inline: 12px; }
  html body .app .view :is(.ct-tabs, .seg, .db-seg, .dbx-seg, .fx3-seg, .seg-mini, .tm-seg) > button { min-height: 40px !important; padding: 0 14px !important; border: 0 !important; border-radius: 10px !important; font-size: 14px !important; font-weight: 550; color: var(--muted) !important; background: transparent !important; box-shadow: none !important; transition: background .15s, color .15s; }
  html body .app .view :is(.ct-tabs, .seg, .db-seg, .dbx-seg, .fx3-seg, .seg-mini, .tm-seg) > button:is([aria-selected="true"], [aria-pressed="true"], [aria-checked="true"], .on, .active) { color: var(--fg) !important; background: var(--surface-3, var(--surface)) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .25) !important; }

  /* ---------- la barre du bas ---------- */
  html body .bottomnav { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent) !important; background: color-mix(in srgb, var(--bg) 94%, transparent) !important; }
  html body .bottomnav button { position: relative; gap: 4px !important; padding: 7px 2px 6px !important; min-height: 56px; font-size: 11px !important; font-weight: 600; white-space: nowrap; letter-spacing: 0; -webkit-tap-highlight-color: transparent; }
  html body .bottomnav button svg { width: 22px !important; height: 22px !important; padding: 4px 16px; box-sizing: content-box; border-radius: 999px; transition: background .18s; }
  html body .bottomnav button[aria-current="page"] svg { background: var(--accent-soft, rgba(121, 121, 120, .16)); }
  html body .bottomnav button:active svg { background: var(--surface-3, rgba(255, 255, 255, .08)); }
  html body .bottomnav .nav-count { position: absolute; top: 3px; left: calc(50% + 6px); margin: 0 !important; min-width: 18px; height: 18px; padding: 0 5px !important; font-size: 10.5px !important; line-height: 18px; border: 2px solid var(--bg); box-sizing: content-box; }

  /* ---------- Messages : la liste ---------- */
  html body .app #view-inbox > .viewbar { flex-direction: row !important; flex-wrap: nowrap !important; align-items: center !important; padding-top: 10px !important; padding-bottom: 6px !important; }
  html body .app #view-inbox > .viewbar > div:first-child { flex: 1; min-width: 0; }
  html body .app #view-inbox > .viewbar > .viewbar-tools { width: auto !important; flex: none; flex-wrap: nowrap !important; gap: 0 !important; margin-left: auto; }
  html body .app #view-inbox > .viewbar > .viewbar-tools .v-ibtn { width: 44px; height: 44px; border: 0 !important; background: transparent !important; border-radius: 12px; color: var(--fg-2, var(--fg)); position: relative; }
  html body .app #view-inbox > .viewbar > .viewbar-tools .v-ibtn svg { width: 21px; height: 21px; }
  html body .app #view-inbox > .viewbar > .viewbar-tools .v-ibtn:active { background: var(--surface-2) !important; }
  html body .app #view-inbox #m3-filt.on::after { content: ""; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
  html body .app #view-inbox #m3-search[aria-pressed="true"], html body .app #view-inbox #m3-filt[aria-expanded="true"] { color: var(--accent) !important; }
  /* la recherche : seulement quand on la demande (ou qu'un mot est tapé) ; le choix de la créatrice : le sélecteur du haut */
  html body .app #view-inbox .msg-lh .ibp-back, html body .app #view-inbox .msg-lh .ib-annbtn { display: none !important; }
  html body .app #view-inbox #ibx:not(.m3-q) .msg-lh { display: none !important; }
  html body .app #view-inbox #ibx.m3-q .msg-lh { padding: 0 16px 8px !important; animation: m3Drop .16s var(--ease, ease-out); }
  html body .app #view-inbox .msg-lh .v-search { border: 0 !important; background: var(--surface-2) !important; border-radius: 12px !important; }
  @keyframes m3Drop { from { opacity: 0; transform: translateY(-6px); } }
  /* les statuts : une rangée ; la pastille visible fait 34 px, la zone qui se touche 44 px */
  html body .app #view-inbox .msg-chips { isolation: isolate; gap: 6px !important; padding: 0 16px !important; margin: 0 0 4px !important; scroll-padding-inline: 16px; }
  html body .app #view-inbox .msg-chips > button { position: relative; height: 44px !important; padding: 0 14px !important; border: 0 !important; background: transparent !important; color: var(--muted) !important; font-size: 14px !important; font-weight: 550; }
  html body .app #view-inbox .msg-chips > button::before { content: ""; position: absolute; inset: 5px 0; z-index: -1; border-radius: 999px; background: var(--surface-2); transition: background .15s; }
  html body .app #view-inbox .msg-chips > button[aria-selected="true"] { color: var(--fg) !important; }
  html body .app #view-inbox .msg-chips > button[aria-selected="true"]::before { background: var(--accent-soft, rgba(121, 121, 120, .18)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
  html body .app #view-inbox .msg-chips > button em { font-style: normal; font-size: 12px; margin-left: 4px; color: var(--accent); }
  /* les filtres : une feuille qui monte du bas (bouton « filtres » de l'en-tête) */
  html body .app #view-inbox .msg-filt { position: fixed !important; left: 0; right: 0; bottom: 0; z-index: 1150; display: flex !important; flex-direction: column !important; gap: 10px !important; overflow: visible !important; padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px)) !important; border: 1px solid var(--line) !important; border-bottom: 0 !important; border-radius: 22px 22px 0 0; background: var(--surface) !important; box-shadow: 0 -12px 40px rgba(0, 0, 0, .35); transform: translateY(105%); visibility: hidden; transition: transform .24s var(--ease, cubic-bezier(.2, .8, .2, 1)), visibility 0s linear .24s; }
  /* (feuille ouverte : la page sans transformation, sinon la feuille resterait enfermée au-dessus de la barre du bas) */
  html body.m3-filt-open .app #view-inbox { transform: none !important; animation: none !important; filter: none !important; }
  html body.m3-filt-open .app #view-inbox .msg-filt { transform: none; visibility: visible; transition: transform .24s var(--ease, cubic-bezier(.2, .8, .2, 1)); }
  html body .app #view-inbox .msg-filt::before { content: ""; align-self: center; width: 40px; height: 5px; border-radius: 3px; background: var(--line-2, rgba(255, 255, 255, .18)); }
  html body .app #view-inbox .msg-filt select { width: 100% !important; max-width: none !important; border-radius: 12px !important; }
  html body .app #view-inbox .msg-filt select[hidden] { display: none !important; }
  .m3-filt-h { display: none; }
  html body .app #view-inbox .msg-filt .m3-filt-h { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 17px; font-weight: 700; }
  html body .app #view-inbox .msg-filt .m3-filt-h span { flex: 1; }
  html body .app #view-inbox .msg-filt .m3-filt-acts { display: flex; gap: 8px; margin-top: 4px; }
  html body .app #view-inbox .msg-filt .m3-filt-acts > button { flex: 1; min-height: 48px; justify-content: center; }
  .m3-back { position: fixed; inset: 0; z-index: 1149; background: rgba(5, 5, 8, .5); opacity: 0; transition: opacity .2s; }
  .m3-back.in { opacity: 1; }
  /* une ligne par conversation : de l'air, l'essentiel */
  html body .app #view-inbox .msg-rowwrap { border-bottom: 0 !important; }
  html body .app #view-inbox .msg-row { gap: 12px !important; padding: 10px 16px !important; min-height: 72px; transition: background .12s; -webkit-tap-highlight-color: transparent; }
  html body .app #view-inbox .msg-row .v-avatar { width: 46px !important; height: 46px !important; font-size: 17px !important; }
  html body .app #view-inbox .mr-main > * { line-height: 1.28 !important; }
  html body .app #view-inbox .mr-main { gap: 1px !important; padding-bottom: 10px; margin-bottom: -10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); align-self: stretch; justify-content: center; }
  html body .app #view-inbox .msg-rowwrap:last-child .mr-main { border-bottom: 0; }
  html body .app #view-inbox .mr-top b { font-size: 15.5px !important; font-weight: 600; }
  html body .app #view-inbox .msg-row.unread .mr-top b { font-weight: 700; }
  html body .app #view-inbox .mr-when { font-size: 12px !important; font-weight: 500; }
  html body .app #view-inbox .mr-prev { font-size: 14px !important; color: var(--muted) !important; }
  html body .app #view-inbox .msg-row.unread .mr-prev { color: var(--fg-2, var(--fg)) !important; }
  html body .app #view-inbox .mr-meta { font-size: 12px !important; color: var(--muted-2, var(--muted)); }
  html body .app #view-inbox .mr-meta:empty { display: none !important; }
  html body .app #view-inbox .msg-list.m3-in { animation: m3ListIn .24s var(--ease, cubic-bezier(.2, .8, .2, 1)); }
  @keyframes m3ListIn { from { transform: translateX(-18px); opacity: .55; } }

  /* ---------- Messages : la conversation ---------- */
  html body .app #view-inbox #ibx.has-sel .msg-thread { animation: m3Push .26s var(--ease, cubic-bezier(.2, .8, .2, 1)) !important; }
  @keyframes m3Push { from { transform: translateX(42%); opacity: .3; } }
  html body .app #view-inbox #ibx.has-sel .mt-head { gap: 4px 8px !important; padding: calc(4px + env(safe-area-inset-top, 0px)) 6px 4px !important; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent) !important; background: color-mix(in srgb, var(--bg) 96%, transparent) !important; backdrop-filter: none !important; }
  html body .app #view-inbox #ibx.has-sel .mt-head .v-avatar { width: 36px !important; height: 36px !important; font-size: 15px; }
  html body .app #view-inbox #ibx.has-sel .mt-who { min-height: 44px; display: flex; flex-direction: column; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  html body .app #view-inbox #ibx.has-sel .mt-who b { font-size: 16px !important; }
  html body .app #view-inbox #ibx.has-sel .mt-who b::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 7px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); transition: transform .18s; }
  html body .app #view-inbox #ibx.has-sel.m3-ctl .mt-who b::after { transform: rotate(-135deg); margin-bottom: -1px; }
  html body .app #view-inbox #ibx.has-sel .mt-who small { font-size: 12px !important; color: var(--muted); }
  /* statut, priorité, chatter : repliés sous le nom (toucher le nom les montre) */
  html body .app #view-inbox #ibx.has-sel:not(.m3-ctl) .mt-ctl { display: none !important; }
  html body .app #view-inbox #ibx.has-sel.m3-ctl .mt-ctl { padding: 4px 2px 4px !important; animation: m3Drop .16s var(--ease, ease-out); }
  html body .app #view-inbox #ibx.has-sel .mt-ctl select { border: 0 !important; background-color: var(--surface-2) !important; }
  /* les bulles */
  html body .app #view-inbox #ibx.has-sel .mt-msgs { padding: 14px 14px 12px !important; gap: 6px; }
  html body .app #view-inbox #ibx.has-sel .mb { max-width: 80% !important; }
  html body .app #view-inbox #ibx.has-sel .mb p { font-size: 15.5px !important; line-height: 1.4 !important; padding: 9px 13px !important; border-radius: 20px !important; border: 0 !important; }
  html body .app #view-inbox #ibx.has-sel .mb small { font-size: 11px !important; padding: 0 6px; color: var(--muted-2, var(--muted)); }
  html body .app #view-inbox #ibx.has-sel .mt-day { margin: 10px 0 6px; }
  /* la zone d'écriture : un seul bloc arrondi, sans phrase d'explication dessous */
  html body .app #view-inbox #ibx.has-sel .mt-comp { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent) !important; background: var(--bg) !important; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important; }
  html body .app #view-inbox #ibx.has-sel .mc-box { border: 0 !important; border-radius: 22px !important; background: var(--surface-2) !important; box-shadow: none !important; }
  html body .app #view-inbox #ibx.has-sel .mt-comp textarea { padding: 12px 14px 4px !important; background: transparent !important; border: 0 !important; line-height: 1.35; }
  html body .app #view-inbox #ibx.has-sel .mc-bar { padding: 0 4px 4px !important; }
  html body .app #view-inbox #ibx.has-sel .mc-bar .v-ibtn { color: var(--muted) !important; background: transparent !important; border: 0 !important; }
  html body .app #view-inbox #ibx.has-sel .rl-send { border-radius: 999px !important; width: 44px !important; height: 44px !important; }
  html body .app #view-inbox #ibx.has-sel .mc-hint { display: none !important; }

  /* ---------- fenêtres : elles montent du bas en douceur ---------- */
  html body .co-modal > .co-card, html body .co-modal > form.co-card, html body .co-modal > div > .co-card { animation: m3Sheet .26s var(--ease, cubic-bezier(.2, .8, .2, 1)); }
  @keyframes m3Sheet { from { transform: translateY(40px); opacity: .2; } }

  /* ---------- défilement ---------- */
  html body .app .view main.scroll, html body .app #view-inbox .msg-rows, html body .app #view-inbox .mt-msgs { -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  html body .app #view-inbox #ibx.has-sel .msg-thread, html body .app #view-inbox .msg-list.m3-in, html body .co-modal > .co-card, html body .app #view-inbox #ibx.m3-q .msg-lh, html body .app #view-inbox #ibx.has-sel.m3-ctl .mt-ctl { animation: none !important; }
  html body .app #view-inbox .msg-filt, html body.m3-filt-open .app #view-inbox .msg-filt { transition: none !important; }
}
/* ordinateur : rien de cette passe (les boutons ajoutés pour le téléphone restent cachés) */
@media (min-width: 761px) { #m3-search, #m3-filt, .m3-filt-h, .m3-filt-acts, .m3-back { display: none !important; } }
