/* BTW Lodge mobile search regression fix — targeted overrides, no backend change */
@media (max-width: 980px) {
  /* Flex-basis 320px became an unwanted vertical height in the mobile column. */
  #portalSearchMount,
  #portalSearchMount .lodge-dashboard-search,
  #portalSearchMount .lodge-search-form { box-sizing: border-box; min-width: 0; max-width: 100%; }
  #portalSearchMount .lodge-search-form {
    display:flex; flex-direction:column; align-items:stretch; flex-wrap:nowrap;
    gap:12px; width:100%;
  }
  #portalSearchMount .lodge-search-form input[type="search"].lodge-search-input {
    display:block; box-sizing:border-box; width:100%; max-width:100%;
    flex:0 0 52px !important;
    height:52px !important; block-size:52px !important;
    min-height:52px !important; max-height:52px !important;
    min-block-size:52px; max-block-size:52px;
    align-self:stretch; margin:0; padding:12px 15px;
    line-height:26px; font-size:16px; -webkit-appearance:none; appearance:none;
  }
  #portalSearchMount .lodge-search-form .btn {
    display:flex; align-items:center; justify-content:center;
    flex:0 0 auto; min-height:50px; max-height:64px;
    width:100%; box-sizing:border-box; padding:12px 18px;
  }
  #portalSearchMount .lodge-dashboard-search h3 { overflow-wrap:anywhere; }
  #portalSearchMount .lodge-dashboard-search p { overflow-wrap:anywhere; }
}
@media (max-width: 1100px) {
  /* Use readable full-width category cards on phones, iPads and embedded browsers. */
  body[data-member-section="search"] .lodge-search-source-list {
    display:grid; grid-template-columns:minmax(0,1fr) !important;
    gap:12px; width:100%; max-width:100%; box-sizing:border-box;
  }
  body[data-member-section="search"] .lodge-search-scopes,
  body[data-member-section="search"] .lodge-search-source,
  body[data-member-section="search"] .lodge-search-results-page,
  body[data-member-section="search"] .lodge-search-result-group {
    box-sizing:border-box; min-width:0; max-width:100%;
  }
  body[data-member-section="search"] .lodge-search-source {
    padding:14px 16px; overflow-wrap:anywhere;
  }
  body[data-member-section="search"] .lodge-search-source-head {
    flex-wrap:wrap; gap:8px; align-items:center;
  }
  body[data-member-section="search"] .lodge-search-source-head strong {
    flex:1 1 170px; line-height:1.35; min-width:0;
  }
  body[data-member-section="search"] .lodge-search-source-status {
    flex:0 0 auto; white-space:normal; text-align:center;
  }
}
@media (max-width: 760px) {
  body[data-member-section="search"] #memberSearchGate {padding-bottom:104px;}
  body[data-member-section="search"] .lodge-search-scopes {padding:14px;}
  body[data-member-section="search"] .lodge-search-header .lodge-search-form{
    display:flex; flex-direction:column; align-items:stretch; gap:10px;
  }
  body[data-member-section="search"] .lodge-search-header .lodge-search-input{
    flex:0 0 52px !important; min-height:52px !important; height:52px !important;
    max-height:52px !important; box-sizing:border-box; width:100%;
  }
  body[data-member-section="search"] .lodge-search-header .lodge-search-form .btn{
    flex:0 0 auto; width:100%; min-height:50px;
  }
  /* Preserve ASK artwork but reduce overlay on search cards. */
  body[data-member-section="search"] #btwAskLodgeRoot .btw-ask-launcher {
    width:52px; max-width:52px; --sun-diameter:46px;
    right:max(7px,env(safe-area-inset-right));
    bottom:max(18px,calc(env(safe-area-inset-bottom) + 10px));
    opacity:.94;
  }
  body[data-member-section="search"] #btwAskLodgeRoot .btw-ask-launcher img{
    width:46px; height:46px; border-width:2px;
  }
  body[data-member-section="search"] #btwAskLodgeRoot .btw-ask-launcher-text{
    font-size:9px; padding:0 7px; line-height:1.3;
  }
  /* When iOS keyboard is open, don't cover the text cursor or submit button. */
  body[data-member-section="search"]:has(.lodge-search-input:focus)
    #btwAskLodgeRoot .btw-ask-launcher {
    opacity:0; pointer-events:none;
  }
}
@media (prefers-reduced-motion:reduce) {
  body[data-member-section="search"] .lodge-search-progress::before{animation:none!important}
}