/* Pro mailbox sheet on phones (v91). Presentation only: every action still uses the existing buttons. */
#inboxSidebar .pms-head,.pms-empty[hidden]{display:none}
@media (max-width:700px){
  /* The page wrapper creates its own layer; lift it while the sheet is open so the sheet sits above the dimmed page. */
  html body.pms-open [data-pms-lift]{z-index:auto!important;transform:none!important;filter:none!important;contain:none!important;will-change:auto!important;backdrop-filter:none!important;isolation:auto!important}
  html.pms-lock,html.pms-lock body{overflow:hidden!important;overscroll-behavior:none}
  html body.pms-open .v3-dock{display:none!important}
  html body.pms-open .v3-backdrop{background:rgba(9,14,28,.5)!important;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}

  html[data-atelier][lang] body.tma-mobile-v3.v3-managing.pms-open #inboxApp #inboxSidebar,
  html[data-atelier][lang] body.tma-mobile-v3.v3-managing.pms-open .studio-workspace #inboxSidebar,
  html[data-atelier][lang] body.tma-mobile-v3.v3-managing.pms-open #inboxSidebar{
    display:flex!important;flex-direction:column!important;gap:0!important;
    position:fixed!important;inset:auto 0 0 0!important;top:auto!important;width:100%!important;
    height:auto!important;min-height:min(420px,70dvh)!important;max-height:88dvh!important;
    margin:0!important;padding:0 0 env(safe-area-inset-bottom,0px)!important;overflow:hidden!important;
    background:var(--v3-surface,#fff)!important;color:var(--v3-ink,#0f1b33)!important;
    border:0!important;border-radius:22px 22px 0 0!important;
    box-shadow:0 -18px 48px rgba(9,14,28,.28)!important;z-index:10003!important;
    transition:transform .2s ease;touch-action:auto
  }
  body.pms-open #inboxSidebar.pms-dragging{transition:none!important}

  /* Header: grab handle, title, live count and a visible close button. */
  html body.pms-open #inboxSidebar .pms-head{order:-1;flex:none;display:block;padding:8px 16px 10px;border-bottom:1px solid var(--v3-line,#e4e8f1);touch-action:none;cursor:grab}
  .pms-grip{display:block;width:42px;height:5px;margin:0 auto 10px;border-radius:99px;background:var(--v3-line,#d9deea)}
  .pms-row{display:flex;align-items:center;gap:10px}
  .pms-title{flex:1;min-width:0;margin:0;font-size:18px;font-weight:800;line-height:1.3;color:var(--v3-ink,#0f1b33)}
  .pms-count{flex:none;direction:ltr;padding:4px 10px;border-radius:99px;background:var(--v3-soft,#eaefff);color:var(--v3-brand,#2f55e8);font-size:13px;font-weight:800}
  .pms-close{flex:none;width:38px;height:38px;display:grid;place-items:center;border:0;border-radius:50%;background:var(--v3-soft,#eef1f8);color:var(--v3-ink,#0f1b33);cursor:pointer}
  .pms-close svg,.pms-search svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
  .pms-close:focus-visible,.pms-search input:focus-visible{outline:2px solid var(--v3-brand,#2f55e8);outline-offset:2px}
  .pms-search{display:flex;align-items:center;gap:8px;margin-top:10px;padding:0 12px;height:42px;border:1px solid var(--v3-line,#e4e8f1);border-radius:12px;background:var(--v3-bg,#f6f7fb);color:var(--v3-muted,#5b6780)}
  .pms-search[hidden]{display:none!important}
  html body #inboxSidebar .pms-search input{flex:1;min-width:0;width:auto;height:100%;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;-webkit-appearance:none;appearance:none;color:var(--v3-ink,#0f1b33);font:inherit;font-size:16px;outline:0}
  html body #inboxSidebar .pms-search input::placeholder{color:var(--v3-muted,#5b6780);opacity:1}
  html body #inboxSidebar .pms-search input::-webkit-search-cancel-button{-webkit-appearance:none}
  body.pms-open #inboxSidebar .pms-empty{flex:none;margin:22px 16px;text-align:center;color:var(--v3-muted,#5b6780);font-size:14px}
  body.pms-open #inboxSidebar .pms-empty[hidden],body:not(.pms-open) .pms-empty{display:none!important}

  /* Fixed controls under the header; only the mailbox list scrolls. */
  body.pms-open #inboxSidebar #tmaInboxTopbar{flex:none;margin:0!important;padding:12px 16px 4px!important}
  body.pms-open #inboxSidebar #tmaInboxTopbar .tma-inbox-limit{display:none!important}
  body.pms-open #inboxSidebar #tmaInboxTopbar .tma-inbox-top-actions{display:flex!important;gap:8px!important;margin:0!important;padding:0!important;border:0!important;background:none!important;box-shadow:none!important}
  body.pms-open #inboxSidebar #tmaInboxTopbar .tma-inbox-top-actions>button{flex:1 1 0;min-height:44px;margin:0!important;border-radius:12px!important;border:1px solid var(--v3-line,#e4e8f1)!important;background:var(--v3-surface,#fff)!important;color:var(--v3-ink,#0f1b33)!important;font-weight:700!important;box-shadow:none!important}
  body.pms-open #inboxSidebar #tmaInboxTopbar .tma-inbox-top-actions>.tma-top-create{background:var(--v3-brand,#2f55e8)!important;border-color:var(--v3-brand,#2f55e8)!important;color:#fff!important}
  body.pms-open #inboxSidebar #tmaInboxTopbar .tma-inbox-top-actions>.tma-top-create:disabled{opacity:.5}
  body.pms-open #inboxSidebar #tmaInboxTopbar .tma-inbox-top-actions>.tma-top-settings{flex:0 0 44px;padding:0!important}
  html[data-atelier][data-atelier-family][lang] body.pms-open.v3-managing #inboxApp #inboxSidebar #inboxSelectionToolbar.tma-inbox-compact-row>.tma-inbox-limit.tma-inbox-limit,
  html[data-atelier][data-atelier-family][lang] body.pms-open.v3-managing #inboxSidebar #inboxSelectionToolbar.tma-inbox-compact-row .tma-inbox-limit.tma-inbox-limit,
  html body.pms-open #inboxSidebar #inboxSelectionToolbar .tma-inbox-limit{display:none!important}
  body.pms-open #inboxSidebar #inboxSelectionToolbar{flex:none;margin:0!important;padding:6px 16px!important;border-bottom:1px solid var(--v3-line,#e4e8f1)!important}
  body.pms-open #inboxSidebar .inbox-heading,
  body.pms-open #inboxSidebar .side-add-wrap,
  body.pms-open #inboxSidebar .ad-slot,
  body.pms-open #inboxSidebar .sidebar-usage,
  body.pms-open #inboxSidebar>.v3-close:not(:focus-visible){display:none!important}

  html body.pms-open #inboxSidebar #localInboxList,
  html body.pms-open #inboxSidebar #localInboxList.has-inbox-scroll{flex:1 1 auto!important;min-height:0!important;max-height:none!important;height:auto!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch;padding:10px 16px 16px!important;margin:0!important;display:flex!important;flex-direction:column!important;gap:8px!important;scroll-padding:12px}
  body.pms-open #inboxSidebar #localInboxList .inbox-chip{margin:0!important;flex:none}
  body.pms-open #inboxSidebar #localInboxList .inbox-chip.pms-hide{display:none!important}
  body.pms-open #inboxSidebar #localInboxList .inbox-chip.active{border-color:var(--v3-brand,#2f55e8)!important;box-shadow:0 0 0 1px var(--v3-brand,#2f55e8) inset!important;background:var(--v3-soft,#eef2ff)!important}
}
@media (max-width:700px) and (prefers-reduced-motion:no-preference){
  html[data-atelier][lang] body.tma-mobile-v3.v3-managing.pms-open #inboxSidebar{animation:pms-up .24s cubic-bezier(.2,.8,.2,1)!important}
  @keyframes pms-up{from{transform:translateY(40px);opacity:.6}to{transform:none;opacity:1}}
}
