/* Édition 30.4 — messagerie compacte et professionnelle */
.v303-compose-float{display:none!important}
.v303-launch-row{margin:14px 28px 0}
.v303-mail-btn{min-width:220px;border-radius:16px;padding:14px 20px;font-size:1rem;box-shadow:0 8px 22px rgba(20,35,77,.16)}
.v303-overlay{padding:18px;align-items:center}
.v303-dialog{width:min(1080px,100%);height:min(84vh,820px);border-radius:24px;background:#f7f9fc;grid-template-rows:auto 1fr;border:1px solid rgba(20,35,77,.09)}
.v303-head{padding:16px 20px;min-height:72px}
.v303-head .eyebrow{font-size:.72rem;letter-spacing:.14em;margin:0 0 2px}
.v303-head h2{font-size:1.35rem;margin:0 0 3px}
.v303-head p{font-size:.88rem}
.v303-close{width:42px;height:42px;font-size:1.35rem}
.v303-layout{grid-template-columns:220px minmax(0,1fr)}
.v303-sidebar{padding:14px;background:#152654;gap:4px}
.v303-sidebar button{padding:11px 12px;border-radius:10px;font-size:.9rem;line-height:1.2}
.v303-sidebar .v303-new{margin-bottom:8px;background:#d92d27}
.v303-main{padding:18px;background:#f7f9fc}
.v303-toolbar{gap:8px;margin-bottom:12px}
.v303-search{padding:10px 12px;border-radius:12px;font-size:.9rem}
.v303-action{padding:9px 12px;border-radius:10px;font-size:.86rem}
.v303-list{gap:8px}
.v303-item{border-radius:14px;padding:13px 14px;box-shadow:0 3px 12px rgba(20,35,77,.04)}
.v303-item h4{font-size:.98rem;margin-bottom:3px}
.v303-meta{font-size:.72rem}
.v303-body{font-size:.88rem;line-height:1.45;margin-top:7px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.v303-note{font-size:.8rem;padding:10px}
.v303-item-actions{gap:4px}
.v303-icon{padding:7px;border-radius:8px}
.v303-empty{padding:20px;font-size:.9rem}
.v303-compose{max-width:720px;border-radius:18px;padding:18px;gap:10px}
.v303-compose h3{margin:0 0 4px;color:#14234d;font-size:1.15rem}
.v303-compose input,.v303-compose textarea,.v303-compose select{padding:11px 12px;border-radius:11px;font-size:.92rem}
.v303-compose textarea{min-height:140px}
.v303-tabs-mobile{display:none}
@media(max-width:760px){
  .v303-launch-row{margin:12px 14px 0}
  .v303-overlay{padding:0;align-items:stretch}
  .v303-dialog{height:100dvh;max-height:none;border-radius:0;width:100%;grid-template-rows:auto auto 1fr}
  .v303-head{padding:12px 14px;min-height:64px}
  .v303-head h2{font-size:1.2rem}
  .v303-head p{font-size:.78rem;max-width:280px;line-height:1.35}
  .v303-close{width:40px;height:40px}
  .v303-layout{grid-template-columns:1fr;grid-template-rows:1fr}
  .v303-sidebar{display:none}
  .v303-tabs-mobile{display:flex;gap:6px;padding:8px 10px;background:#152654;overflow-x:auto;scrollbar-width:none}
  .v303-tabs-mobile::-webkit-scrollbar{display:none}
  .v303-tabs-mobile button{flex:0 0 auto;min-height:38px;border:0;border-radius:10px;padding:8px 11px;background:#263a68;color:#fff;font-size:.78rem;font-weight:800;white-space:nowrap}
  .v303-tabs-mobile button.active{background:#fff;color:#14234d}
  .v303-tabs-mobile button.v303-new{background:#d92d27;color:#fff}
  .v303-main{padding:12px}
  .v303-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px;align-items:center}
  .v303-toolbar .v303-search{grid-column:1/-1;width:100%;min-width:0}
  .v303-action{padding:9px 10px;font-size:.8rem}
  .v303-item{padding:12px;grid-template-columns:1fr auto;gap:8px}
  .v303-item-actions{justify-content:flex-start}
  .v303-item h4{font-size:.92rem}
  .v303-body{font-size:.84rem;-webkit-line-clamp:2}
  .v303-compose{padding:14px;border-radius:14px}
  .v303-compose textarea{min-height:125px}
}
@media(max-width:390px){
  .v303-head p{display:none}
  .v303-tabs-mobile button{font-size:.74rem;padding:8px 10px}
  .v303-item{grid-template-columns:1fr}
  .v303-item-actions{justify-content:flex-end}
}

/* Correctif 30.8 — conversations continues, lecture et réponses */
.v308-thread-open{display:flex;width:100%;align-items:center;justify-content:space-between;gap:14px;text-align:left;background:transparent;border:0;padding:0;color:inherit;cursor:pointer}
.v308-thread-copy{display:grid;min-width:0;gap:3px}
.v308-thread-copy>strong{font-size:.98rem;color:#14234d}
.v308-unread-pill,.v308-read-pill{flex:0 0 auto;border-radius:999px;padding:6px 9px;font-size:.7rem;font-weight:900;white-space:nowrap}
.v308-unread-pill{background:#e30613;color:#fff}
.v308-read-pill{background:#edf1f7;color:#657087}
.v308-thread{display:grid;grid-template-rows:auto minmax(180px,1fr) auto;height:100%;min-height:0;gap:12px}
.v308-thread-head{display:flex;align-items:center;gap:12px;padding-bottom:10px;border-bottom:1px solid #dfe5ef}
.v308-thread-head h3{margin:0;color:#14234d;font-size:1.18rem}
.v308-thread-head p{margin:3px 0 0;color:#6d778d;font-size:.82rem}
.v308-thread-messages{display:flex;flex-direction:column;gap:10px;overflow-y:auto;padding:8px 4px 12px;min-height:0}
.v308-bubble{max-width:min(78%,650px);padding:12px 14px;border-radius:16px;box-shadow:0 3px 12px rgba(20,35,77,.05)}
.v308-bubble.mine{align-self:flex-end;background:#152654;color:#fff;border-bottom-right-radius:5px}
.v308-bubble.theirs{align-self:flex-start;background:#fff;color:#14234d;border:1px solid #e0e6f0;border-bottom-left-radius:5px}
.v308-bubble-author{font-size:.72rem;font-weight:900;margin-bottom:5px;opacity:.8}
.v308-bubble p{margin:0;white-space:pre-wrap;line-height:1.48;font-size:.9rem}
.v308-bubble time{display:block;margin-top:7px;font-size:.67rem;opacity:.7;text-align:right}
.v308-reply-form{display:grid;gap:8px;padding-top:10px;border-top:1px solid #dfe5ef}
.v308-reply-form label{font-weight:900;color:#14234d;font-size:.84rem}
.v308-reply-form textarea{min-height:86px;max-height:180px;resize:vertical;border:1px solid #ced7e6;border-radius:12px;padding:11px 12px;font:inherit;background:#fff}
.v308-reply-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
@media(max-width:760px){
  .v308-thread{height:calc(100dvh - 150px)}
  .v308-thread-head{align-items:flex-start}
  .v308-thread-head h3{font-size:1rem}
  .v308-bubble{max-width:88%;padding:11px 12px}
  .v308-reply-form textarea{min-height:74px}
  .v308-unread-pill,.v308-read-pill{font-size:.65rem;padding:5px 7px}
}

/* =====================================================
   V35.9 — STABILITÉ CLAVIER SAFARI / MESSAGERIE MOBILE
   - fond verrouillé avec body fixe ;
   - fenêtre alignée sur le visualViewport ;
   - en-tête et onglets toujours visibles ;
   - seul le contenu central défile.
   ===================================================== */
:root{
  --v303-visual-height:100dvh;
  --v303-visual-width:100vw;
  --v303-visual-top:0px;
  --v303-visual-left:0px;
}
html.v303-modal-open{overflow:hidden!important;overscroll-behavior:none!important}
body.v303-modal-open{
  position:fixed!important;
  left:0!important;
  right:0!important;
  width:100%!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
.v303-overlay{
  position:fixed!important;
  inset:0!important;
  width:var(--v303-visual-width)!important;
  height:var(--v303-visual-height)!important;
  transform:translate3d(var(--v303-visual-left),var(--v303-visual-top),0)!important;
  max-width:none!important;
  max-height:none!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  touch-action:none;
  z-index:100000!important;
}
.v303-dialog{
  width:100%;
  height:100%;
  max-height:100%;
  min-height:0;
  overflow:hidden!important;
  display:grid;
  touch-action:pan-y;
}
.v303-head,.v303-tabs-mobile{flex:0 0 auto;min-width:0}
.v303-head{position:relative;z-index:5;background:#fff}
.v303-tabs-mobile{position:relative;z-index:5}
.v303-layout,.v303-main,#v303-content{min-height:0;min-width:0}
.v303-layout{overflow:hidden!important}
.v303-main{
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain!important;
  scroll-behavior:auto!important;
  scroll-padding-top:18px;
  scroll-padding-bottom:32px;
  touch-action:pan-y;
}
.v303-compose input,.v303-compose select,.v303-compose textarea,.v308-reply-form textarea{font-size:16px!important}
.v303-compose textarea#v303-body{
  height:144px!important;
  min-height:144px!important;
  max-height:144px!important;
  resize:none!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  line-height:1.45;
}
.v308-reply-form textarea{
  height:96px!important;
  min-height:76px!important;
  max-height:150px!important;
  resize:none!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
@media(max-width:760px){
  .v303-overlay{padding:0!important;align-items:stretch!important}
  .v303-dialog{
    border-radius:0!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
  }
  .v303-head{padding-top:max(12px,env(safe-area-inset-top))!important}
  .v303-layout{height:100%!important;grid-template-columns:1fr!important;grid-template-rows:minmax(0,1fr)!important}
  .v303-main{height:100%!important;padding:12px 12px max(18px,env(safe-area-inset-bottom))!important}
  .v303-compose{align-content:start;margin:0 auto;max-width:100%;width:100%}
  .v303-compose textarea#v303-body{height:128px!important;min-height:128px!important;max-height:128px!important}
  .v303-compose .v303-toolbar{position:relative;z-index:1;margin-bottom:0}
  .v308-thread{height:100%!important;min-height:0!important}
}
