/* Shared reflow repairs. Keep typography preferences and table semantics. */
@media screen {
  html body #page #content :is(.mfsa-content-col,.mfsa-content-area,.mfsa-standard-wrapper,.mfsa-ajax-container,.mfsa-ui-content,.wp-block-accordion,.wp-block-accordion-item,.wp-block-accordion-panel,.csa-alerts-wrapper) {
    min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important;
  }
  html body #page #content .mfsa-ui-table-scroll {
    display: block; width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    contain: inline-size; box-sizing: border-box;
    overflow-x: auto !important; overflow-y: auto !important;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
    margin-block: .5em 1em; padding: 0;
  }
  html body #page #content .mfsa-ui-table-scroll > table {
    display: table !important; width: 100% !important; max-width: none !important;
    table-layout: auto !important; margin: 0 !important;
  }
  html body #page #content .mfsa-ui-table-scroll > table thead { display: table-header-group !important; position: static !important; clip-path: none !important; }
  html body #page #content .mfsa-ui-table-scroll > table tbody { display: table-row-group !important; }
  html body #page #content .mfsa-ui-table-scroll > table tfoot { display: table-footer-group !important; }
  html body #page #content .mfsa-ui-table-scroll > table tr { display: table-row !important; }
  html body #page #content .mfsa-ui-table-scroll > table :is(th,td) {
    display: table-cell !important;

    white-space: normal !important; overflow-wrap: break-word; word-break: normal !important;
    min-width: 7em;
  }
  html body #page #content .mfsa-ui-table-scroll > table td::before { display: none !important; }
  html body #page #content .mfsa-ui-table-scroll > .mfsa-doc-table :is(th,td) { min-width: 10em; }
  html body #page #content .mfsa-ui-scroll-hint {
    margin: .5em 0 !important; color: var(--mfsa-ui-text, #17212b); line-height: 1.4;
  }
  html body #page #content .mfsa-ui-scroll-hint[hidden] { display: none !important; }
  html body #page #content .mfsa-ui-table-scroll:focus-visible {
    outline: 4px solid #000 !important; outline-offset: 4px !important;
    box-shadow: 0 0 0 4px #fff !important;
  }
  html body.contrast #page #content .mfsa-ui-table-scroll:focus-visible {
    outline-color: #00ffff !important; box-shadow: 0 0 0 4px #000 !important;
    background: #000 !important; color: #fff !important; -webkit-text-fill-color: #fff !important;
  }
  html body #page #content .csa-alerts-wrapper,
  html body #page #content .csa-card {
    width: 100%; max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important;
  }
  html body #page #content .csa-card :is(h3,a,.csa-card-meta) { min-width: 0; overflow-wrap: anywhere; }
}
@media screen and (max-width: 921px) {
  html body #page #content .mfsa-switcher-template .wp-block-accordion-panel:not([hidden]) {
    padding: .5rem .75rem .75rem !important;
  }
  html body #page #content .mfsa-sidebar-col .mfsa-nested-group {
    display: flex; flex-direction: column; gap: .4rem;
  }
  html body #page #content .mfsa-sidebar-col .mfsa-nested-group > .mfsa-nested-group { margin-top: .2rem; }
  html body #page #content .mfsa-sidebar-col .mfsa-sidebar-item { margin: 0 !important; }
  html body #page #masthead #ast-mobile-header [data-section="section-hb-social-icons-1"],
  html body #page #masthead #ast-mobile-header .ast-header-social-wrap { display: none !important; }
  html body #page #masthead #ast-mobile-header .ast-mobile-header-content {
    border: 2px solid var(--mfsa-ui-teal, #00685e) !important;
    box-sizing: border-box; margin: 0 12px 12px; width: calc(100% - 24px);
    padding: 12px; background: var(--mfsa-ui-surface, #fff) !important;
    box-shadow: 0 5px 16px rgba(0,0,0,.15);
  }
  html body #page #masthead #ast-mobile-header .main-header-menu .menu-item { min-width: 0; position: relative; }
  html body #page #masthead #ast-mobile-header .main-header-menu .menu-item > a.menu-link {
    white-space: normal !important; overflow-wrap: anywhere; line-height: 1.4 !important;
    padding: .65em 12px !important; min-height: 48px; box-sizing: border-box;
  }
  html body #page #masthead #ast-mobile-header .main-header-menu .menu-item-has-children > a.menu-link {
    padding-right: 64px !important;
  }
  html body #page #masthead #ast-mobile-header .main-header-menu .ast-menu-toggle {
    width: 44px !important; min-width: 44px !important; max-width: 44px !important;
    height: 44px !important; min-height: 44px !important; padding: 8px !important;
    top: 4px !important; right: 4px !important; margin: 0 !important;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--mfsa-ui-teal, #00685e) !important; box-shadow: none !important;
  }
  html body #page #masthead #ast-mobile-header .ast-menu-toggle svg { width: 20px !important; height: 20px !important; }
}
@media screen and (max-width: 768px) {
  /* Forms already expose labels per cell: stack labels above values. */
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table):not(.mfsa-ui-native-scroll-table),
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table):not(.mfsa-ui-native-scroll-table) :is(tbody,tr,td) {
    display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important;
    box-sizing: border-box !important; height: auto !important; float: none !important;
  }
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table):not(.mfsa-ui-native-scroll-table) thead {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important;
    overflow: hidden !important; clip-path: inset(50%); display: block !important;
  }
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table):not(.mfsa-ui-native-scroll-table) td {
    text-align: left !important; white-space: normal !important; overflow-wrap: anywhere;
    padding: .6em !important;
  }
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table):not(.mfsa-ui-native-scroll-table) td::before {
    content: attr(data-label); display: block !important; position: static !important;
    width: auto !important; margin: 0 0 .35em !important; text-align: left !important;
    white-space: normal !important; color: var(--mfsa-ui-teal-dark, #004d44); font-weight: 700;
  }
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table):not(.mfsa-ui-native-scroll-table) td:not([data-label])::before { display: none !important; }
  html body #page #content :is(.mfsa-standard-table,.mfsa-ui-table) td :is(a,p,span) {
    max-width: 100%; white-space: normal !important; overflow-wrap: anywhere;
  }
  html body #page #content .mfsa-standard-wrapper .mfsa-card-grid { grid-template-columns: minmax(0,1fr) !important; }
  html body #page #content .mfsa-standard-wrapper .mfsa-list-item { grid-template-columns: minmax(0,1fr) !important; }
  html body #page #content .mfsa-standard-wrapper .mfsa-paragraph-list { padding-inline: 8px !important; }
  html body #page #content .csa-results-footer { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 16px !important; }
  html body #page #content .csa-pagination-controls {
    display: flex !important; flex-wrap: wrap !important; justify-content: center !important;
    width: 100% !important; min-width: 0 !important; gap: 12px !important;
  }
  html body #page #content .csa-pagination-controls > .csa-page-info {
    order: 0; flex: 0 0 100% !important; min-width: 0 !important; max-width: 100% !important;
    margin: 0 !important; white-space: normal !important; overflow-wrap: anywhere; text-align: center;
  }
  html body #page #content .csa-pagination-controls > .csa-page-btn {
    order: 1; flex: 1 1 7em !important; min-width: 0 !important; max-width: 100% !important;
    width: auto !important; height: auto !important; min-height: 44px !important;
    white-space: normal !important; overflow-wrap: anywhere; padding: .5em .65em !important;
  }
  html body #page #content .csa-per-page { flex-wrap: wrap !important; gap: 10px !important; }
  html body #page #content .csa-card { padding: 16px !important; }
}
/* Use the existing Industries menu whenever the full menu cannot fit. */
@media screen and (min-width: 922px) {
  html.mfsa-ui-compact-nav body #page #masthead #ast-desktop-header .ast-builder-menu-1 { display: none !important; }
  html.mfsa-ui-compact-nav body #page #masthead #ast-desktop-header .ast-builder-menu-2 { display: flex !important; }
  html body #page #masthead #ast-desktop-header .ast-builder-menu-1.mfsa-ui-measuring {
    display: flex !important; position: absolute !important; visibility: hidden !important;
    pointer-events: none !important; width: max-content !important; max-width: none !important;
  }
  html body #page #masthead #ast-desktop-header .mfsa-ui-measuring :is(.main-navigation,.main-header-menu,.main-header-bar-navigation,.ast-main-header-bar-alignment) {
    width: max-content !important; max-width: none !important; flex-wrap: nowrap !important;
  }
  html body #page #masthead #ast-desktop-header .mfsa-ui-measuring .main-header-menu > li { flex-shrink: 0 !important; }
  html body #page #masthead #ast-desktop-header .mfsa-ui-measuring .main-header-menu > li > a { white-space: nowrap !important; }
}
@media screen and (forced-colors: active) {
  html body #page #content .mfsa-ui-table-scroll:focus-visible { outline-color: Highlight !important; box-shadow: none !important; }
}

