/* Shared mobile resilience layer: desktop layouts are unchanged. */
@media(max-width:1023px){
 .workspace,.main-content,.public-shell,.public-main,.panel,.card{min-width:0;max-width:100%}
 .main-content{overflow-wrap:anywhere}
 .page-heading,.wl-toolbar,.actions{min-width:0;flex-wrap:wrap}
 .wl-table-scroll,.table-responsive,.wl-datatable{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
 .wl-modal,.intake-modal{max-width:100%;overflow-y:auto;overscroll-behavior:contain}
 img,video,canvas,iframe{max-width:100%}
}
@media(max-width:640px){
 .form-row,.grid{grid-template-columns:minmax(0,1fr)}
 .main-content{padding-left:14px!important;padding-right:14px!important}
 .topbar{padding-left:12px;padding-right:12px;min-width:0}
 .top-global-search{min-width:0}
 .top-actions{flex-shrink:0;gap:4px}
 .public-actions{gap:5px}
 .public-topbar{gap:8px}
 .wl-public-nav.open{max-height:calc(100dvh - 70px);overflow-y:auto}
 input,select,textarea{max-width:100%;font-size:16px}
 .wl-modal-backdrop,.intake-modal-backdrop{padding-bottom:env(safe-area-inset-bottom)}
 .wl-modal,.intake-modal{max-height:calc(100dvh - env(safe-area-inset-top) - 12px)}
}


/* v0.46.94.25: one mobile header. Desktop auth and public navigation are explicitly hidden. */
.wl-header-v25 .wl-v24-menu-toggle,.wl-header-v25 .wl-v24-menu{display:none!important}
.wl-header-v25 .wl-v24-menu[hidden]{display:none!important}
.wl-header-v25 .wl-header-identity{display:flex;align-items:center;gap:12px;min-width:0}
@media(max-width:900px){
 html body .public-shell header.wl-header-v25{display:grid!important;grid-template-columns:minmax(0,1fr) 44px!important;align-items:center!important;position:relative!important;min-width:0!important;width:100%!important;height:68px!important;padding:0 12px!important;gap:8px!important;overflow:visible!important}
 html body .public-shell header.wl-header-v25 nav.wl-public-nav,
 html body .public-shell header.wl-header-v25 .public-actions.wl-desktop-auth{display:none!important;visibility:hidden!important}
 html body .public-shell header.wl-header-v25 .wl-header-identity{grid-column:1!important;display:flex!important;align-items:center!important;gap:8px!important;min-width:0!important;width:100%!important;overflow:hidden!important}
 html body .public-shell header.wl-header-v25 .public-brand{display:flex!important;align-items:center!important;gap:5px!important;flex:0 1 auto!important;min-width:0!important;max-width:52%!important;margin:0!important;padding:0!important}
 html body .public-shell header.wl-header-v25 .public-brand img{width:32px!important;height:32px!important;flex:0 0 32px!important}
 html body .public-shell header.wl-header-v25 .public-brand span{font-size:clamp(15px,4vw,20px)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
 html body .public-shell header.wl-header-v25 .wl-codak-partner{display:flex!important;align-items:center!important;gap:5px!important;flex:1 1 0!important;min-width:0!important;margin:0!important;padding-left:8px!important;border-left:1px solid rgba(255,255,255,.25)!important}
 html body .public-shell header.wl-header-v25 .wl-codak-partner img{width:26px!important;height:26px!important;flex:0 0 26px!important}
 html body .public-shell header.wl-header-v25 .wl-codak-partner strong{display:block!important;font-size:clamp(9px,2.4vw,11px)!important;line-height:1.2!important;overflow-wrap:normal!important}
 html body .public-shell header.wl-header-v25 button.wl-v24-menu-toggle{grid-column:2!important;display:flex!important;align-items:center!important;justify-content:center!important;width:44px!important;height:44px!important;padding:0!important;border:1px solid rgba(255,255,255,.4)!important;border-radius:10px!important;background:transparent!important;color:white!important;font-size:23px!important}
 html body .public-shell header.wl-header-v25 .wl-v24-menu:not([hidden]){display:grid!important;position:absolute!important;top:100%!important;right:8px!important;left:auto!important;width:min(240px,calc(100vw - 16px))!important;padding:10px!important;gap:7px!important;background:#073426!important;border-radius:0 0 12px 12px!important;box-shadow:0 14px 28px rgba(0,0,0,.3)!important;z-index:300!important}
 html body .public-shell header.wl-header-v25 .wl-v24-menu button{display:flex!important;width:100%!important;min-height:46px!important;align-items:center!important;justify-content:center!important;background:#fff!important;color:#073426!important;border-radius:9px!important;font-size:15px!important}
}

/* v0.46.94.26: authenticated bottom-navigation resilience only. */
@media(max-width:640px){
 .mobile-bottom-nav{box-sizing:border-box;width:100%;max-width:100vw;bottom:0;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px));overflow:visible}
 .mobile-bottom-nav .mobile-nav-item{min-width:0;max-width:100%;touch-action:manipulation}
 .mobile-bottom-nav .mobile-nav-item span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .mobile-bottom-nav .mobile-nav-item:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}
 .main-content{padding-bottom:max(96px,calc(80px + env(safe-area-inset-bottom,0px)))!important}
}

/* v0.46.94.27: shared mobile dashboard, panel, controls and overflow fixes. */
@media(max-width:760px){
 .wl-dashboard-header{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:14px!important;min-width:0}
 .wl-dashboard-header>div{min-width:0;max-width:100%}
 .wl-dashboard-header .actions{display:flex;flex-wrap:wrap;gap:9px;width:100%}
 .wl-dashboard-header .actions>.btn{flex:1 1 160px;min-width:0;justify-content:center;text-align:center}
 .panel>.section-head,.card>.section-head,.wl-section-card>.section-head{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px!important}
 .panel>.section-head>*,.card>.section-head>*,.wl-section-card>.section-head>*{min-width:0;max-width:100%}
 .panel>.section-head>.btn,.card>.section-head>.btn,.wl-section-card>.section-head>.btn{display:flex;align-items:center;justify-content:center;width:100%;white-space:normal;text-align:center;min-height:44px}
 .metric-grid,.wl-dashboard-grid,.wl-metrics{grid-template-columns:minmax(0,1fr)!important}
 .metric-card{min-width:0;overflow-wrap:break-word}
 .metric-card strong{overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
 .wl-inline-cards{grid-template-columns:minmax(0,1fr)!important}
 .wl-inline-cards>a{min-width:0}
 .wl-table-scroll,.table-responsive,.wl-datatable{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch}
 .wl-datatable-head,.wl-datatable-foot{gap:10px;max-width:100%}
 .wl-datatable-head input,.wl-datatable-head select{max-width:100%;min-width:0}
 .modal-dialog,.wl-modal,.intake-modal{max-width:calc(100vw - 20px);box-sizing:border-box}
}
@media(max-width:640px){
 .mobile-bottom-nav .mobile-nav-item span{font-size:clamp(9px,2.65vw,12px)}
 .quick-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* v0.46.94.28: mobile-only structural resilience; no desktop or authorization changes. */
@media (max-width:760px){
 .test-mode-banner{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:12px!important;padding:14px!important}
 .test-mode-banner>span{flex:none!important;min-width:0;overflow-wrap:break-word;line-height:1.5}
 .test-mode-banner form{display:block;width:100%;min-width:0}
 .test-mode-banner form .btn{display:flex;width:100%;min-height:44px;justify-content:center;align-items:center;white-space:normal}
 .panel>.section-head{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 .panel>.section-head>.btn{grid-column:1;width:100%!important;min-width:0!important}
 .panel>.section-head>div{min-width:0;width:100%}
}

/* v0.46.94.32: mobile containment, non-invasive shared controls */
@media(max-width:640px){
  .wl-secure-preview-head,.vc-preview-head{min-width:0}
  .wl-secure-preview-head strong,.vc-preview-head strong{min-width:0;overflow-wrap:anywhere}
  .wl-secure-preview-body,.vc-preview-content{min-height:0;overflow:auto}
  .wl-tabs{max-width:100%;min-width:0}
  .wl-tabs [role=tablist]{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
  [data-wl-smart-table]{max-width:100%;min-width:0}
  [data-wl-smart-table] .table-responsive{max-width:100%;overflow-x:auto}
  [data-wl-modal]{max-width:100vw}
  [data-wl-modal] input,[data-wl-modal] select,[data-wl-modal] textarea{max-width:100%;min-width:0}
}

/* v0.46.94.33: shared table/form mobile usability; no desktop overrides. */
@media (max-width:760px){
  .wl-datatable{min-width:0;max-width:100%;overflow:visible}
  .wl-datatable .wl-table-scroll{display:block;max-width:100%;width:100%;overflow-x:auto;overflow-y:visible;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border-radius:8px}
  .wl-datatable .wl-table-scroll:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
  .wl-datatable .wl-table-scroll>table{width:max-content;min-width:100%}
  .wl-datatable-head,.wl-datatable-foot{display:flex;flex-wrap:wrap;align-items:stretch;gap:12px;min-width:0}
  .wl-datatable-head>*,.wl-datatable-foot>*{min-width:0;max-width:100%}
  .wl-datatable-head input[type=search],.wl-datatable-head input[type=text]{width:100%;min-width:0;box-sizing:border-box}
  .wl-datatable .wl-page-btn{min-width:36px;min-height:40px;touch-action:manipulation}
  .form-row,.form-grid,.cms-field-grid{min-width:0}
  .form-row>*,.form-grid>*,.cms-field-grid>*{min-width:0;max-width:100%}
  .form-actions{display:flex;flex-wrap:wrap;gap:10px;min-width:0}
  .form-actions>.btn,.form-actions>button{min-height:44px;white-space:normal;max-width:100%}
  .field input:not([type=checkbox]):not([type=radio]),.field select,.field textarea{box-sizing:border-box;min-width:0;max-width:100%}
  [data-wl-modal] .wl-modal,[data-wl-modal] .modal-dialog{max-height:calc(100dvh - 24px - env(safe-area-inset-bottom,0px));overflow-y:auto;overscroll-behavior:contain}
}
@media (max-width:480px){
  .wl-datatable-head>*,.wl-datatable-foot>*{flex-basis:100%}
  .form-actions>.btn,.form-actions>button{flex:1 1 100%}
}

/* v0.46.94.35: member hero contrast and directory containment */
.wl-member-hero h1{color:#fff!important}.wl-member-hero p{color:rgba(255,255,255,.9)!important}
@media(max-width:700px){.member-registry,.discovery-start,.discovery-quick,.discovery-advanced{min-width:0;max-width:100%}.member-toolbar input[type=search]{width:100%!important;max-width:100%!important;min-width:0!important}.country-estate-summary,.wl-table-scroll{max-width:100%;min-width:0}.wl-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}}

/* Compact, accessible Test Lab banner */
@media(max-width:760px){.test-mode-banner.wl-test-compact{display:flex;align-items:center;gap:8px;padding:8px 12px!important;flex-wrap:wrap;font-size:11px!important;line-height:1.35!important}.test-mode-banner.wl-test-compact>span{flex:1 1 170px;min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.test-mode-banner.wl-test-compact form{flex:0 0 auto}.test-mode-banner.wl-test-compact .btn{padding:7px 9px!important;font-size:11px!important;min-height:34px!important}}
