/* Responsive contract: shrink grid items; tables scroll in their own region. */
.admin-console-layout,.admin-workspace,.admin-workspace-panel,.admin-control-grid,.admin-control-card{min-width:0;max-width:100%}
.branding-nav-table-wrap{contain:paint;width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.branding-navigation-manager,.admin-workspace-panel[data-admin-panel="branding"]{min-width:0;max-width:100%;overflow-wrap:anywhere}
.admin-workspace-panel .admin-control-card-header{min-width:0;flex-wrap:wrap;gap:10px}
.admin-workspace-panel input,.admin-workspace-panel select,.admin-workspace-panel textarea{max-width:100%}
.admin-workspace-panel .admin-control-grid>*{min-width:0}
.application-preview-portal{position:fixed;inset:0;z-index:4500;background:#071e17b8;display:grid;place-items:center;padding:12px;overflow-y:auto}
.application-preview-portal[hidden]{display:none}
.application-preview-box{position:relative;max-width:700px;width:100%;max-height:95vh;overflow-y:auto;background:white;padding:clamp(16px,4vw,36px);border-radius:18px;color:#234134}
.application-preview-close{float:right;background:#eef4ef;border:1px solid #bfcfc3;border-radius:8px;padding:9px 13px;min-height:44px;cursor:pointer}
.application-preview-label{color:#417054;font-size:.82rem;text-transform:uppercase;letter-spacing:.06em;font-weight:750}
.application-preview-items{display:grid;gap:12px;margin:18px 0}.application-preview-footnote{font-size:.95rem;color:#51655a;margin-top:15px}
.application-upload-item input[type=file]{min-height:44px}
@media(max-width:800px){
 [data-admin-panel="prayer"] .admin-control-grid-two{grid-template-columns:minmax(0,1fr)}
 [data-admin-panel="prayer"] .admin-control-card{width:100%;min-width:0;max-width:100%}
 [data-admin-panel="prayer"] .admin-control-card-header{flex-wrap:wrap;min-width:0}
 [data-admin-panel="prayer"] .prayer-section-edit-body{min-width:0;max-width:100%;overflow-x:auto}
 [data-admin-panel="branding"] .branding-navigation-fit-row{grid-template-columns:minmax(0,1fr)}
 .branding-nav-table{min-width:700px}
 .admin-workspace-panel .admin-control-grid{max-width:100%}
}
@media(max-width:520px){
 .financial-aid-stage-label,.marriage-stage-label,.divorce-stage-label{font-size:.75rem;line-height:1.25}
 .financial-aid-stage strong,.marriage-stage strong,.divorce-stage strong{font-size:.85rem;line-height:1.35}
 .financial-aid-stage,.marriage-stage,.divorce-stage{min-height:75px;min-width:0}
 .admin-workspace-panel,.admin-workspace-panel .admin-control-card{min-width:0}
 .admin-workspace-panel p,.admin-workspace-panel label,.admin-workspace-panel button{font-size:max(.81rem,12px)}
 .admin-workspace-panel button,.admin-workspace-panel input:not([type=checkbox]):not([type=radio]),.admin-workspace-panel select{min-height:40px}
 .admin-sidebar-nav{max-width:100%;overflow-x:auto}

 /* Text sizing is checked against actual visible phone-sized layouts, not scale-by-vw alone. */
 .slider-text .slider-subtext{font-size:14px;line-height:1.38}
 .home-weekly-day-name{font-size:12px;line-height:1.35}
 #page-financial-aid .form-field small{font-size:12.5px;line-height:1.45}
 #page-financial-aid .financial-aid-form-eyebrow{font-size:12px}
 #page-financial-aid .financial-aid-privacy-note{font-size:12.5px;line-height:1.45}
 .admin-sidebar-tab>span{font-size:11px}
 [data-admin-panel="prayer"] .prayer-view-item>span,
 [data-admin-panel="prayer"] .prayer-view-table th{font-size:12px;line-height:1.4}
 [data-admin-panel="branding"] .branding-summary-grid span,
 [data-admin-panel="branding"] .branding-summary-grid small,
 [data-admin-panel="branding"] .branding-logo-preview-card span{font-size:12px;line-height:1.4;overflow-wrap:anywhere}
 [data-admin-panel="applications"] .applications-summary-card span,
 [data-admin-panel="applications"] .applications-summary-card small{font-size:12px;line-height:1.35;overflow-wrap:anywhere}
 .admin-live-chip{font-size:12px;line-height:1.35}

 /* Legacy rules include highly specific miniature typography; constrain only tested phone views. */
 .masjidal-prayer-panel .native-prayer-special-row small{line-height:1.3;white-space:normal}
 .masjidal-prayer-panel .native-prayer-footer-item strong{line-height:1.3;white-space:normal}
 [data-admin-panel="branding"] .modern-file-state-copy strong,[data-admin-panel="branding"] .modern-file-state-copy small,
 [data-admin-panel="branding"] .admin-field>small,[data-admin-panel="branding"] .branding-navigation-fit-row span,
 [data-admin-panel="branding"] .branding-navigation-fit-row strong,[data-admin-panel="branding"] .branding-nav-item-name strong,
 [data-admin-panel="branding"] .branding-nav-item-name small{line-height:1.4;white-space:normal}
 [data-admin-panel="branding"] .branding-nav-table th,[data-admin-panel="branding"] .branding-nav-table td{line-height:1.4}
 [data-admin-panel="applications"] .applications-type-tab b,[data-admin-panel="applications"] .applications-results-meta *,
 [data-admin-panel="applications"] .application-status-badge{line-height:1.4}
}


/* Primary controls remain visible without hidden horizontal scrolling. */
@media(max-width:1200px){
 .terms-service-manager-table-wrap{display:none}
 .terms-service-manager-mobile{display:grid;gap:8px;margin-top:10px}
 .impact-history-table,.records-inventory-table,.branding-nav-table{min-width:0}
}
@media(max-width:1100px){
 .impact-history-table-wrap,.records-inventory-table-wrap,.branding-nav-table-wrap{overflow:visible;margin-left:0;margin-right:0}
 .impact-history-table thead,.records-inventory-table thead,.branding-nav-table thead{display:none}
 .impact-history-table,.impact-history-table tbody,.records-inventory-table,.records-inventory-table tbody,.branding-nav-table,.branding-nav-table tbody{display:block;width:100%}
 .impact-history-table tr,.records-inventory-table tr,.branding-nav-table tr{display:grid;width:100%;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;padding:12px;margin:0 0 9px;border:1px solid #d3dcd6;background:#fff;box-sizing:border-box}
 .impact-history-table td,.records-inventory-table td,.branding-nav-table td{display:block;min-width:0;overflow-wrap:anywhere}
 .impact-history-table td:last-child,.records-inventory-table td:last-child,.branding-nav-table td:last-child{grid-column:1/-1}
 .impact-history-table td:last-child button,.records-inventory-table td:last-child button{width:100%;min-height:40px}
 .branding-nav-table input[type=text]{width:100%;min-width:0}
 .branding-nav-table .admin-switch{max-width:100%}
 .records-audit-toolbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .records-filter-reset{width:100%}
}
@media(max-width:620px){
 .communications-section-tabs,.applications-type-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
 .communications-section-tab,.applications-type-tab{width:100%;justify-content:center;white-space:normal}
 .connection-profile-form,.connection-profile-list,.admin-field{min-width:0;max-width:100%}
 .impact-history-table tr,.records-inventory-table tr,.branding-nav-table tr{grid-template-columns:minmax(0,1fr)}
 .impact-history-table td:last-child,.records-inventory-table td:last-child,.branding-nav-table td:last-child{grid-column:auto}
 .records-audit-toolbar{grid-template-columns:minmax(0,1fr)}
 .terms-service-mobile-actions,.terms-admin-top-actions,.branding-manager-actions{display:grid;grid-template-columns:minmax(0,1fr);width:100%}
 .terms-service-mobile-actions button,.terms-admin-top-actions button,.branding-manager-actions button{width:100%}
}
@media(max-width:340px){
 .application-appointment-grid .application-appointment-label{grid-column:1/-1}
 .application-appointment-grid .form-field{min-width:0;width:100%}
 .application-appointment-grid input{width:100%;max-width:100%;box-sizing:border-box}
}

/* Convert remaining action tables to visible cards on narrower layouts. */
@media(max-width:1100px){
 .terms-history-table-wrap,.records-audit-table-wrap{overflow:visible;border:0}
 .terms-history-table thead,.records-audit-table thead{display:none}
 .terms-history-table,.terms-history-table tbody,.records-audit-table,.records-audit-table tbody{display:block;width:100%;min-width:0}
 .terms-history-table tr,.records-audit-table tr{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px;margin:0 0 9px;border:1px solid #d3dcd6;background:#fff;box-sizing:border-box}
 .terms-history-table td,.records-audit-table td{display:block;min-width:0;overflow-wrap:anywhere}
 .terms-history-table td:last-child,.records-audit-table td:last-child{grid-column:1/-1}
 .terms-history-table td:last-child button,.records-audit-table td:last-child button{width:100%;min-height:40px}
}
@media(max-width:620px){
 .terms-history-table tr,.records-audit-table tr{grid-template-columns:minmax(0,1fr)}
 .terms-history-table td:last-child,.records-audit-table td:last-child{grid-column:auto}
 .connection-routing-table-wrap{overflow:visible;border:0}
 .connection-routing-table thead{display:none}
 .connection-routing-table,.connection-routing-table tbody{display:block;width:100%;min-width:0}
 .connection-routing-table tr{display:grid;width:100%;grid-template-columns:minmax(0,1fr);gap:7px;padding:11px;margin-bottom:9px;border:1px solid #d3dbd6;border-radius:5px;background:#fff;box-sizing:border-box}
 .connection-routing-table td{display:block}
 .connection-routing-table input{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
}