/* 1.4.12: a horizontal flex basis must not become a tall mobile heading. */
@media screen and (max-width: 700px) {
  html body #page #content .mfsa-search-forms .msc-search-header {
    flex-direction: column !important; align-items: flex-start !important;
    justify-content: flex-start !important; gap: 12px !important;
    height: auto !important; min-height: 0 !important; padding: 16px !important;
  }
  html body #page #content .mfsa-search-forms .msc-search-header h2 {
    flex: 0 0 auto !important; width: 100% !important; min-height: 0 !important;
    height: auto !important; margin: 0 !important; line-height: 1.4 !important;
  }
  html body #page #content .mfsa-search-forms .msc-browse-all {
    flex: 0 0 auto !important; align-self: flex-start !important; margin: 0 !important;
    min-height: 44px; display: inline-flex; align-items: center;
  }
  html body #page #content .mfsa-search-forms :is(.msc-search-body,.msc-search-fields,.msc-field-group,.msc-date-row,.msc-date-row > div) {
    min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important;
  }
  html body #page #content .mfsa-search-forms .msc-search-body { padding: 14px !important; }
  html body #page #content .mfsa-search-forms :is(input:not([type="hidden"]),select) {
    min-width: 0 !important; width: 100% !important; max-width: 100% !important;
    box-sizing: border-box !important; min-height: 44px; height: auto !important;
  }
  html body #page #content .mfsa-search-forms :is(label,legend,.msc-browse-section h3) {
    white-space: normal !important; overflow-wrap: anywhere; max-width: 100%;
  }
  html body #page #content .mfsa-search-forms .msc-button-row {
    display: flex !important; flex-wrap: wrap !important; gap: 12px !important;
  }
  html body #page #content .mfsa-search-forms .msc-button-row .msc-btn {
    flex: 1 1 100% !important; min-width: 0 !important; margin: 0 !important;
  }
}

