:root{--aemo-brand:#177a4c;--aemo-radius:14px;--aemo-shadow:0 8px 28px rgba(0,0,0,.08)}
*,*:before,*:after{box-sizing:border-box}
html{max-width:100%;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{max-width:100%;overflow-x:hidden}
img,video,iframe,svg{max-width:100%}img,video{height:auto}
input,select,textarea,button{max-width:100%;font:inherit}
button,input[type=submit],.button,a.button{touch-action:manipulation}
@media(max-width:767px){
 body{font-size:16px;line-height:1.55;padding-bottom:env(safe-area-inset-bottom)}
 h1{font-size:clamp(1.65rem,7vw,2.15rem);line-height:1.18}h2{font-size:clamp(1.35rem,5.5vw,1.75rem);line-height:1.25}h3{font-size:1.2rem;line-height:1.3}
 p{overflow-wrap:anywhere}
 .site,.site-content,.content-area,.entry-content,.wp-site-blocks,.site-main{min-width:0;max-width:100%}
 .wp-block-columns{display:flex;flex-direction:column;gap:1.25rem}
 .wp-block-column{min-width:0;width:100%!important}
 .wp-block-group,.wp-block-cover,.wp-block-media-text{max-width:100%}
 .wp-block-media-text{display:flex;flex-direction:column}
 .wp-block-media-text__media,.wp-block-media-text__content{width:100%;min-width:0}
 .wp-block-table,.woocommerce table.shop_table,.dataTables_wrapper{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
 table{max-width:100%}pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
 input:not([type=checkbox]):not([type=radio]):not([type=submit]),select,textarea{min-height:46px;width:100%;font-size:16px}
 textarea{min-height:110px}
 button,.button,input[type=submit],.wp-element-button{min-height:44px}
 .woocommerce .col2-set,.woocommerce-page .col2-set{display:block}
 .woocommerce .col2-set .col-1,.woocommerce .col2-set .col-2{float:none;width:100%;max-width:100%}
 .aemo-bottom-nav{position:fixed;z-index:99998;left:0;right:0;bottom:0;padding:7px 8px calc(7px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);border-top:1px solid rgba(0,0,0,.1);box-shadow:0 -5px 20px rgba(0,0,0,.07);backdrop-filter:blur(12px)}
 .aemo-bottom-nav__inner{display:flex;justify-content:space-around;align-items:center;max-width:620px;margin:0 auto;gap:2px}
 .aemo-nav-item{display:flex;flex:1;min-width:0;min-height:48px;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:3px 1px;color:#555;text-decoration:none!important;font-size:10px;font-weight:600;line-height:1.2;border-radius:10px}
 .aemo-nav-item .aemo-nav-icon{font-size:21px;line-height:1.1;color:var(--aemo-brand)}.aemo-nav-item.is-active{color:var(--aemo-brand);background:rgba(23,122,76,.08)}
 .aemo-nav-spacer{height:72px;height:calc(66px + env(safe-area-inset-bottom))}
 .aemo-drawer-trigger{position:fixed;z-index:99996;top:calc(12px + env(safe-area-inset-top));right:12px;display:flex;align-items:center;justify-content:center;width:46px;height:46px;border:1px solid rgba(0,0,0,.12);border-radius:14px;background:#fff;color:var(--aemo-brand);box-shadow:0 4px 18px rgba(0,0,0,.12);font-size:22px;cursor:pointer}
 .aemo-drawer-backdrop{position:fixed;inset:0;z-index:99998;background:rgba(0,0,0,.42)}
 .aemo-mobile-drawer{position:fixed;z-index:99999;inset:0 0 0 auto;width:min(88vw,360px);height:100dvh;max-width:360px;padding:calc(16px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));background:#fff;box-shadow:-12px 0 36px rgba(0,0,0,.18);transform:translateX(105%);visibility:hidden;transition:transform .22s ease,visibility .22s;overflow-y:auto}
 .aemo-mobile-drawer.is-open{transform:translateX(0);visibility:visible}
 .aemo-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:4px 0 18px;border-bottom:1px solid #e8ece9;color:var(--aemo-brand);font-size:18px}
 .aemo-drawer-close{width:42px;height:42px;border:0;border-radius:12px;background:#f1f5f2;color:#174b34;font-size:28px;line-height:1;cursor:pointer}
 .aemo-mobile-drawer ul{list-style:none;margin:14px 0;padding:0}.aemo-mobile-drawer li{margin:4px 0}
 .aemo-mobile-drawer li a{display:flex;align-items:center;gap:14px;min-height:52px;padding:10px 12px;border-radius:12px;color:#202923;text-decoration:none;font-weight:600}
 .aemo-mobile-drawer li a:active,.aemo-mobile-drawer li a:focus{background:rgba(23,122,76,.09);color:var(--aemo-brand)}
 .aemo-dashboard-menu-toggle{display:none}
 .aemo-dashboard-sidebar.is-aemo-collapsed{display:none!important}
 body.aemo-drawer-open{overflow:hidden}

}
@media(min-width:768px){.aemo-bottom-nav,.aemo-nav-spacer{display:none!important}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}

@media(min-width:768px){.aemo-drawer-trigger,.aemo-drawer-backdrop,.aemo-mobile-drawer{display:none!important}}
@media(max-width:767px){.aemo-dashboard-menu-toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:46px;margin:0 0 12px;padding:10px 14px;border:1px solid rgba(23,122,76,.2);border-radius:12px;background:#fff;color:var(--aemo-brand);font-weight:700}.aemo-dashboard-sidebar.aemo-mobile-sidebar-hidden{display:none!important}.aemo-dashboard-sidebar.aemo-mobile-sidebar-visible{display:block!important;position:relative!important;width:100%!important;max-width:100%!important;float:none!important}}

/* Phase 3: mobile form, calendar and commerce presentation adapters. */
@media(max-width:767px){
 body.aemo-form-adapter form:not(.search-form):not(.woocommerce-cart-form) input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=hidden]),
 body.aemo-form-adapter form:not(.search-form):not(.woocommerce-cart-form) select,
 body.aemo-form-adapter form:not(.search-form):not(.woocommerce-cart-form) textarea,
 body.aemo-form-adapter .wpforms-container input:not([type=checkbox]):not([type=radio]):not([type=submit]),
 body.aemo-form-adapter .wpforms-container select,
 body.aemo-form-adapter .wpforms-container textarea,
 body.aemo-form-adapter .wpcf7 input:not([type=checkbox]):not([type=radio]):not([type=submit]),
 body.aemo-form-adapter .wpcf7 select,
 body.aemo-form-adapter .wpcf7 textarea{width:100%!important;max-width:100%!important;min-height:48px;font-size:16px!important;border-radius:10px}
 body.aemo-form-adapter form label{line-height:1.4;max-width:100%;overflow-wrap:anywhere}
 body.aemo-form-adapter form button[type=submit],body.aemo-form-adapter form input[type=submit],body.aemo-form-adapter .wpforms-submit{width:100%;min-height:50px;border-radius:12px}
 body.aemo-form-adapter .wpforms-field,body.aemo-form-adapter .wpcf7-form-control-wrap{min-width:0;max-width:100%}
 body.aemo-form-adapter .wpforms-error,body.aemo-form-adapter .wpcf7-not-valid-tip{display:block;overflow-wrap:anywhere}
 body.aemo-calendar-adapter .fc,body.aemo-calendar-adapter .flatpickr-calendar,body.aemo-calendar-adapter .ui-datepicker,
 body.aemo-calendar-adapter .wpbc_container,body.aemo-calendar-adapter .booking-calendar,body.aemo-calendar-adapter .tribe-events-calendar{max-width:100%;min-width:0}
 body.aemo-calendar-adapter .fc .fc-toolbar{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between}
 body.aemo-calendar-adapter .fc .fc-toolbar-title{font-size:1.05rem}
 body.aemo-calendar-adapter .fc .fc-button{min-height:40px;padding:.35rem .55rem}
 body.aemo-calendar-adapter .flatpickr-calendar{width:100%;box-shadow:0 5px 22px rgba(0,0,0,.12)}
 body.aemo-calendar-adapter .flatpickr-days,body.aemo-calendar-adapter .dayContainer{width:100%;min-width:0;max-width:100%}
 body.aemo-calendar-adapter .flatpickr-day{max-width:none;flex-basis:14.2857%;height:40px;line-height:40px}
 body.aemo-calendar-adapter .ui-datepicker{width:100%!important}
 body.aemo-calendar-adapter .ui-datepicker table{font-size:14px}
 body.aemo-calendar-adapter .ui-datepicker td a,body.aemo-calendar-adapter .ui-datepicker td span{min-height:38px;display:flex;align-items:center;justify-content:center}
 body.aemo-calendar-adapter .fc-scroller,.aemo-calendar-adapter .calendar-scroll{overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 body.aemo-woocommerce-adapter .woocommerce form.checkout .form-row{float:none;width:100%;margin-right:0;margin-left:0}
 body.aemo-woocommerce-adapter .woocommerce form.checkout #order_review,body.aemo-woocommerce-adapter .woocommerce form.checkout #customer_details{width:100%;float:none}
 body.aemo-woocommerce-adapter .woocommerce-checkout-payment .payment_methods{padding:0}
 body.aemo-woocommerce-adapter .woocommerce-checkout-payment .payment_methods li{padding:12px;border-radius:10px}
 body.aemo-woocommerce-adapter .woocommerce #payment #place_order,body.aemo-woocommerce-adapter .woocommerce-page #payment #place_order{width:100%;min-height:52px;border-radius:12px}
 body.aemo-woocommerce-adapter .woocommerce .cart-collaterals,.aemo-woocommerce-adapter .woocommerce .cart_totals{width:100%;float:none}
 body.aemo-woocommerce-adapter .woocommerce table.shop_table{font-size:14px}
 body.aemo-woocommerce-adapter .woocommerce table.shop_table td,body.aemo-woocommerce-adapter .woocommerce table.shop_table th{padding:9px 7px}
 body.aemo-woocommerce-adapter .woocommerce .quantity .qty{min-height:42px;width:76px}
}


/* Phase 4: dashboard surfaces — scoped to explicitly identified portal roots. */
@media(max-width:767px){
 body.aemo-dashboard-adapter .aemo-dashboard-surface{min-width:0;max-width:100%;width:100%;padding-left:0;padding-right:0}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-header,.dashboard-topbar,.portal-header,.client-dashboard-header,.acwi-dashboard-header,.logistics-dashboard-header){display:flex;flex-wrap:wrap;align-items:center;gap:10px;max-width:100%}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-cards,.dashboard-stats,.stats-grid,.summary-cards,.kpi-grid,.portal-stats,.client-stats,.acwi-stats,.logistics-stats){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;width:100%;min-width:0}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.stat-card,.dashboard-card,.summary-card,.kpi-card,.portal-card,.client-card,.acwi-card,.logistics-card){min-width:0;max-width:100%;padding:13px;border-radius:14px;overflow-wrap:anywhere}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-main,.dashboard-content-area,.portal-main,.client-main,.acwi-main,.logistics-main){min-width:0;max-width:100%;width:100%}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-panel,.dashboard-widget,.portal-panel,.client-panel,.acwi-panel,.logistics-panel){min-width:0;max-width:100%;margin-bottom:14px;border-radius:14px}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(table,.dataTables_wrapper,.responsive-table){max-width:100%;display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-actions,.quick-actions,.portal-actions,.client-actions,.acwi-actions,.logistics-actions){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-actions a,.quick-actions a,.portal-actions a,.client-actions a,.acwi-actions a,.logistics-actions a){min-height:46px;display:flex;align-items:center;justify-content:center;text-align:center}
}
@media(min-width:768px) and (max-width:1100px){
 body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-cards,.dashboard-stats,.stats-grid,.summary-cards,.kpi-grid,.portal-stats,.client-stats,.acwi-stats,.logistics-stats){grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:380px){body.aemo-dashboard-adapter .aemo-dashboard-surface :is(.dashboard-cards,.dashboard-stats,.stats-grid,.summary-cards,.kpi-grid,.portal-stats,.client-stats,.acwi-stats,.logistics-stats){grid-template-columns:minmax(0,1fr)!important}}


/* Phase 5: conservative rendering safeguards; no layout or asset rewriting. */
@media(prefers-reduced-motion:reduce){
 html.aemo-enabled :is(*, *::before, *::after){scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
html.aemo-enabled,body.aemo-enabled{max-width:100%;overflow-x:clip}


/* Phase 7: administrator-only, browser-local compatibility diagnostics. */
.aemo-diagnostics-launch{position:fixed;z-index:100002;left:12px;bottom:calc(84px + env(safe-area-inset-bottom));min-height:44px;padding:10px 14px;border:0;border-radius:12px;background:#177a4c;color:#fff;font-weight:700;box-shadow:0 4px 18px rgba(0,0,0,.2);cursor:pointer}
.aemo-diagnostics-panel{position:fixed;z-index:100003;left:12px;bottom:calc(138px + env(safe-area-inset-bottom));width:min(420px,calc(100vw - 24px));max-height:min(72vh,620px);overflow:auto;padding:14px;border:1px solid #dce5df;border-radius:16px;background:#fff;color:#1d2922;box-shadow:0 12px 40px rgba(0,0,0,.24);font:14px/1.45 system-ui,sans-serif}
.aemo-diagnostics-panel[hidden]{display:none!important}.aemo-diagnostics-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:10px;border-bottom:1px solid #e7ece8}.aemo-diagnostics-head strong{font-size:16px}.aemo-diagnostics-head button{min-height:40px;padding:6px 12px;border:1px solid #d5ded8;border-radius:9px;background:#f7faf8;color:#1d2922}.aemo-diagnostics-summary{font-weight:700;color:#177a4c}.aemo-diagnostics-list{list-style:none;margin:10px 0;padding:0}.aemo-diagnostics-list li{display:flex;flex-direction:column;gap:2px;padding:9px 0;border-bottom:1px solid #edf0ee}.aemo-diagnostics-list li strong{font-size:13px}.aemo-diagnostics-list li span,.aemo-diagnostics-note{font-size:12px;color:#5d6961}.aemo-diagnostics-list .is-pass strong{color:#177a4c}.aemo-diagnostics-list .is-review strong{color:#a15b00}
