/* One live composer is shared between the feed and the full-screen compose dialog. */
.mc-compose-fab{display:none}
html:has(body.mc-compose-open){overflow:hidden;scrollbar-gutter:auto;scroll-behavior:auto}
body.bpx-ui.mc-compose-open{position:fixed;top:var(--mc-compose-scroll,0px);left:0;right:0;width:100%;overflow:hidden}
.mc-compose-dialog{position:fixed;inset:var(--mc-compose-top,0px) 0 auto;margin:0 auto;padding:0;border:0;width:100%;max-width:640px;height:var(--mc-compose-height,100dvh);max-height:none;background:var(--bpx-bg);color:var(--bpx-text);overflow:hidden;overscroll-behavior:contain}
.mc-compose-dialog::backdrop{background:#0009}
.mc-compose-screen{display:flex;flex-direction:column;height:100%;min-width:0}
.mc-compose-header{display:flex;flex:0 0 auto;align-items:center;gap:8px;min-height:64px;padding:calc(8px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) 8px max(8px,env(safe-area-inset-left,0px));border-bottom:1px solid var(--bpx-line)}
.mc-compose-header h2{font-size:16px;font-weight:750;line-height:1.3;flex:1;min-width:0}
.mc-compose-header>.bpx-icon-button{width:44px;height:44px;flex:0 0 44px}
.mc-compose-header .bpx-primary{min-height:40px;padding:10px 18px!important}
.mc-compose-body{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:max(20px,env(safe-area-inset-bottom,0px))}
.mc-compose-dialog .bpx-composer{display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;padding:18px max(12px,env(safe-area-inset-right,0px)) 16px max(12px,env(safe-area-inset-left,0px));margin:0}
.mc-compose-dialog .bpx-composer .bpx-avatar{width:38px;height:38px}
.mc-compose-dialog #bpx-post-form{min-width:0;width:100%;padding:0;margin:0}
.mc-compose-dialog #bpx-post-content{display:block;width:100%;min-width:0;min-height:clamp(96px,25dvh,220px);max-height:320px;padding:12px 0;border:0;border-radius:0;background:transparent;color:var(--bpx-text);resize:vertical;font-size:18px;line-height:1.5;box-shadow:none}
.mc-compose-dialog #bpx-post-content::placeholder{color:var(--bpx-muted);opacity:1}
.mc-compose-dialog .mc-post-community select{width:100%;min-height:40px;font-size:16px;text-overflow:ellipsis}
.mc-compose-dialog .bpx-reply-permission{font-size:11px;align-items:flex-start;margin-top:10px!important}
.mc-compose-dialog .bpx-reply-permission svg{margin-top:1px}
.mc-compose-dialog .bpx-compose-tools .bpx-icon-button{width:44px;height:44px;color:var(--bpx-blue);touch-action:manipulation}
.mc-compose-dialog .bpx-attachment-preview{min-width:0;overflow-wrap:anywhere}
.mc-compose-dialog .bpx-attachment-preview>span{min-width:0;flex:1}
.mc-compose-dialog .bpx-attachment-preview>button{min-width:44px;min-height:44px;font-size:22px}
.mc-compose-dialog .bpx-form-error{overflow-wrap:anywhere}

/* Phone layout, including short landscape screens. Do not hide page overflow. */
@media(max-width:767px),(max-width:1000px) and (max-height:500px){
  :root{--mc-nav-height:calc(56px + env(safe-area-inset-bottom,0px));--mc-header-height:calc(60px + env(safe-area-inset-top,0px))}
  html:has(body.bpx-ui){scroll-behavior:auto;scrollbar-gutter:stable;scroll-padding-top:calc(var(--mc-header-height) + 12px);scroll-padding-bottom:calc(var(--mc-nav-height) + 20px)}
  html:has(body.mc-gallery-open),html:has(body.mc-compose-open){scrollbar-gutter:auto}
  body.bpx-ui{width:100%;min-width:0;margin:0}
  .bpx-layout{display:block;width:100%;max-width:100%;min-width:0;margin:0}
  .bpx-left,.bpx-right{display:none}
  .bpx-main{width:100%;min-width:0;min-height:100dvh;border:0;padding-bottom:calc(var(--mc-nav-height) + 20px)}
  .bpx-content,.bpx-ui #buddypress,.bpx-ui #item-body{width:100%;min-width:0;max-width:100%}
  .bpx-content{padding-inline:env(safe-area-inset-left,0px) env(safe-area-inset-right,0px)}
  /* The floating button moves this same form into the dialog when needed. */
  .bpx-ui #buddypress .bpx-composer{display:none}
  .bpx-page-header{height:var(--mc-header-height);padding:calc(8px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) 8px max(12px,env(safe-area-inset-left,0px));gap:8px;top:0}
  .bpx-page-header::after{display:none}
  .bpx-page-header>div{min-width:0;max-width:calc(100% - 96px)}
  .bpx-page-header h1,.bpx-page-header>div>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .bpx-page-header h1{font-size:18px}
  .bpx-page-header>div>span{font-size:11px}
  .bpx-page-header>.bpx-icon-button{flex:0 0 36px}
  .bpx-mobile-nav{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:center;position:fixed;inset:auto 0 0;z-index:100;width:100%;height:var(--mc-nav-height);padding:0 max(6px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(6px,env(safe-area-inset-left,0px));margin:0;background:var(--bpx-bg);border-top:1px solid var(--bpx-line);box-shadow:none;transform:none}
  .bpx-mobile-nav a{display:grid;place-items:center;min-width:0;min-height:48px;padding:0;color:var(--bpx-muted);touch-action:manipulation}
  .bpx-mobile-nav a.is-current{color:var(--bpx-text)}
  .bpx-mobile-nav .bpx-icon{width:25px;height:25px}
  .bpx-ui .mc-compose-fab{display:grid;place-items:center;position:fixed;z-index:110;right:calc(18px + env(safe-area-inset-right,0px));bottom:calc(var(--mc-nav-height) + 18px);width:56px;height:56px;margin:0;padding:0;border:0;border-radius:50%;background:var(--bpx-blue);color:var(--mc-on-accent);box-shadow:0 4px 16px #0004;touch-action:manipulation}
  .mc-compose-fab .bpx-icon{width:27px;height:27px;stroke-width:2}
  .mc-compose-fab:hover{background:var(--mc-accent-hover)}
  .mc-compose-fab:active{transform:scale(.96)}
  .mc-compose-open .mc-compose-fab,.mc-gallery-open .mc-compose-fab{visibility:hidden}
  .mc-compose-dialog{max-width:100%}
  .bpx-mobile-theme{display:grid;place-items:center;position:fixed;z-index:50;top:calc(9px + env(safe-area-inset-top,0px));right:calc(56px + env(safe-area-inset-right,0px));bottom:auto;width:40px;height:40px;margin:0;padding:8px;border:0;border-radius:50%;background:transparent;color:var(--bpx-text);box-shadow:none}
  .bpx-toast{bottom:calc(var(--mc-nav-height) + 12px);max-width:calc(100vw - 24px);overflow-wrap:anywhere}
  .bpx-ui #buddypress .bp-navs{width:100%;min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;scroll-padding-inline:12px}
  .bpx-ui #buddypress .bp-navs::-webkit-scrollbar{display:none}
  .bpx-ui #buddypress .bp-navs>ul{display:flex!important;flex-wrap:nowrap!important;align-items:stretch;min-width:100%;width:max-content;max-width:none;margin:0!important;padding:0!important}
  .bpx-ui #buddypress .bp-navs>ul>li{flex:0 0 auto;width:auto!important;min-width:0;margin:0!important;float:none!important;white-space:nowrap}
  .bpx-ui #buddypress .bp-navs>ul>li>a{display:flex;align-items:center;justify-content:center;gap:5px;min-height:46px;padding:12px 15px;font-size:13px}
  .bpx-ui #buddypress .standard-form,.bpx-ui #buddypress .standard-form fieldset,.bpx-ui #buddypress .editfield{min-width:0;max-width:100%;overflow-wrap:anywhere}
  .bpx-ui #buddypress .standard-form fieldset{margin-inline:0;padding:12px}
  .bpx-ui #buddypress .profile.edit{padding:0}
  .bpx-ui #buddypress .standard-form .editfield{padding:12px;margin-bottom:14px}
  .bpx-ui #buddypress .editfield>fieldset{margin:0;padding:0;border:0;background:transparent}
  .bpx-ui #buddypress .editfield>fieldset>legend{padding:0;margin-bottom:10px}
  .bpx-ui #buddypress .datebox-selects{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.3fr) minmax(0,1fr);gap:7px}
  .bpx-ui #buddypress .datebox-selects label{grid-row:1;margin:0;font-size:12px}
  .bpx-ui #buddypress .datebox-selects select{grid-row:2;width:100%;margin:0;padding:8px 22px 8px 6px}
  .bpx-ui #buddypress .datebox-selects>:nth-of-type(1){grid-column:1}
  .bpx-ui #buddypress .datebox-selects>:nth-of-type(2){grid-column:2}
  .bpx-ui #buddypress .datebox-selects>:nth-of-type(3){grid-column:3}
  .bpx-ui #buddypress input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]),.bpx-ui #buddypress textarea{min-width:0;max-width:100%;font-size:16px}
  .bpx-ui #buddypress .standard-form input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=file]),.bpx-ui #buddypress .standard-form textarea{width:100%}
  .bpx-ui #buddypress select{min-width:0;max-width:100%;font-size:16px}
  .bpx-ui #buddypress :is(input,select,textarea,button){scroll-margin-top:calc(var(--mc-header-height) + 12px);scroll-margin-bottom:calc(var(--mc-nav-height) + 20px)}
  .bpx-ui #buddypress table.profile-fields{table-layout:fixed}
  .bpx-ui #buddypress table.profile-fields td{overflow-wrap:anywhere}
  .bpx-ui #buddypress table.profile-settings th:first-child,.bpx-ui #buddypress table.profile-settings td:first-child{width:40%}
  .bpx-ui #buddypress table.profile-settings th:last-child,.bpx-ui #buddypress table.profile-settings td:last-child{width:60%}
  .bpx-ui #buddypress table.profile-settings select{font-size:16px;padding:8px 26px 8px 8px}
  .bpx-ui #buddypress .mce-tinymce,.bpx-ui #buddypress .wp-editor-wrap{width:100%!important;max-width:100%!important;min-width:0}
  .bpx-ui #buddypress .mce-container-body{max-width:100%}
  .bpx-ui #buddypress .mce-flow-layout{white-space:normal}
  .bpx-ui #buddypress .mce-toolbar .mce-btn-group{max-width:100%}
  .bpx-ui #buddypress .mce-edit-area iframe{width:100%!important}
  .bpx-ui #buddypress .subnav-filters{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:10px 12px}
  .bpx-ui #buddypress .subnav-filters>li,.bpx-ui #buddypress .subnav-filters .component-filters{min-width:0;max-width:100%;margin:0}
  .bpx-ui #buddypress .subnav-filters .dir-search{width:100%;max-width:100%;margin:0}
  .bpx-ui #buddypress .dir-search form{display:flex;min-width:0;max-width:100%}
  .bpx-ui #buddypress .dir-search input{flex:1;min-width:0;width:100%}
  .bpx-profile-bio,.bpx-profile-location,.bpx-post-text,.bpx-reply p,.bpx-member-details{overflow-wrap:anywhere}
  .bpx-profile-counts{flex-wrap:wrap;gap:10px 18px}
  .bpx-ui #buddypress .bp-demo-media{max-width:100%;min-width:0}
  .bpx-ui #buddypress .bp-demo-media img,.bpx-ui #buddypress .bp-demo-media video{max-width:100%;height:auto}
  .bpx-ui #buddypress .bp-demo-media video{aspect-ratio:16/9;object-fit:contain}
  .bpx-ui #buddypress .bpx-reply-form textarea{flex:1 1 160px;width:auto}
  .bpx-post-grid,.bpx-post-body{min-width:0}
  .bpx-ui #buddypress #members-list .bpx-member-row::before,.bpx-ui #buddypress #members-list .bpx-member-row::after{content:none!important;display:none!important}
  .bpx-ui #buddypress #members-list .bpx-member-row{grid-template-columns:36px minmax(0,1fr)!important;gap:9px!important}
  .bpx-ui #buddypress #members-list .bpx-member-row>a{grid-column:1;grid-row:1 / span 2;min-width:0}
  .bpx-ui #buddypress #members-list .bpx-member-details{grid-column:2;grid-row:1;min-width:0}
  .bpx-ui #buddypress #members-list .bpx-member-follow{grid-column:2;grid-row:2;min-width:0}
  .bpx-ui #buddypress #members-list .bpx-member-follow button{min-height:40px;padding:8px 12px!important}
  .mc-feed-select{flex-wrap:wrap;gap:7px}
  .mc-feed-select select{flex:1;min-width:0}
  .mc-post-community select{width:100%;font-size:14px!important}
  .mc-community-member,.mc-invitation{flex-wrap:wrap;gap:10px}
  .mc-community-member>a{flex:1 1 165px;min-width:0}
  .mc-community-member strong,.mc-invitation strong,.mc-invitation small,.mc-community-card h3,.mc-community-card p{overflow-wrap:anywhere}
  .mc-community-member>button,.mc-invitation>button{margin-left:auto;min-height:44px}
  .mc-communities input,.mc-communities textarea,.mc-communities select{font-size:16px}
  .mc-communities button{max-width:100%;white-space:normal;min-height:44px}
  .bpx-ui #notifications-user-list table.notifications .notification-actions a{min-height:44px}
  .mc-gallery-heading{align-items:flex-start;flex-wrap:wrap;gap:8px}
  .mc-lightbox-shell>header{height:calc(62px + env(safe-area-inset-top,0px));padding-top:calc(10px + env(safe-area-inset-top,0px))}
  .mc-lightbox-shell>header{padding-left:max(14px,env(safe-area-inset-left,0px));padding-right:max(14px,env(safe-area-inset-right,0px))}
  .mc-lightbox-shell>header>div{min-width:0;flex:1}
  .mc-lightbox h2{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mc-lightbox .mc-lightbox-prev,.mc-lightbox .mc-lightbox-next{width:44px;height:44px}
  .mc-lightbox .mc-lightbox-prev{left:max(8px,env(safe-area-inset-left,0px))}
  .mc-lightbox .mc-lightbox-next{right:max(8px,env(safe-area-inset-right,0px))}
  .mc-lightbox footer{padding-bottom:max(14px,env(safe-area-inset-bottom,0px))}
}