/* 1.4.13: compact inner-page banners on phones; homepage hero stays independent. */
@media screen and (max-width: 768px) {
  html body:not(.home) #page .mfsa-general-banner .mfsa-banner-visual {
    display: none !important;
  }
  html body:not(.home) #page .mfsa-general-banner,
  html body:not(.home) #page .mfsa-general-banner .mfsa-banner-inner {
    min-height: 0 !important; height: auto !important;
  }
  html body:not(.home) #page .mfsa-general-banner .mfsa-banner-content {
    flex: 0 0 auto !important; width: 100% !important; max-width: 100% !important;
    min-width: 0 !important; box-sizing: border-box !important; padding-block: 28px !important;
  }
}

/* 1.4.14: footer readability and reflow in both languages. */
@media screen {
  html body #page footer.mfsa-footer :is(.mfsa-brand-text,.mfsa-link-list a,.mfsa-copyright,.mfsa-legal-nav a,.mfsa-land-ack,.mfsa-land-ack a) {
    font-size: 16pt !important; line-height: 1.5 !important;
    white-space: normal !important; overflow-wrap: anywhere;
  }
  html body #page footer.mfsa-footer .mfsa-orange-header {
    font-size: 18pt !important; line-height: 1.35 !important; overflow-wrap: anywhere;
  }
  html body #page footer.mfsa-footer :is(.mfsa-footer-inner,.mfsa-footer-grid,.mfsa-footer-grid > div,.mfsa-mobile-links-wrapper,.grid-ind-links,.grid-gen-links,.mfsa-link-list,.mfsa-legal-nav,.mfsa-brand-text) {
    min-width: 0 !important; max-width: 100% !important; box-sizing: border-box;
  }
  html body #page footer.mfsa-footer .mfsa-footer-bottom {
    flex-wrap: wrap !important; gap: 20px !important;
  }
  html body #page footer.mfsa-footer .mfsa-legal-nav {
    flex-wrap: wrap !important; gap: 12px 20px !important;
  }
  html body #page footer.mfsa-footer .mfsa-legal-nav a {
    display: inline-flex; align-items: center; min-height: 44px; padding-block: 4px;
  }
  html body #page footer.mfsa-footer .mfsa-link-list a {
    min-width: 0; max-width: 100%; min-height: 44px; padding-block: 6px;
  }
  html body #page footer.mfsa-footer .has-chevron a::before {
    flex: 0 0 auto; font-size: 1em; line-height: 1.5;
  }
}
@media screen and (min-width: 851px) {
  html body #page footer.mfsa-footer .mfsa-footer-grid {
    grid-template-columns: minmax(0,1.2fr) minmax(0,1fr) minmax(100px,.5fr) !important;
    column-gap: clamp(20px,3vw,50px) !important;
  }
}
@media screen and (max-width: 850px) {
  html body #page footer.mfsa-footer .mfsa-mobile-links-wrapper {
    width: fit-content !important; max-width: 100% !important;
  }
  html body #page footer.mfsa-footer .mfsa-legal-nav {
    width: 100%; justify-content: center;
  }
}

