/* ==========================================================================
   Bavardeo sur téléphone : une allure d'application des stores.
   Barre d'onglets en verre avec pastille active, gros titres, pages pleine largeur,
   cibles tactiles de 44 px, retour visuel à l'appui, sous-menu qui s'efface au défilement,
   transitions douces entre les rubriques. Rien ne change sur ordinateur.
   ========================================================================== */
@media (max-width:760px){
  html{-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%}
  html body{overscroll-behavior-y:contain}
  /* pas de zoom automatique d'iOS quand on touche un champ */
  html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),select,textarea):not(#_):not(#_){font-size:16px!important}

  /* --- barre d'onglets du bas : verre flouté, pastille derrière l'onglet actif --- */
  html body nav.nav:not(#_){background:color-mix(in srgb,var(--panel) 78%,transparent)!important;-webkit-backdrop-filter:blur(20px) saturate(1.6);backdrop-filter:blur(20px) saturate(1.6);
    border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent)!important;box-shadow:0 -10px 30px -18px rgba(10,14,30,.45)!important;padding-bottom:max(6px,env(safe-area-inset-bottom,0px))!important;padding-top:6px}
  html body .nav #nav button:not(#_){position:relative;min-height:52px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;font-weight:600;letter-spacing:.01em;-webkit-user-select:none;user-select:none}
  html body .nav #nav button .nav-ico:not(#_){width:24px;height:24px;padding:3px 16px;box-sizing:content-box;border-radius:999px;transition:background-color .25s ease,transform .25s ease}
  html body .nav #nav button[aria-current="page"] .nav-ico:not(#_){background:color-mix(in srgb,var(--link) 18%,transparent);color:var(--link);transform:translateY(-1px)}
  html body .nav #nav button[aria-current="page"]:not(#_){color:var(--link);font-weight:800}

  /* --- en-tête du haut : plus compact, boutons ronds bien tactiles --- */
  html body header.top:not(#_){-webkit-backdrop-filter:blur(18px) saturate(1.5);backdrop-filter:blur(18px) saturate(1.5)}
  html body header.top :is(.theme-btn,.bell-btn,.hs-tog,#topMe>button):not(#_){min-width:40px;min-height:40px}
  /* le sous-menu des rubriques se replie quand on descend, revient quand on remonte */
  html body .subnav:not(#_){transition:max-height .28s ease,opacity .2s ease,padding .28s ease;max-height:64px;overflow:hidden}
  html body.sn-cache .subnav:not(#_){max-height:0;opacity:0;padding-top:0!important;padding-bottom:0!important;border-bottom-width:0!important}

  /* --- pages pleine largeur, comme une application --- */
  html body #main>.page:not(#_):not(#_){margin-left:0!important;margin-right:0!important;border-radius:0!important;border-left:0!important;border-right:0!important}
  html body .crumbs:not(#_){display:none!important}
  html body :is(#main .page h1,.comu-top h1,.bl-h h1):not(#_){font-size:clamp(26px,7.4vw,32px)!important;font-weight:800!important;letter-spacing:-.02em;line-height:1.12;text-wrap:balance}

  /* --- cibles tactiles et retour à l'appui --- */
  html body .btn:not(.sm):not(.lnk):not(#_){min-height:44px}
  html body .btn.sm:not(#_){min-height:36px}
  html body :is(.btn,.nav button,.subnav button,.bl-c,.so-card,.comu-card,.pa-card,.jb-card,.card,[data-salon],.sl-row,.lb-go):active:not(#_){transform:scale(.97);transition:transform .08s ease}
  html body :is(button,a,[role="button"]){touch-action:manipulation}

  /* --- bloc de la lettre plus compact sur téléphone --- */
  html body .lb-txt p:not(#_){display:none}
  html body .lb-ic:not(#_){width:40px;height:40px}
}
/* --- application installée sur l'écran d'accueil : on retire ce qui fait « site web » --- */
@media (display-mode:standalone) and (max-width:760px){
  html body footer>.wrap>div:not(.copy):not(#_){display:none}
  html body footer:not(#_){padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}
  html body .install-btn:not(#_){display:none!important}
}
/* --- transitions entre rubriques (navigateurs qui savent le faire) --- */
@media (max-width:760px) and (prefers-reduced-motion:no-preference){
  #main{view-transition-name:bv-page}
  header.top{view-transition-name:bv-entete}
  ::view-transition-old(bv-page){animation:bvSort .18s ease both}
  ::view-transition-new(bv-page){animation:bvEntre .26s cubic-bezier(.2,.8,.2,1) both}
  ::view-transition-old(bv-page).arriere{animation-name:bvSortD}
}
@keyframes bvSort{to{opacity:0;transform:translateX(-24px)}}
@keyframes bvEntre{from{opacity:0;transform:translateX(32px)}}
@keyframes bvSortD{to{opacity:0;transform:translateX(24px)}}
@media (max-width:760px){
  /* dans les cartes, des boutons un peu plus serrés pour ne pas alourdir la grille */
  html body :is(.so-card,.card,.pa-card,.jb-card,.bl-c,.comu-card) .btn:not(#_){min-height:38px}
  /* le sous-menu replié ne fait plus bouger la page : l'en-tête garde sa place */
  html body .subnav:not(#_){overflow-anchor:none}
  html body{overflow-anchor:none}
}

/* ==========================================================================
   Messagerie sur téléphone, à la manière des applications de courriel :
   barre de titre avec menu et loupe, tiroir des dossiers qui glisse depuis la gauche,
   lignes avec avatar rond, bouton rond « Écrire » flottant, sélection en touchant l'avatar.
   ========================================================================== */
.wm-mbar,.wm-voile,.wm-fab,.wm-tir-h,.wm-ava,.wm-seln{display:none}
@media (max-width:820px){
  /* les éléments fixes doivent se placer par rapport à l'écran, pas à la feuille translucide */
  html body #main:has(.wm-app.tir-ouv):not(#_){view-transition-name:none!important}
  html body :is(.wrap.page,#main,#main>.page):has(.wm-app):not(#_){-webkit-backdrop-filter:none!important;backdrop-filter:none!important;transform:none!important;filter:none!important;contain:none!important}
  html body .wm-app:not(#_){display:block;border:0;border-radius:0;box-shadow:none;overflow:visible;min-height:0;background:transparent}
  /* sans flou sur le cadre : le tiroir et le bouton flottant se placent par rapport à l'écran */
  html body .wm-app:not(#_):not(#_){-webkit-backdrop-filter:none!important;backdrop-filter:none!important;transform:none!important}
  html body .wm-mbar:not(#_):not(#_){background:inherit;background-color:var(--panel)}
  html body #main .page:has(.wm-app)>h1:not(#_){display:none}

  /* barre de titre */
  html body .wm-mbar:not(#_){display:flex;align-items:center;gap:6px;position:sticky;top:0;z-index:30;padding:6px 4px;margin:0 0 2px;box-sizing:border-box;width:100%;background:var(--page,var(--panel))}
  html body .wm-mb-ic:not(#_){display:inline-grid;place-items:center;width:46px;height:46px;flex:none;border:0;border-radius:50%;background:none;color:var(--ink);cursor:pointer;padding:0}
  html body .wm-mb-ic:active:not(#_){background:var(--hover)}
  html body .wm-mb-ic .sm-ico:not(#_){width:24px;height:24px}
  html body .wm-mb-t:not(#_){flex:1;min-width:0;margin:0 0 0 6px;display:flex;align-items:center;gap:8px;font-size:23px!important;font-weight:800!important;letter-spacing:-.015em;line-height:1.2}
  html body .wm-mb-t span:not(#_){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html body .wm-mb-t .sm-ico:not(#_){width:22px;height:22px;color:#e0a72a;flex:none}

  /* tiroir des dossiers */
  html body .wm-voile:not(#_){display:block;position:fixed;inset:0;z-index:2147483000;background:rgba(5,8,18,.55);opacity:0;pointer-events:none;transition:opacity .25s ease}
  html body .wm-app.tir-ouv .wm-voile:not(#_){opacity:1;pointer-events:auto}
  html body .wm-side:not(#_):not(#_){position:fixed;top:0;bottom:0;left:0;z-index:2147483001;width:min(84vw,340px);display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:0;padding:0 0 max(16px,env(safe-area-inset-bottom,0px));
    overflow-y:auto;overscroll-behavior:contain;background:var(--panel);border:0;border-right:1px solid var(--line);box-shadow:12px 0 40px -12px rgba(0,0,0,.5);transform:translateX(-105%);transition:transform .28s cubic-bezier(.2,.8,.2,1);visibility:hidden}
  html body .wm-app.tir-ouv .wm-side:not(#_):not(#_){transform:none;visibility:visible}
  html body .wm-tir-h:not(#_){display:flex;align-items:center;gap:12px;padding:max(14px,env(safe-area-inset-top,0px)) 8px 14px 16px;border-bottom:1px solid var(--line)}
  html body .wm-tir-av:not(#_):not(#_){display:grid;place-items:center;width:48px;height:48px;border-radius:50%!important;color:#fff;font-size:20px;font-weight:700;flex:none}
  html body .wm-tir-id:not(#_){flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.25}
  html body .wm-tir-id b:not(#_){font-size:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  html body .wm-tir-id small:not(#_){color:var(--muted);font-size:13px}
  html body .wm-side .wm-new:not(#_):not(#_){display:flex;flex:none;width:auto;justify-content:flex-start;gap:20px;margin:12px 14px 6px;padding:0 20px;min-height:54px;border-radius:999px;font-size:17px;font-weight:700}
  html body .wm-side .wm-new .m-long:not(#_){display:inline}html body .wm-side .wm-new .m-short:not(#_){display:none}
  html body .wm-side .wm-new .sm-ico:not(#_){width:22px;height:22px}
  html body .wm-side .wm-folders:not(#_):not(#_){display:flex;flex-direction:column;flex-wrap:nowrap;gap:0;width:auto;padding:6px 0}
  html body .wm-side .wm-folders button:not(#_):not(#_){width:100%;flex:none;justify-content:flex-start;gap:20px;border-radius:0;padding:0 18px 0 22px;min-height:56px;font-size:17px;font-weight:500;background:none}
  html body .wm-side .wm-folders .m-long:not(#_){display:inline}html body .wm-side .wm-folders .m-short:not(#_){display:none}
  html body .wm-side .wm-folders button .sm-ico:not(#_){width:24px;height:24px;color:var(--ink)}
  html body .wm-side .wm-folders button[aria-current="true"]:not(#_):not(#_){background:var(--link);color:#fff;font-weight:700}
  html body .wm-side .wm-folders button[aria-current="true"] .sm-ico:not(#_){color:#fff}
  html body .wm-side .wm-folders button[aria-current="true"] .wm-badge:not(#_){background:transparent;color:#fff;font-size:15px}
  html body .wm-side .wm-badge:not(#_),html body .wm-side .wm-cnt:not(#_){font-size:13px;min-width:28px;text-align:center;padding:3px 9px}
  html body .wm-side .wm-cnt:not(#_){background:var(--hover);border-radius:999px;color:var(--ink)}

  /* section « Mes dossiers » du tiroir */
  html body .wm-side .wm-dossiers:not(#_):not(#_){display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:0;width:auto;border-top:0;padding:0}
  html body .wm-side .wm-dh:not(#_){padding:12px 10px 10px 18px;margin:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);font-size:15px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--ink);border-radius:0}
  html body .wm-side .wm-dh button:not(#_){width:40px;height:40px}html body .wm-side .wm-dh .sm-ico:not(#_){width:20px;height:20px}
  html body .wm-side .wm-dl:not(#_){display:flex;flex-direction:column;padding:4px 0}
  html body .wm-side .wm-d:not(#_){padding-left:calc(6px + var(--niv,0) * 20px)}
  html body .wm-side .wm-dtog:not(#_){width:30px;height:52px}html body .wm-side .wm-dtog.vide:not(#_){display:inline-block}
  html body .wm-side .wm-dbtn:not(#_):not(#_){flex:1;border-radius:0;background:none;min-height:52px;padding:0 14px 0 6px;gap:18px;font-size:16.5px;font-weight:500}
  html body .wm-side .wm-dbtn .sm-ico:not(#_){width:24px;height:24px}
  html body .wm-side .wm-dbtn[aria-current="true"]:not(#_):not(#_){background:var(--link);color:#fff;font-weight:700}
  html body .wm-side .wm-dbtn[aria-current="true"] :is(.sm-ico,.wm-badge,.wm-cnt):not(#_){color:#fff;background:transparent}
  html body .wm-side .wm-dvide:not(#_){display:block;padding:12px 18px}
  html body .wm-side .m-espace:not(#_){display:block;margin-top:auto;padding:18px 18px 4px}

  /* en-tête du dossier : le titre est déjà dans la barre, la recherche s'ouvre avec la loupe */
  html body .wm-pane-h:not(#_){padding:0 2px 6px;gap:6px}
  html body .wm-pane-h>h2:not(#_),html body .wm-pane-h>.wm-n:not(#_){display:none}
  html body .wm-pane-h:not(:has(.wm-dhd)):not(#_){padding:0}
  html body .wm-app:not(.cherche) .wm-search:not(#_){display:none}
  html body .wm-search:not(#_){height:46px;border-radius:999px;margin:0 0 4px}
  html body .wm-dhd .btn:not(#_){min-height:38px}

  /* barre d'actions : seulement quand des messages sont sélectionnés */
  html body .wm-app:not(.wm-selmode) .wm-bar:not(#_){display:none}
  html body .wm-bar:not(#_){position:sticky;top:58px;z-index:20;background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:4px 6px;margin:0 0 8px;box-shadow:0 8px 20px -14px rgba(0,0,0,.5)}
  html body .wm-seln:not(#_){display:inline;font-weight:800;font-size:14px;margin-right:auto;padding-left:2px}
  html body .wm-bar .wm-all:not(#_){display:none}
  html body .wm-bar [data-wmref]:not(#_){display:none}
  html body .wm-depl:not(#_){flex:1 1 100%}html body .wm-depl select:not(#_){max-width:none;flex:1}

  /* liste des messages */
  html body .wm-list:not(#_){background:transparent}
  html body .wm-row:not(#_):not(#_){grid-template-columns:52px minmax(0,1fr) auto;grid-template-areas:"av from date" "av sub sub" "av snip star" "av tag meta";gap:2px 12px;align-items:start;padding:14px 6px 14px 2px;background:transparent;border-bottom:1px solid var(--line2);box-shadow:none}
  html body .wm-row.unread:not(#_)::before{display:none}
  html body .wm-row .mChk:not(#_){display:none}
  html body .wm-ava:not(#_):not(#_){grid-area:av;display:grid;place-items:center;width:50px;height:50px;border:0;border-radius:50%!important;padding:0;color:#fff;font-size:22px;font-weight:600;cursor:pointer;transition:transform .2s ease}
  html body .wm-row.sel .wm-ava:not(#_):not(#_):not(#_){background:var(--accent,#ff6a3d)!important;font-size:0!important;color:transparent}
  html body .wm-row.sel .wm-ava:not(#_)::after{content:"";width:18px;height:10px;border:solid #fff;border-width:0 0 3px 3px;transform:translateY(-2px) rotate(-45deg)}
  html body .wm-row.sel:not(#_):not(#_){background:color-mix(in srgb,var(--accent,#ff6a3d) 12%,transparent)}
  html body .wm-from:not(#_){grid-area:from;font-size:17px;font-weight:500;color:var(--ink);align-self:center}
  html body .wm-from small:not(#_){font-size:14px}
  html body .wm-date:not(#_){grid-area:date;font-size:14px;align-self:center}
  html body .wm-main:not(#_):not(#_){display:contents}
  html body .wm-sub:not(#_){grid-area:sub;font-size:15.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body .wm-snip:not(#_){grid-area:snip;font-size:14.5px;color:var(--muted);line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;white-space:normal}
  html body .wm-tiret:not(#_){display:none}
  html body .wm-tag:not(#_){grid-area:tag;justify-self:start;margin-top:6px}
  html body .wm-row .wm-star:not(#_){grid-area:star;align-self:center;width:40px;height:40px;margin-right:-4px}
  html body .wm-row .wm-star .sm-ico:not(#_){width:22px;height:22px}
  html body .wm-meta:not(#_){grid-area:meta;justify-self:end}
  html body .wm-row.unread :is(.wm-from,.wm-sub):not(#_){font-weight:800}
  html body .wm-row.unread .wm-date:not(#_){color:var(--link);font-weight:800}

  /* bouton rond « Écrire » */
  html body .wm-fab:not(#_):not(#_){display:grid;place-items:center;position:relative;z-index:900;width:64px;height:64px;border:0;border-radius:50%!important;padding:0;background:var(--link);color:#fff;box-shadow:0 10px 26px -6px color-mix(in srgb,var(--link) 70%,#000);cursor:pointer;transition:transform .2s ease}
  html body .wm-fab .sm-ico:not(#_):not(#_){width:26px;height:26px;color:#fff!important;stroke:#fff}
  html body .wm-fab:active:not(#_){transform:scale(.92)}
  html body .wm-app.wm-selmode .wm-fab:not(#_):not(#_){transform:scale(0)}
  html body .wm-list:not(#_){padding-bottom:90px}
}

@media (max-width:820px){html body:has(#ibar.on) .wm-fab-w:not(#_){bottom:calc(196px + env(safe-area-inset-bottom,0px))}}
/* l'étoile des Favoris reste jaune dans le tiroir, même sur la ligne surlignée */
@media (max-width:820px){html body .wm-side .wm-folders button[data-box="fav"] .sm-ico:not(#_):not(#_):not(#_){color:#f5b301!important}}

/* le crayon reste dans le cadre de la messagerie : collé en bas de l'écran pendant qu'on fait défiler, il s'arrête au bas du cadre */
.wm-fab-w{display:none}
@media (max-width:820px){
  html body .wm-fab-w:not(#_){display:flex;justify-content:flex-end;position:sticky;bottom:calc(110px + env(safe-area-inset-bottom,0px));z-index:40;height:0;overflow:visible;pointer-events:none;margin-right:14px}
  html body .wm-fab-w .wm-fab:not(#_):not(#_){pointer-events:auto;transform:translateY(-84px)}
  html body .wm-app.wm-selmode .wm-fab-w .wm-fab:not(#_):not(#_){transform:translateY(-84px) scale(0)}
  html body .wm-main-pane:not(#_){padding-bottom:12px}
}
