/* Advocatus Pro | Phase 24 mobile-first and PWA safety layer.
 * Loads after previous phase styles. Styling only; no authorization changes. */
:root { --ap24-safe-bottom:env(safe-area-inset-bottom,0px); }
html { -webkit-text-size-adjust:100%; text-size-adjust:100%; scroll-padding-top:80px; }
body { -webkit-tap-highlight-color:transparent; }
img,svg,video,iframe { max-width:100%; }
img,video { height:auto; }
:where(button,a,input,select,textarea):focus-visible { outline:3px solid #1d8a70; outline-offset:2px; }
:where(.app-shell,.p8-public,.p4-portal,.p12,.ap11) { min-width:0; }
.app-shell .main-area,.app-shell .content,.app-shell .panel,.app-shell .form-card,.app-shell .page-intro,.app-shell .section-action { min-width:0; }
.app-shell :is(.table-scroll,.data-table-scroll,.ap24-table-scroll) { max-width:100%; width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
.app-shell .ap24-table-scroll:focus-visible{outline:2px solid #008b65;outline-offset:-2px}
.app-shell .ap24-table-scroll table { min-width:max-content; width:100%; }
.app-shell .ap24-table-scroll :is(th,td) { white-space:nowrap; }
.app-shell .content :is(.stats-grid,.panels-grid,.ap17-grid,.ap17-kpis,.ap18-grid,.ap19-grid,.ap20-grid,.ap21-grid,.ap22-grid) > * { min-width:0; }
.app-shell .content :is(.stat-value,.money-value,.ap17-kpis strong,.ap17-membership-detail strong) { overflow-wrap:anywhere; }
.app-shell :is(input,textarea,select,button) { max-width:100%; }
.app-shell .content :is(input,textarea,select) { min-width:0; }
.app-shell .sidebar { overscroll-behavior:contain; }
.ap24-mobile-dock { display:none; }
.ap24-skip { position:absolute;left:-9999px;top:0;z-index:100; padding:12px 16px;background:#fff;color:#052f4b; }
.ap24-skip:focus { left:8px;top:8px; }
/* Tablet & compact laptop */
@media(max-width:1100px){
 .app-shell .content{padding:24px 20px 34px;}
 .app-shell .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
 .app-shell .panels-grid{grid-template-columns:minmax(0,1fr);}
 .app-shell .welcome-banner{flex-wrap:wrap;}
 .app-shell .banner-numbers{flex-wrap:wrap;}
 .app-shell .ap17-grid,.app-shell .ap18-grid{grid-template-columns:minmax(0,1fr);}
 .app-shell .form-layout{grid-template-columns:minmax(0,1fr);}
}
@media(max-width:900px){
 .app-shell .sidebar{width:min(86vw,330px);max-width:330px;box-shadow:16px 0 45px #10294130;visibility:hidden;}
 .app-shell .sidebar.is-open{visibility:visible;}
 .app-shell .sidebar-scrim.is-open{position:fixed;inset:0;z-index:39;display:block;background:rgba(1,18,41,.65);}
 .app-shell .topbar{position:sticky;top:0;z-index:28;min-height:62px;height:auto;padding:10px 18px;}
 .app-shell .main-area{min-width:0;width:100%;}
 .app-shell .menu-toggle{display:grid;min-width:44px;min-height:44px;}
 .app-shell .content{padding:20px 18px calc(95px + var(--ap24-safe-bottom));}
 .app-shell .page-footer{padding-bottom:calc(84px + var(--ap24-safe-bottom));}
 .app-shell .side-nav .nav-item{min-height:44px;}
 .app-shell .brand{min-height:90px;padding-right:52px;}
 .ap24-nav-close{position:absolute;right:13px;top:20px;width:44px;height:44px;display:grid;place-items:center;border:1px solid #d9e5ee;border-radius:10px;background:#fff;font-size:22px;color:#123a5c;}
 .ap24-mobile-dock{position:fixed;left:0;right:0;bottom:0;z-index:30;display:grid;grid-template-columns:repeat(var(--ap24-dock-count,4),minmax(0,1fr));background:#fff;border-top:1px solid #dce6f0;box-shadow:0 -8px 30px #0b294b15;padding:5px max(8px,env(safe-area-inset-right,0px)) calc(7px + var(--ap24-safe-bottom)) max(8px,env(safe-area-inset-left,0px));}
 .ap24-mobile-dock a{display:flex;min-width:0;min-height:49px;align-items:center;justify-content:center;flex-direction:column;gap:3px;padding:6px 3px;text-align:center;border-radius:10px;color:#51687e;text-decoration:none;font-size:10px;font-weight:700;}
 .ap24-mobile-dock a svg{width:20px;height:20px;}
 .ap24-mobile-dock a[aria-current="page"]{color:#00734d;background:#ecfaf3;}
 .ap24-mobile-dock a span{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
}
/* Phones */
@media(max-width:680px){
 html,body { max-width:100%; }
 .app-shell .content{padding:18px 12px calc(96px + var(--ap24-safe-bottom));}
 .app-shell .topbar{padding:7px 11px;gap:8px;}
 .app-shell .breadcrumb{min-width:0;max-width:62vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;}
 .app-shell .breadcrumb > :last-child{overflow:hidden;text-overflow:ellipsis;}
 .app-shell .profile-compact,.app-shell .timezone-pill,.app-shell .profile-caret{display:none;}
 .app-shell .page-intro{flex-direction:column;gap:8px;align-items:flex-start;}
 .app-shell .page-intro h1{font-size:clamp(21px,6vw,27px);}
 .app-shell .page-intro .intro-meta{display:inline-flex;white-space:normal;}
 .app-shell .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;}
 .app-shell .stat-card{padding:12px;min-height:122px;}
 .app-shell .stat-value{font-size:clamp(17px,5vw,24px);}
 .app-shell .welcome-banner{padding:19px 15px;}
 .app-shell .panel-head{flex-wrap:wrap;gap:8px;}
 .app-shell :is(.quick-panel,.section-action,.ap17-hero,.ap18-hero,.ap19-hero,.ap20-hero,.ap21-hero,.ap22-hero){flex-wrap:wrap;}
 .app-shell :is(.form-layout,.field-grid,.ap17-form,.ap17-grid,.ap18-grid,.ap19-grid,.ap20-grid,.ap21-grid,.ap22-grid){grid-template-columns:minmax(0,1fr);}
 .app-shell .ap17-membership{grid-template-columns:minmax(0,1fr);padding:18px 15px;}
 .app-shell .ap17-kpis{grid-template-columns:repeat(2,minmax(0,1fr));}
 .app-shell .form-card-section,.app-shell .form-actions{padding:16px 12px;}
 .app-shell .section-action :is(a.btn,button.btn){min-height:44px;}
 .app-shell :is(.panel,.ap17-card,.ap18-card,.ap19-card,.ap20-card,.ap21-card,.ap22-card){max-width:100%;}
 .app-shell .page-footer{padding:12px 12px calc(84px + var(--ap24-safe-bottom));flex-wrap:wrap;}
 .app-shell .quick-values{flex-wrap:wrap;gap:16px;}
 .app-shell .ap24-table-scroll{border:1px solid #edf2f7;border-radius:9px;}
 .app-shell .content :is(input,select,textarea){font-size:16px;} /* iOS: avoid focus zoom */
 .app-shell .content :is(button,.btn,[type="submit"]){min-height:44px;}
 .p8-public :is(.wrap,.hero-layout,.contact-grid,.how-grid,.about-grid,.pricing-grid,.ap14-cards){max-width:100%;min-width:0;}
 .p8-public :is(input,textarea,select){font-size:16px;min-width:0;}
 .p8-public :is(button,.btn,.submit){min-height:44px;}
 .p8-public .hero h1{overflow-wrap:break-word;}
 .p8-public .site-footer .foot-links{flex-wrap:wrap;}
 .p4-portal :is(input,textarea,select){font-size:16px;}
}
@media(max-width:380px){
 .app-shell .content{padding-left:10px;padding-right:10px;}
 .app-shell .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
 .app-shell .stat-card{padding:10px;}
 .app-shell .stat-value{font-size:19px;}
 .app-shell .nav-search{margin-left:12px;margin-right:12px;}
 .ap24-mobile-dock a{font-size:9px;padding-inline:0;}
}
@media(orientation:landscape) and (max-height:500px) and (max-width:900px){
 .ap24-mobile-dock{padding-bottom:0;}
 .app-shell .content{padding-bottom:95px;}
 .app-shell .sidebar .brand{min-height:58px;}
}
@media(prefers-reduced-motion:reduce){.app-shell .sidebar{transition:none!important;}}
@media print{.app-shell .sidebar,.app-shell .sidebar-scrim,.app-shell .topbar,.ap24-mobile-dock,.ap24-nav-close{display:none!important}.app-shell .main-area{margin-left:0!important}.app-shell .content{padding:0!important}.app-shell .page-footer{padding:10px 0!important}}