/* 1.4.15: align desktop footer content with the header's actual content edges. */
@media screen and (min-width: 851px) {
  html body #page footer.mfsa-footer .mfsa-footer-inner {
    width: auto !important; max-width: none !important;
    margin-left: var(--mfsa-footer-align-left, clamp(24px,5vw,100px)) !important;
    margin-right: var(--mfsa-footer-align-right, clamp(24px,5vw,100px)) !important;
    padding-inline: 0 !important; box-sizing: border-box !important;
  }
}

/* 1.4.16: dynamic table views retain a contained horizontal scrolling area. */
@media screen {
  html body #page #content .csa-results-grid.csa-view-table {
    display: block !important; min-width: 0 !important; max-width: 100% !important; width: 100% !important;
  }
  html body #page #content .mfsa-ui-table-scroll > .csa-table { min-width: 36em !important; }
  html body #page #masthead .menu-item-has-children.mfsa-ui-submenu-closed > .sub-menu {
    display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important;
  }
}
@media screen and (max-width: 768px) {
  html body #page #content .mfsa-mc-wrapper .mfsa-layout-btns,
  html body #page #content #mfsa-app .mfsa-layout-btns { display: none !important; }
}

/* 1.4.17: group Media Center pagination and use readable control labels. */
@media screen {
  html body #page #content #mfsa-app .mfsa-pagination-bar {
    box-sizing: border-box !important; width: 100% !important; max-width: 100% !important;
    border: 1px solid var(--mfsa-ui-border, #737b84) !important; border-radius: 8px;
    padding: 16px !important; margin-top: 24px !important;
    background: var(--mfsa-ui-surface-subtle, #f7f8f8) !important;
    gap: 16px !important; min-width: 0 !important;
  }
  html body #page #content #mfsa-app .mfsa-per-page-wrap label {
    font-size: 16pt !important; line-height: 1.5 !important;
    color: var(--mfsa-ui-text, #1f2937) !important;
  }
  html body #page #content #mfsa-app :is(.mfsa-pagination-left,.mfsa-page-info) {
    white-space: normal !important; overflow-wrap: anywhere; line-height: 1.5 !important;
  }
}
@media screen and (max-width: 768px) {
  html body #page #content #mfsa-app .mfsa-pagination-bar {
    display: flex !important; flex-direction: column !important; align-items: stretch !important;
    padding: 14px !important;
  }
  html body #page #content #mfsa-app .mfsa-pagination-left {
    display: flex; justify-content: center; align-items: baseline; gap: .35em;
    text-align: center; min-width: 0;
  }
  html body #page #content #mfsa-app .mfsa-pagination-right {
    display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    width: 100% !important; gap: 14px 10px !important; min-width: 0 !important;
  }
  html body #page #content #mfsa-app .mfsa-per-page-wrap {
    grid-column: 1 / -1 !important; grid-row: 1 !important; display: flex !important;
    justify-content: center !important; align-items: center !important; flex-wrap: wrap !important; gap: 10px !important;
  }
  html body #page #content #mfsa-app .mfsa-page-info {
    grid-column: 1 / -1 !important; grid-row: 2 !important; margin: 0 !important; text-align: center;
  }
  html body #page #content #mfsa-app .mfsa-btn-nav {
    grid-row: 3 !important; width: 100% !important; min-width: 0 !important;
    min-height: 48px !important; height: auto !important; margin: 0 !important;
    padding: .55em .4em !important; white-space: normal !important; overflow-wrap: anywhere;
  }
}

