/* Shared transparent brand and logical mobile header reading order. */
.site-header .brand,.footer .brand,.site-header .mfs-original-logo,.footer .mfs-original-logo{background:transparent!important;box-shadow:none!important;filter:none!important;}
.footer .brand{padding:0!important;border:0!important;border-radius:0!important;}
.site-header .header-inner>.brand{order:0;}
.site-header .header-inner>.header-actions{order:1;margin-inline-start:auto;}
.site-header .header-inner>.menu-toggle{order:2;margin-inline-start:0;}
.site-header .header-inner>.social-links-header{order:3;margin-inline-start:0;flex:none;}
.site-header .header-inner>.mainnav{order:4;}
@media(max-width:700px){
 .site-header .header-inner{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);width:calc(100% - 28px);gap:9px!important;align-items:center;}
 .site-header .header-inner>.brand{grid-column:1;grid-row:1;min-width:0;}
 .site-header .header-inner>.brand .mfs-original-logo{width:min(100%,175px)!important;height:auto!important;}
 .site-header .header-inner>.header-actions{grid-column:2;grid-row:1;display:flex!important;flex-wrap:wrap;justify-content:flex-end;gap:4px!important;margin:0!important;padding:0!important;min-width:0;}
 .site-header .header-inner>.header-actions label{display:block!important;flex:0 0 100%;text-align:start;}
 .site-header .header-inner>.header-actions #lang-select{flex:1 1 100%;width:100%;min-width:0;max-width:100%;}
 .site-header .header-inner>.menu-toggle{grid-column:1;grid-row:2;justify-self:start;margin:0!important;min-height:44px;max-width:100%;white-space:normal;font-size:.85rem;padding:8px 10px;}
 .site-header .header-inner>.social-links-header{grid-column:2;grid-row:2;justify-self:end;gap:6px;}
 .site-header .header-inner>.mainnav{grid-column:1/-1;grid-row:3;}
}
/* Equalize paired consultation controls, allowing translated labels to wrap. */
.button-row:has(>[data-i18n="book-saginaw"]):has(>[data-i18n="book-troy"]),.home-action-row:has(>[data-i18n="book-saginaw"]):has(>[data-i18n="book-troy"]),.invis-consult-actions,.story-ending-actions{align-items:stretch;}
.button-row:has(>[data-i18n="book-saginaw"]):has(>[data-i18n="book-troy"])>[data-i18n^="book-"],.home-action-row:has(>[data-i18n="book-saginaw"]):has(>[data-i18n="book-troy"])>[data-i18n^="book-"]{flex:1 1 230px;min-width:0;min-height:50px;box-sizing:border-box;display:inline-flex;justify-content:center;align-items:center;text-align:center;white-space:normal;max-width:100%;padding:13px 20px;}
.invis-consult-actions>a,.story-ending-actions>.story-final-link{width:100%;min-height:50px;box-sizing:border-box;text-align:center;}
@media(max-width:520px){.button-row:has(>[data-i18n="book-saginaw"]):has(>[data-i18n="book-troy"])>[data-i18n^="book-"],.home-action-row:has(>[data-i18n="book-saginaw"]):has(>[data-i18n="book-troy"])>[data-i18n^="book-"]{flex:0 0 auto;width:100%;min-height:52px;}}

/* Keep navigation and social icons together in the mobile header. */
.header-nav-social{display:contents;}
@media(max-width:700px){
 .site-header .header-inner>.header-nav-social{display:flex;grid-column:1/-1;grid-row:2;justify-content:flex-end;align-items:center;gap:6px;min-width:0;flex-wrap:wrap;}
 .site-header .header-nav-social>.menu-toggle{margin:0!important;min-height:44px;max-width:100%;white-space:normal;font-size:.85rem;padding:8px 10px;}
 .site-header .header-nav-social>.social-links-header{display:flex;flex:none;margin:0!important;gap:6px;}
}
@media(min-width:701px){.site-header .header-nav-social>.menu-toggle{order:2;margin-inline-start:0;}.site-header .header-nav-social>.social-links-header{order:3;margin-inline-start:0;flex:none;}}
/* Mobile: language at physical top right, brand and grouped navigation below. */
footer.footer a.brand.footer-brand,footer.footer a.brand.footer-brand img.mfs-original-logo {
 background:transparent!important;background-color:transparent!important;background-image:none!important;box-shadow:none!important;filter:none!important;border-radius:0!important;padding:0!important;
}
footer.footer a.brand.footer-brand{display:inline-flex!important;width:fit-content!important;max-width:100%!important;}
footer.footer a.brand.footer-brand img.mfs-original-logo{width:min(100%,245px)!important;height:auto!important;}
@media(max-width:700px){
 .site-header .header-inner{grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;padding-block:8px!important;}
 .site-header .header-inner>.header-actions{grid-column:1/-1;grid-row:1;justify-self:end;display:flex!important;flex-wrap:nowrap!important;justify-content:flex-end;align-items:center;gap:8px!important;width:min(100%,300px);}
 .site-header .header-inner>.header-actions label{flex:0 0 auto!important;text-align:end;white-space:nowrap;}
 .site-header .header-inner>.header-actions #lang-select{flex:1 1 auto!important;width:0!important;min-width:0;max-width:100%;min-height:44px;}
 .site-header .header-inner>.brand{grid-column:1;grid-row:2;min-width:0;max-width:100%;}
 .site-header .header-inner>.brand .mfs-original-logo{width:min(100%,175px)!important;min-width:0!important;}
 .site-header .header-inner>.header-nav-social{grid-column:2;grid-row:2;justify-self:end;flex-wrap:nowrap;gap:5px!important;}
 .site-header .header-nav-social>.menu-toggle{font-size:.76rem;padding:8px!important;white-space:normal;min-height:44px;max-width:112px;}
 .site-header .header-nav-social>.social-links-header{gap:4px!important;}
 .site-header .header-nav-social .social-link{width:44px!important;min-width:44px!important;height:44px!important;padding:0!important;justify-content:center;}
 .site-header .header-inner>.mainnav{grid-column:1/-1;grid-row:3;}
}
@media(max-width:355px){
 .site-header .header-inner>.brand{grid-column:1/-1;grid-row:2;}
 .site-header .header-inner>.header-nav-social{grid-column:1/-1;grid-row:3;}
 .site-header .header-inner>.mainnav{grid-row:4;}
}
