/* Campus9X AB8.4–AB8.8: cohesive responsive, accessible visual finishing layer.
   The selectors intentionally stay inside existing public and Admin shells. */
:root { --cx-touch-target:44px; --cx-focus-ring:#1c7dff; }
:is(.site-shell,.admin-shell,.admin-login-shell) :is(button,a,input,textarea,select):focus-visible {
  outline:3px solid var(--cx-focus-ring); outline-offset:3px;
}
:is(.site-shell,.admin-shell,.admin-login-shell) :is(h1,h2,h3) { text-wrap:balance; }
:is(.site-shell,.admin-shell) :is(.panel,.cms-edit-panel,.cms-list-panel,.cx-info-shell,.cx-help-shell) { min-width:0; }
:is(.site-shell,.admin-shell) :is(input,textarea,select) { max-width:100%; }
.site-shell :is(.cx-public-main,.cx-public-footer,.cx-public-nav) { min-width:0; }
.site-shell :is(.cx-public-main,.cx-public-footer) :is(img,svg,video,iframe) {max-width:100%;}
.site-shell :is(.cx-public-main,.cx-public-footer) :is(h1,h2,h3,p,li) {overflow-wrap:break-word;}
.site-shell :is(.cx-public-main,.cx-public-footer) :is(pre,code){white-space:pre-wrap;overflow-wrap:anywhere;}
.site-shell :is(.cx-public-main,.cx-public-footer) table {max-width:100%;}
.site-shell :is(.cx-public-main,.cx-public-footer) .cx-public-cta {min-height:var(--cx-touch-target);}
.site-shell .cx-public-footer-logo {width:min(195px,100%);height:auto;object-fit:contain;}
.admin-shell .admin-main, .admin-shell .admin-content, .admin-shell .dashboard-grid, .admin-shell .stats-grid {min-width:0;}
.admin-shell :is(.stats-grid,.dashboard-grid,.system-snapshot-grid,.cms-metrics) > * {min-width:0;}
.admin-shell :is(.page-head,.panel-head,.topbar-actions,.head-actions,.form-actions) {min-width:0;}
.admin-shell :is(.page-head,.panel-head,.form-actions){gap:12px;}
.admin-shell :is(.page-head h1,.panel-head h2,.topbar-context,.cell-main,.compact-user-row) {overflow-wrap:anywhere;}
.admin-shell :is(.table-wrap,.data-table-wrap,.table-responsive,.cms-table-scroll) {
  max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.admin-shell :is(.table-wrap,.data-table-wrap,.table-responsive,.cms-table-scroll):focus-visible{
  outline:3px solid var(--cx-focus-ring);outline-offset:-3px;
}
.admin-shell :is(.btn,.cms-admin-btn,.head-actions button,.head-actions a,.cms-history-action){min-height:42px;}
.admin-shell :is(.btn,.cms-admin-btn){white-space:normal;text-align:center;}
.admin-shell .cms-form-grid>*{min-width:0;}
.admin-shell .cms-editor-progress{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:6px 0 16px;color:#425376;font-size:.82rem;font-weight:700;}
.admin-shell .cms-editor-progress>span{display:inline-flex;align-items:center;min-height:32px;border:1px solid #dce5f3;padding:5px 10px;border-radius:999px;background:#f5f8fd;}
.admin-shell .cms-block-actions button{min-height:36px;}
.admin-shell .cms-publish{background:#155bd7!important;border-color:#155bd7!important;color:#fff!important;}
.admin-shell .cms-admin-heading :is(h1,p){overflow-wrap:anywhere;}
@media(max-width:1024px){
  .admin-shell .admin-quick-actions{flex-wrap:wrap;align-items:stretch;}
  .admin-shell .admin-quick-actions .btn{flex:1 1 150px;}
  .admin-shell .cms-editor-layout{grid-template-columns:minmax(0,1fr);}
}
@media(max-width:700px){
  :is(.admin-shell,.site-shell) :is(.page-head,.cms-admin-heading){align-items:stretch;}
  .admin-shell .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .admin-shell .dashboard-grid{grid-template-columns:minmax(0,1fr);}
  .admin-shell .cms-editor-side{grid-template-columns:minmax(0,1fr);}
  .admin-shell .cms-metrics{grid-template-columns:repeat(2,minmax(0,1fr));}
  .admin-shell .cms-list-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;gap:12px;}
  .admin-shell .cms-list-filter>*{min-width:0;max-width:none;width:100%;}
  .admin-shell .cms-list-filter label:nth-of-type(3){grid-column:1/-1;}
  .admin-shell .cms-list-filter :is(input,select){width:100%;min-width:0;}
  .admin-shell .cms-admin-heading .cms-admin-btn{align-self:flex-start;}
  .admin-shell .admin-topbar .topbar-context{min-width:0;}
  .admin-shell :is(.panel-head,.form-actions,.cms-panel-head){flex-wrap:wrap;}
  .site-shell .cx-public-footer-links{max-width:100%;}
}
@media(max-width:440px){
 .admin-shell .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
 .admin-shell .stats-grid .stat-card{padding:14px;}
 .admin-shell :is(.stat-value,.stat-label,.stat-link){overflow-wrap:anywhere;}
 .admin-shell .cms-metrics{gap:9px;}
 .admin-shell .cms-metrics>div{padding:13px;}
 .admin-shell .cms-block{padding:12px;}
 .admin-shell .cms-block-actions{justify-content:flex-start;}
 .admin-shell .cms-editor-progress{font-size:.75rem;}
 .admin-login-shell .auth-page{padding-inline:14px;}
 .site-shell .cx-public-footer-inner{min-width:0;}
}
@media(prefers-reduced-motion:reduce){
  :is(.site-shell,.admin-shell,.admin-login-shell) *,
  :is(.site-shell,.admin-shell,.admin-login-shell) *::before,
  :is(.site-shell,.admin-shell,.admin-login-shell) *::after{
    scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;
  }
}
@media print{
  .admin-shell .admin-sidebar,.admin-shell .admin-topbar,.admin-shell .sidebar-overlay,
  .site-shell .cx-public-nav,.site-shell .cx-public-footer{display:none!important;}
  .admin-shell .admin-main{margin-left:0!important;}
}