/* Match the homepage CSA CTA to the shared 16pt button baseline. Inline
   font-size from the accessibility toolbar can still enlarge/reset this. */
html body #page a.mfsa-csa-btn {
    font-size: 16pt !important;
    line-height: 1.4 !important;
    min-height: 44px;
    height: auto !important;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

/* Align CSA More with the News and Reports action above it. */
html body #page .mfsa-csa-actions {
    display: flex !important;
    justify-content: flex-end !important;
    flex-wrap: wrap;
    text-align: right !important;
}
html body #page .mfsa-csa-actions > a.mfsa-csa-btn {
    float: none !important;
    margin-inline: 0 !important;
    text-align: center !important;
}

/* 1.4.20: Astra places the header at z-index 999999. Keep the keyboard
   skip link above it, outside normal flow, and visible at enlarged text sizes. */
html body a.skip-link:focus {
    position: fixed !important;
    z-index: 2147483647 !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    bottom: auto !important;
    display: block !important;
    clip: auto !important;
    clip-path: none !important;
    width: auto !important;
    height: auto !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
    overflow: auto !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 12px 18px !important;
    font-size: 16pt !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    background: #004d44 !important;
    border: 2px solid #fff !important;
    outline: 3px solid #000 !important;
    outline-offset: 2px !important;
    text-decoration: underline !important;
    opacity: 1 !important;
    visibility: visible !important;
}
html body.contrast a.skip-link:focus {
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    background: #ff0 !important;
    border-color: #000 !important;
    outline-color: #fff !important;
}

/* Two-column editorial tables retain a readable label column. */
@media screen {
 html body #page #content .mfsa-ui-table-scroll > table[data-mfsa-columns="2"] { table-layout:fixed !important; min-width:34em !important; }
 html body #page #content .mfsa-ui-table-scroll > table[data-mfsa-columns="2"] tr > :first-child:not([colspan="2"]) { width:30% !important; }
 html body #page #content .mfsa-ui-table-scroll > table[data-mfsa-columns="2"] tr > :last-child:not([colspan="2"]) { width:70% !important; }
}

/* Intrinsic fee widths expand with enlarged amounts; the wrapper can scroll. */
@media screen {
 html body #page #content .mfsa-ui-table-scroll > table[data-mfsa-table-kind="fees"] {table-layout:auto !important;}
 html body #page #content .mfsa-ui-table-scroll > table[data-mfsa-table-kind="fees"] tr > :first-child:not([colspan="2"]) {width:auto !important;}
 html body #page #content .mfsa-ui-table-scroll > table[data-mfsa-table-kind="fees"] tr > :last-child:not([colspan="2"]) {width:1% !important;white-space:nowrap !important;overflow-wrap:normal !important;word-break:normal !important;}
}
