/* ==========================================================
   RESPONSIVE.CSS — адаптивність КП "Криворізька міська лікарня №1"
   Підключено після основних стилів, тому цей файл має пріоритет.
   ========================================================== */

:root {
    --header-bg: rgba(255,255,255,.98);
    --header-shadow: 0 6px 24px rgba(0,0,0,.08);
}

/* Базова безпека для адаптиву */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    padding-top: 0 !important;
    min-width: 0;
    min-height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, iframe {
    max-width: 100%;
}

img {
    height: auto;
}

table {
    width: 100%;
}

.container {
    max-width: 1180px;
}

/* Шапка */
.main-header {
    position: sticky !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: var(--header-bg) !important;
    box-shadow: var(--header-shadow);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.top-line {
    min-height: 66px;
    height: auto !important;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.menu-line {
    min-height: 66px;
    height: auto !important;
    background: #fff !important;
}

.hospital-name {
    display: block;
    color: var(--accent) !important;
    line-height: 1.15;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--accent);
}

.header-logo-wrap {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: #fff;
    box-shadow: 0 8px 22px rgba(17, 44, 65, .10);
    border: 1px solid rgba(0, 163, 168, .12);
}

.header-logo {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
    object-fit: contain;
    display: block;
    border-radius: 999px;
}

.phone-top {
    color: var(--accent) !important;
    border: 1px solid rgba(0,163,168,.28) !important;
    border-radius: 999px !important;
    background: rgba(0,163,168,.06) !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.phone-top:hover,
.phone-top:focus {
    color: #fff !important;
    background: var(--accent) !important;
}

.phone-dropdown-menu {
    width: min(380px, calc(100vw - 24px)) !important;
    max-height: min(70vh, 620px);
    overflow-y: auto;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 16px 44px rgba(0,0,0,.18);
}

.phone-division-link {
    color: #006df0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: background-color .2s ease, color .2s ease;
}

.phone-division-link:hover,
.phone-division-link:focus {
    color: var(--accent);
}

.phone-division-link strong {
    color: inherit;
}

.phone-division-number {
    display: block;
    margin-top: 2px;
    color: #2b2f33;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

.phone-subdivision-list {
    display: grid;
    gap: 8px;
    list-style: none;
    padding: 8px 0 0;
    margin: 8px 0 0;
}

.phone-subdivision-item {
    padding: 8px 10px;
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    background: rgba(0, 163, 168, .06);
}

.phone-subdivision-item .phone-division-link {
    display: inline-block;
    line-height: 1.25;
}

.social-link {
    color: var(--accent);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: rgba(0,163,168,.08);
}

.social-link:hover {
    color: #fff;
    background: var(--accent);
}

.site-search-widget {
    position: relative;
    z-index: 1040;
}

.site-search-toggle {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-size: 1.05rem;
    box-shadow: 0 10px 24px rgba(0, 163, 168, .20);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.site-search-toggle:hover,
.site-search-toggle:focus {
    background: #008f8f;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 143, 143, .26);
}

.site-search-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(430px, calc(100vw - 24px));
    padding: 18px;
    background: #fff;
    border: 1px solid rgba(0, 163, 168, .16);
    border-radius: 18px;
    box-shadow: 0 22px 58px rgba(17, 44, 65, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.site-search-widget.is-open .site-search-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.site-search-label {
    display: block;
    color: #123047;
    font-weight: 800;
    margin-bottom: 10px;
}

.site-search-row {
    display: flex;
    gap: 10px;
}

.site-search-input {
    min-width: 0;
    flex: 1 1 auto;
    height: 46px;
    border: 1px solid rgba(0, 163, 168, .22);
    border-radius: 999px;
    padding: 0 16px;
    outline: none;
    color: #172033;
    background: #f6fbfc;
    font-weight: 700;
}

.site-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 163, 168, .12);
    background: #fff;
}

.site-search-submit {
    height: 46px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
}

.site-search-submit:hover,
.site-search-submit:focus {
    background: #008f8f;
    color: #fff;
}

/* Навігація */
.navbar {
    min-height: 66px;
}

.navbar-toggler {
    border: 1px solid rgba(0,0,0,.18);
    border-radius: 12px;
    padding: .45rem .65rem;
}

.main-nav-list {
    gap: 16px;
}

.nav-link {
    border-radius: 12px;
    line-height: 1.25;
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

.dropdown-menu {
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 16px 44px rgba(0,0,0,.16) !important;
}

.dropdown-item {
    white-space: normal;
    line-height: 1.25;
}

/* Головний екран */
.hero {
    min-height: clamp(560px, 72vh, 820px) !important;
    height: auto !important;
    margin-top: 0 !important;
    padding: clamp(70px, 9vw, 120px) 0 !important;
    background-position: center center !important;
}

.hero h1 {
    font-size: clamp(2.1rem, 5vw, 4.8rem);
    line-height: 1.05;
    font-weight: 800;
    text-wrap: balance;
}

.hero .lead {
    font-size: clamp(1.08rem, 2.2vw, 1.9rem) !important;
    line-height: 1.35;
}

.hero .btn {
    min-height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    line-height: 1.2;
}

/* Секції та картки */
section {
    scroll-margin-top: 130px;
}

.services-section,
.more-services-btn {
    padding-top: clamp(48px, 7vw, 90px) !important;
    padding-bottom: clamp(48px, 7vw, 90px) !important;
}

.section-title {
    font-size: clamp(1.9rem, 4vw, 2.8rem) !important;
    line-height: 1.15;
    margin-bottom: clamp(1.8rem, 4vw, 3rem) !important;
    text-wrap: balance;
}

.service-card,
.schedule-card,
.news-card,
.event-card,
.department-card,
.structure-card {
    height: 100%;
    border-radius: 18px;
}

.service-card {
    display: flex;
    flex-direction: column;
}

.service-card img {
    height: clamp(180px, 23vw, 230px) !important;
    object-fit: cover;
}

.service-card-body {
    padding: clamp(18px, 3vw, 28px) !important;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.service-card-title {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem) !important;
    line-height: 1.2;
}

.service-card-link {
    margin-top: auto;
}

/* Контентные страницы */
main {
    padding-top: clamp(32px, 6vw, 56px) !important;
    padding-bottom: clamp(32px, 6vw, 56px) !important;
}

main h1,
.page-title,
.content-title {
    font-size: clamp(1.75rem, 4vw, 3rem) !important;
    line-height: 1.15;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

main h2 {
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1.2;
}

main p,
main li {
    overflow-wrap: anywhere;
}

.card,
.list-group,
.alert {
    border-radius: 16px;
}

/* Таблицы не должны ломать экран */
.table-responsive {
    border-radius: 14px;
}

table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

/* Футер */
.site-footer {
    padding: clamp(54px, 7vw, 86px) 0 28px !important;
    background:
        linear-gradient(135deg, rgba(0, 158, 160, .08), rgba(20, 59, 86, .06)),
        #f5f9fb;
    color: #315368;
}

.site-footer-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1.15fr) minmax(220px, .85fr) minmax(260px, .9fr);
    gap: 28px;
    align-items: start;
    padding: 30px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(17, 44, 65, .08);
    box-shadow: 0 18px 52px rgba(17, 44, 65, .1);
}

.site-footer-brand {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.site-footer-logo {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef8fa;
    overflow: hidden;
}

.site-footer-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.site-footer-name {
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 10px;
}

.site-footer-brand p {
    color: #607581;
    line-height: 1.6;
    margin: 0;
}

.site-footer-nav {
    display: grid;
    gap: 10px;
}

.site-footer-nav a,
.site-footer-contact a {
    color: #315368;
    text-decoration: none;
    font-weight: 800;
}

.site-footer-nav a:hover,
.site-footer-contact a:hover {
    color: var(--accent);
}

.site-footer-contacts {
    display: grid;
    gap: 12px;
}

.site-footer-contact {
    padding: 14px 16px;
    border-radius: 8px;
    background: #f8fbff;
    border: 1px solid rgba(17, 44, 65, .07);
}

.site-footer-contact span {
    display: block;
    color: #607581;
    font-size: .92rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.site-footer-contact a {
    color: var(--accent);
    font-size: 1.03rem;
}

.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 20px;
    color: #607581;
    font-weight: 700;
}

.site-footer-social {
    display: flex;
    gap: 10px;
}

.site-footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* Компактне повідомлення про технічні cookies */
.cookie-notice[hidden] {
    display: none !important;
}

.cookie-notice {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1100;
    width: min(560px, calc(100vw - 36px));
}

.cookie-notice__content {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(0, 163, 168, .2);
    border-radius: 8px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 46px rgba(17, 44, 65, .2);
    color: #315368;
}

.cookie-notice__icon {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 163, 168, .1);
    color: var(--accent);
}

.cookie-notice p {
    margin: 0;
    font-size: .9rem;
    line-height: 1.55;
}

.cookie-notice a {
    color: var(--accent);
    font-weight: 800;
}

.cookie-notice__button {
    min-height: 42px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    white-space: nowrap;
}

.cookie-notice__button:hover,
.cookie-notice__button:focus-visible {
    background: #087f84;
}

@media (max-width: 575.98px) {
    .cookie-notice {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }

    .cookie-notice__content {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 13px;
    }

    .cookie-notice__icon {
        width: 36px;
        height: 36px;
    }

    .cookie-notice__button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* 1200–1399 */
@media (max-width: 1399.98px) {
    .main-nav-list {
        gap: 8px;
    }

    .nav-link {
        font-size: .82rem !important;
        padding: .48rem .45rem !important;
        letter-spacing: .02em;
    }

    .hospital-name {
        font-size: 1.35rem !important;
    }

    .header-brand {
        gap: 10px;
    }

    .header-logo-wrap {
        width: 42px;
        height: 42px;
    }

    .header-logo {
        width: 34px;
        height: 34px;
        max-width: 34px;
        max-height: 34px;
    }

    .phone-top {
        font-size: .92rem !important;
        padding: .42rem .7rem !important;
    }
}

/* 992–1199 */
@media (max-width: 1199.98px) and (min-width: 992px) {
    .main-nav-list {
        gap: 3px;
    }

    .nav-link {
        font-size: .74rem !important;
        padding: .45rem .32rem !important;
    }

    .dropdown-toggle::after {
        margin-left: .15rem;
    }
}

/* Планшеты и телефоны */
@media (max-width: 991.98px) {
    .top-line {
        min-height: 58px;
        padding: 6px 0;
    }

    .menu-line {
        min-height: 52px;
    }

    .hospital-name {
        font-size: 1.2rem !important;
        white-space: normal;
    }

    .header-brand {
        gap: 8px;
    }

    .header-logo-wrap {
        width: 38px;
        height: 38px;
    }

    .header-logo {
        width: 31px;
        height: 31px;
        max-width: 31px;
        max-height: 31px;
    }

    .phone-top {
        font-size: 0 !important;
        width: 42px;
        height: 42px;
        padding: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .phone-top i {
        font-size: 1.05rem;
        margin: 0 !important;
    }

    .phone-top::after {
        display: none;
    }

    .social-icons {
        gap: 8px !important;
    }

    .social-link {
        width: 38px;
        height: 38px;
    }

    .site-search-toggle {
        width: 42px;
        height: 42px;
        box-shadow: none;
    }

    .site-search-panel {
        position: fixed;
        top: 74px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        padding: 14px;
        border-radius: 16px;
    }

    .site-search-row {
        flex-direction: column;
    }

    .site-search-submit {
        width: 100%;
    }

    .navbar {
        padding: 6px 0 !important;
    }

    .navbar-collapse {
        margin-top: 8px;
        padding: 10px;
        max-height: calc(100vh - 124px);
        overflow-y: auto;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 16px 44px rgba(0,0,0,.14);
    }

    .main-nav-list {
        align-items: stretch !important;
        gap: 4px;
    }

    .nav-link {
        font-size: .96rem !important;
        padding: .8rem .95rem !important;
        text-align: left;
    }

    .dropdown:hover .dropdown-menu {
        display: none;
    }

    .dropdown-menu.show {
        display: block !important;
        position: static !important;
        transform: none !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 2px 0 8px !important;
        box-shadow: none !important;
        border: 1px solid rgba(0,0,0,.08) !important;
        background: #f8f9fa !important;
    }

    .dropdown-item {
        padding: .72rem 1rem !important;
        font-size: .9rem !important;
    }

    section {
        scroll-margin-top: 118px;
    }

    .hero {
        min-height: calc(100svh - 110px) !important;
        padding: 54px 0 60px !important;
    }

    .hero .btn {
        width: 100%;
        max-width: 520px;
        font-size: 1.05rem !important;
        padding: .95rem 1rem !important;
    }

    .service-card:hover {
        transform: none !important;
    }

    .schedule-card {
        flex-direction: column;
        align-items: stretch !important;
    }
}

/* Телефоны */
@media (max-width: 575.98px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .top-line .row {
        gap: 6px;
    }

    .hospital-name {
        max-width: 146px;
        font-size: 1.05rem !important;
    }

    .header-brand {
        gap: 7px;
    }

    .header-logo-wrap {
        width: 34px;
        height: 34px;
    }

    .header-logo {
        width: 28px;
        height: 28px;
        max-width: 28px;
        max-height: 28px;
    }

    .phone-dropdown-menu {
        position: fixed !important;
        top: 62px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-height: calc(100svh - 90px);
        transform: none !important;
    }

    .hero {
        min-height: calc(100svh - 104px) !important;
        padding: 42px 0 50px !important;
    }

    .hero h1 {
        font-size: clamp(1.85rem, 10vw, 2.65rem);
    }

    .hero .lead {
        margin-top: 1rem !important;
    }

    .section-title {
        letter-spacing: 0;
    }

    .row.g-5 {
        --bs-gutter-y: 1.5rem;
    }

    .service-card img {
        height: 190px !important;
    }

    main .container,
    section .container {
        max-width: 100%;
    }

    main h1 {
        margin-bottom: 1.6rem !important;
    }

    .btn-lg {
        font-size: 1rem !important;
        padding: .85rem 1rem !important;
    }

    .site-footer-panel {
        grid-template-columns: 1fr;
        padding: 22px;
    }

    .site-footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Очень узкие экраны */
@media (max-width: 380px) {
    .hospital-name {
        max-width: 118px;
        font-size: .96rem !important;
    }

    .header-logo-wrap {
        width: 30px;
        height: 30px;
    }

    .header-logo {
        width: 25px;
        height: 25px;
        max-width: 25px;
        max-height: 25px;
    }

    .social-icons {
        display: flex !important;
        gap: 5px !important;
    }

    .social-link {
        width: 30px;
        height: 30px;
        font-size: .92rem;
    }

    .navbar-collapse {
        max-height: calc(100vh - 112px);
    }

    .hero h1 {
        font-size: 1.75rem;
    }
}

/* 2026-06-23: stable desktop navigation and mobile header layout.
   Keeps A+ modes from stretching menu items into oversized gaps. */
@media (min-width: 992px) {
    .main-header .menu-line {
        min-height: 62px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .main-header .navbar {
        min-height: 62px !important;
        padding: 0 !important;
    }

    .main-header .navbar-collapse {
        width: 100% !important;
        justify-content: center !important;
    }

    .main-header .main-nav-list,
    html[data-font-scale="125"] .main-header .main-nav-list,
    html[data-font-scale="150"] .main-header .main-nav-list,
    html[data-font-scale="175"] .main-header .main-nav-list,
    html[data-font-scale="200"] .main-header .main-nav-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 1280px !important;
        gap: clamp(12px, 2vw, 34px) !important;
        margin: 0 auto !important;
    }

    .main-header .main-nav-list .nav-item,
    html[data-font-scale="125"] .main-header .main-nav-list .nav-item,
    html[data-font-scale="150"] .main-header .main-nav-list .nav-item,
    html[data-font-scale="175"] .main-header .main-nav-list .nav-item,
    html[data-font-scale="200"] .main-header .main-nav-list .nav-item {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale="125"] .main-header .main-nav-list .nav-link,
    html[data-font-scale="150"] .main-header .main-nav-list .nav-link,
    html[data-font-scale="175"] .main-header .main-nav-list .nav-link,
    html[data-font-scale="200"] .main-header .main-nav-list .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 62px !important;
        min-width: 0 !important;
        max-width: 158px !important;
        width: auto !important;
        padding: 0 4px !important;
        font-size: clamp(.84rem, .9vw, .98rem) !important;
        line-height: 1.12 !important;
        text-align: center !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        gap: 10px !important;
        max-width: 1080px !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        max-width: 136px !important;
        font-size: .82rem !important;
    }
}

@media (max-width: 767.98px) {
    .main-header .top-line {
        padding: 8px 0 !important;
    }

    .main-header .header-brand-row {
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand icons"
            "phone access"
            "font font" !important;
        gap: 8px !important;
        align-items: center !important;
    }

    .main-header .header-brand,
    .main-header .header-brand-row > .col-auto:first-child {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .main-header .header-logo-wrap,
    .main-header .header-logo {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
    }

    .main-header .header-logo {
        object-fit: contain !important;
    }

    .main-header .hospital-name,
    .main-header .hospital-name-compact {
        max-width: calc(100vw - 210px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: clamp(1rem, 4.2vw, 1.16rem) !important;
        line-height: 1.05 !important;
    }

    .main-header .header-icon-row {
        gap: 6px !important;
        justify-content: flex-end !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        flex: 0 0 42px !important;
    }

    .main-header .header-phone-widget,
    .main-header .accessibility-toggle {
        width: 100% !important;
        min-width: 0 !important;
    }

    .main-header .phone-top,
    .main-header .accessibility-toggle {
        min-height: 50px !important;
        justify-content: center !important;
    }

    .main-header .phone-top span {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .main-header .font-size-controls {
        justify-self: end !important;
    }

    .main-header .menu-line {
        min-height: auto !important;
        padding: 8px 0 10px !important;
    }
}

@media (max-width: 420px) {
    .main-header .hospital-name,
    .main-header .hospital-name-compact {
        display: none !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        flex-basis: 40px !important;
    }
}

/* Стабильная мобильная шапка и меню */
@media (max-width: 991.98px) {
    .main-header {
        position: sticky !important;
        z-index: 1040 !important;
        padding: 0 !important;
    }

    .top-line .row {
        flex-wrap: nowrap;
    }

    .top-line .col-auto {
        min-width: 0;
    }

    .top-line .row > .col-auto:last-child {
        flex: 0 0 auto;
        gap: 8px !important;
    }

    .header-brand {
        min-width: 0;
        max-width: min(58vw, 360px);
    }

    .hospital-name {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .social-icons {
        display: flex !important;
        align-items: center;
        flex: 0 0 auto;
    }

    .menu-line {
        position: relative;
    }

    .navbar {
        min-height: 52px;
        justify-content: flex-end;
    }

    .navbar-toggler {
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        border: 1px solid rgba(0, 163, 168, .24);
        background: rgba(0, 163, 168, .06);
        box-shadow: none;
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 .18rem rgba(0, 163, 168, .18);
    }

    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        z-index: 1100;
        margin-top: 0;
        padding: 10px 12px 14px;
        max-height: calc(100svh - 124px);
        overflow-y: auto;
        background: #fff;
        border: 1px solid rgba(17, 44, 65, .08);
        border-radius: 8px;
        box-shadow: 0 20px 50px rgba(17, 44, 65, .18);
    }

    .main-nav-list {
        align-items: stretch !important;
        gap: 0;
        width: 100%;
    }

    .main-nav-list .nav-item {
        width: 100%;
    }

    .main-nav-list .nav-link {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 8px !important;
        border-radius: 8px;
        border-bottom: 1px solid rgba(17, 44, 65, .08);
        text-align: left;
    }

    .main-nav-list .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        min-width: 0;
        margin: 4px 0 10px !important;
        padding: 6px 0;
        display: none;
        border: 1px solid rgba(17, 44, 65, .07) !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        background: #f6fbfc !important;
    }

    .main-nav-list .dropdown-menu.show {
        display: block !important;
    }

    .main-nav-list .dropdown-item {
        padding: 10px 14px !important;
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    .social-icons {
        display: flex !important;
        gap: 6px !important;
    }

    .social-link {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .header-brand {
        max-width: calc(100vw - 178px);
    }
}

@media (max-width: 575.98px) {
    .top-line .row > .col-auto:last-child {
        gap: 6px !important;
    }

    .phone-top {
        width: 38px;
        height: 38px;
    }

    .header-brand {
        max-width: calc(100vw - 164px);
    }
}

/* Печать */
/* Phone dropdown must stay outside the mobile header flow. */
@media (max-width: 991.98px) {
    .main-header .top-line,
    .main-header .top-line .container,
    .main-header .top-line .row {
        height: auto !important;
        min-height: 0 !important;
    }

    .main-header .top-line {
        min-height: 58px !important;
    }

    .main-header .top-line .row {
        align-items: center !important;
    }

    .main-header .top-line .dropdown {
        position: static !important;
    }

    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 64px) !important;
        right: max(12px, env(safe-area-inset-right, 0px)) !important;
        left: auto !important;
        bottom: auto !important;
        width: min(420px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100svh - 88px) !important;
        margin: 0 !important;
        padding: 14px !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        transform: none !important;
        z-index: 1300 !important;
    }

    .main-header .phone-dropdown-menu .phone-division-link {
        display: inline;
        overflow-wrap: anywhere;
    }

    .main-header .phone-dropdown-menu .phone-division-number {
        white-space: normal;
    }
}

@media (max-width: 575.98px) {
    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        top: calc(env(safe-area-inset-top, 0px) + 58px) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-height: calc(100svh - 78px) !important;
    }
}

/* Mobile shield: the last word for header, menus and dropdowns on phones. */
@media (max-width: 991.98px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    body.mobile-menu-open {
        touch-action: manipulation;
    }

    .main-header {
        position: sticky !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        z-index: 1200 !important;
        overflow: visible !important;
        transform: none !important;
    }

    .main-header.hidden {
        transform: none !important;
    }

    .main-header .container {
        max-width: 100% !important;
    }

    .main-header .top-line .row {
        flex-wrap: nowrap !important;
        align-items: center !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .main-header .top-line .row > .col-auto:first-child {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .main-header .top-line .row > .col-auto:last-child {
        min-width: max-content !important;
        flex: 0 0 auto !important;
    }

    .header-brand {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .hospital-name {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .social-icons {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        flex: 0 0 auto !important;
        z-index: 2 !important;
    }

    .social-link {
        display: inline-flex !important;
        flex: 0 0 auto !important;
    }

    .menu-line {
        position: relative !important;
        z-index: 1190 !important;
        overflow: visible !important;
    }

    .navbar-collapse,
    .navbar-collapse.show {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100svh - 128px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        transform: none !important;
        z-index: 1250 !important;
    }

    .navbar-collapse.show {
        display: block !important;
    }

    .main-nav-list .dropdown-menu,
    .main-nav-list .dropdown-menu.show {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        margin: 4px 0 10px !important;
    }

    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        position: fixed !important;
        top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
        right: max(12px, env(safe-area-inset-right, 0px)) !important;
        left: auto !important;
        bottom: auto !important;
        width: min(420px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100svh - 82px) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        transform: none !important;
        z-index: 1300 !important;
    }

    .main-header .phone-dropdown-menu * {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .main-header .top-line .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .main-header .top-line .row > .col-auto:last-child {
        gap: 5px !important;
    }

    .social-link {
        width: 32px !important;
        height: 32px !important;
        font-size: .95rem !important;
    }

    .site-search-toggle {
        width: 32px !important;
        height: 32px !important;
        font-size: .95rem !important;
        box-shadow: none !important;
    }

    .phone-top {
        width: 36px !important;
        height: 36px !important;
    }

    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100svh - 72px) !important;
    }
}

@media (max-width: 380px) {
    .hospital-name {
        font-size: .98rem !important;
    }

    .header-logo-wrap {
        width: 32px !important;
        height: 32px !important;
    }

    .header-logo {
        width: 26px !important;
        height: 26px !important;
    }

    .social-link {
        width: 30px !important;
        height: 30px !important;
    }

    .site-search-toggle {
        width: 30px !important;
        height: 30px !important;
        font-size: .9rem !important;
    }

    .phone-top {
        width: 34px !important;
        height: 34px !important;
    }
}

@media print {
    .main-header,
    footer,
    .btn,
    .navbar {
        display: none !important;
    }

    body {
        overflow: visible;
    }

    main {
        padding: 0 !important;
    }
}

/* Final header layout fixes */
.main-header .header-brand-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
        "brand icons icons"
        "phone access font";
    align-items: center !important;
    gap: 8px 10px !important;
}

.main-header .header-brand-row > .col-auto:first-child {
    grid-area: brand;
    min-width: 0;
}

.main-header .header-actions {
    display: contents !important;
}

.main-header .header-icon-row {
    grid-area: icons;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    justify-self: end !important;
    gap: 8px !important;
    white-space: nowrap;
}

.main-header .header-icon-row .social-icons {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

.main-header .header-icon-row .site-search-widget {
    display: inline-flex !important;
    margin: 0 !important;
}

.main-header .header-phone-widget {
    grid-area: phone;
    justify-self: start;
}

.main-header .accessibility-toggle {
    grid-area: access;
    justify-self: end;
}

.main-header .font-size-controls {
    grid-area: font;
    justify-self: end;
}

.main-header .header-icon-row .social-link,
.main-header .header-icon-row .site-search-toggle {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    font-size: 1.05rem !important;
    flex: 0 0 42px !important;
}

@media (max-width: 575.98px) {
    .main-header .header-brand-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand icons"
            "phone phone"
            "access font";
        gap: 8px !important;
    }

    .main-header .header-icon-row {
        gap: 6px !important;
    }

    .main-header .header-icon-row .social-icons {
        gap: 6px !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: .95rem !important;
        flex-basis: 32px !important;
    }
}

@media (max-width: 380px) {
    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        font-size: .9rem !important;
        flex-basis: 30px !important;
    }
}

/* Keep the header usable in A+ font-size modes. */
html[data-font-scale="125"] .main-header,
html[data-font-scale="150"] .main-header,
html[data-font-scale="175"] .main-header,
html[data-font-scale="200"] .main-header {
    overflow-x: clip;
}

html[data-font-scale="125"] .main-header .header-logo-wrap,
html[data-font-scale="150"] .main-header .header-logo-wrap,
html[data-font-scale="175"] .main-header .header-logo-wrap,
html[data-font-scale="200"] .main-header .header-logo-wrap {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    flex: 0 0 46px !important;
}

html[data-font-scale="125"] .main-header .header-logo,
html[data-font-scale="150"] .main-header .header-logo,
html[data-font-scale="175"] .main-header .header-logo,
html[data-font-scale="200"] .main-header .header-logo {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    object-fit: contain !important;
}

html[data-font-scale="125"] .main-header .hospital-name,
html[data-font-scale="150"] .main-header .hospital-name,
html[data-font-scale="175"] .main-header .hospital-name,
html[data-font-scale="200"] .main-header .hospital-name {
    font-size: clamp(1.05rem, 2.15vw, 1.75rem) !important;
    line-height: 1.12 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

html[data-font-scale="125"] .main-header .main-nav-list,
html[data-font-scale="150"] .main-header .main-nav-list,
html[data-font-scale="175"] .main-header .main-nav-list,
html[data-font-scale="200"] .main-header .main-nav-list {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px 14px !important;
    width: 100% !important;
}

html[data-font-scale="125"] .main-header .main-nav-list .nav-item,
html[data-font-scale="150"] .main-header .main-nav-list .nav-item,
html[data-font-scale="175"] .main-header .main-nav-list .nav-item,
html[data-font-scale="200"] .main-header .main-nav-list .nav-item {
    flex: 0 0 auto !important;
    min-width: auto !important;
    max-width: none !important;
}

html[data-font-scale="125"] .main-header .main-nav-list .nav-link,
html[data-font-scale="150"] .main-header .main-nav-list .nav-link,
html[data-font-scale="175"] .main-header .main-nav-list .nav-link,
html[data-font-scale="200"] .main-header .main-nav-list .nav-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: max-content !important;
    max-width: 15rem !important;
    padding: 8px 8px !important;
    line-height: 1.14 !important;
    letter-spacing: .1px !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: manual !important;
    text-align: center !important;
}

html[data-font-scale="125"] .main-header .menu-line,
html[data-font-scale="150"] .main-header .menu-line,
html[data-font-scale="175"] .main-header .menu-line,
html[data-font-scale="200"] .main-header .menu-line {
    height: auto !important;
    min-height: 62px !important;
}

html[data-font-scale="125"] body,
html[data-font-scale="150"] body,
html[data-font-scale="175"] body,
html[data-font-scale="200"] body {
    padding-top: 0 !important;
}

@media (max-width: 575.98px) {
    html[data-font-scale="125"] .main-header .header-logo-wrap,
    html[data-font-scale="150"] .main-header .header-logo-wrap,
    html[data-font-scale="175"] .main-header .header-logo-wrap,
    html[data-font-scale="200"] .main-header .header-logo-wrap {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        flex-basis: 40px !important;
    }

    html[data-font-scale="125"] .main-header .header-logo,
    html[data-font-scale="150"] .main-header .header-logo,
    html[data-font-scale="175"] .main-header .header-logo,
    html[data-font-scale="200"] .main-header .header-logo {
        width: 34px !important;
        height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
    }
}

/* The home hero begins directly below the sticky header. */
main.home-modern {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Compact two-row header controls for tablets and phones. */
@media (max-width: 991.98px) {
    .main-header .header-brand-row {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        grid-template-areas:
            "brand icons icons"
            "phone access font" !important;
        column-gap: 8px !important;
        row-gap: 8px !important;
    }

    .main-header .hospital-name {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
        white-space: nowrap !important;
        letter-spacing: 0 !important;
    }

    .main-header .hospital-name-full {
        font-size: 1.05rem !important;
    }

    .main-header .hospital-name-short {
        font-size: 1rem !important;
    }

    .main-header .header-phone-widget,
    .main-header .header-phone-widget .phone-top {
        width: 100% !important;
        min-width: 0 !important;
    }

    .main-header .header-phone-widget .phone-top {
        height: 42px !important;
        border-radius: 999px !important;
    }

    .main-header .accessibility-toggle {
        width: 100% !important;
        min-width: 0 !important;
        height: 42px !important;
        padding: 0 12px !important;
        gap: 8px !important;
        font-size: .88rem !important;
        overflow: hidden;
    }

    .main-header .accessibility-toggle span {
        display: inline !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .main-header .font-size-controls {
        min-height: 42px;
        justify-self: end !important;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .main-header .header-brand-row {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        grid-template-areas:
            "brand icons icons"
            "phone access font" !important;
    }

    .main-header .header-phone-widget .phone-top {
        width: 100% !important;
        height: 40px !important;
    }

    .main-header .accessibility-toggle {
        height: 40px !important;
        min-height: 40px !important;
        padding: 0 9px !important;
        gap: 6px !important;
        font-size: .78rem !important;
    }

    .main-header .accessibility-toggle i {
        font-size: .88rem !important;
    }

    .main-header .font-size-controls {
        min-height: 40px;
    }

    .main-header .font-size-toggle {
        min-width: 34px !important;
        min-height: 34px !important;
        padding: 0 6px !important;
    }

    .main-header .hospital-name-compact {
        font-size: .98rem !important;
    }
}

@media (max-width: 380px) {
    .main-header .header-brand-row {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        column-gap: 6px !important;
    }

    .main-header .accessibility-toggle {
        padding: 0 7px !important;
        font-size: .72rem !important;
    }

    .main-header .font-size-toggle {
        min-width: 31px !important;
        padding: 0 4px !important;
    }
}

@media (max-width: 420px) {
    .main-header .accessibility-toggle span {
        display: none !important;
    }

    .main-header .accessibility-toggle {
        width: 42px !important;
        justify-self: center !important;
        padding: 0 !important;
    }
}

/* Apple/WebKit compatibility: safe areas, touch controls and dynamic viewport. */
body,
.main-header,
.main-header * {
    -webkit-tap-highlight-color: transparent;
}

.main-header {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

.header-brand,
.hospital-name,
.header-actions,
.header-icon-row,
.main-nav-list,
.main-nav-list .nav-item {
    min-width: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
input[type="button"],
input[type="submit"],
input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.cookie-notice {
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
}

@supports (height: 100dvh) {
    @media (max-width: 991.98px) {
        .hero {
            min-height: calc(100dvh - 110px) !important;
        }

        .main-header .navbar-collapse,
        .main-header .navbar-collapse.show {
            max-height: calc(100dvh - 128px) !important;
        }

        .main-header .phone-dropdown-menu,
        .main-header .phone-dropdown-menu.show {
            max-height: calc(100dvh - 82px) !important;
        }
    }
}

@media (max-width: 991.98px) {
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .main-header .navbar-collapse,
    .main-header .navbar-collapse.show,
    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .main-header .dropdown:hover .dropdown-menu:not(.show) {
        display: none !important;
    }

    .home-hero-modern {
        padding-top: clamp(62px, 12vw, 108px) !important;
    }
}

@media (max-width: 575.98px) {
    .cookie-notice {
        left: max(10px, env(safe-area-inset-left, 0px));
        right: max(10px, env(safe-area-inset-right, 0px));
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        width: auto;
    }
}

@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }

    .main-header {
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    .home-hero-modern,
    .hero {
        background-attachment: scroll !important;
    }
}

/* 2026-06-23: final header guard for desktop, mobile and enlarged text modes. */
@media (min-width: 992px) {
    .main-header .menu-line,
    .main-header .navbar {
        min-height: 62px !important;
        margin: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: center !important;
        gap: clamp(10px, 2vw, 34px) !important;
        width: 100% !important;
        max-width: 1280px !important;
        margin: 0 auto !important;
    }

    .main-header .main-nav-list .nav-item,
    html[data-font-scale] .main-header .main-nav-list .nav-item {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 62px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 176px !important;
        padding: 0 .3rem !important;
        white-space: normal !important;
        overflow-wrap: normal !important;
        word-break: normal !important;
        text-align: center !important;
        line-height: 1.12 !important;
        letter-spacing: 0 !important;
        font-size: clamp(.82rem, .9vw, .98rem) !important;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        gap: 12px !important;
        padding: 0 10px !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        max-width: 148px !important;
        font-size: .82rem !important;
    }
}

@media (max-width: 991.98px) {
    .main-header {
        position: relative !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand icons"
            "phone access"
            "menu menu" !important;
        align-items: center !important;
        gap: 10px 12px !important;
        margin: 0 !important;
        padding: 10px 14px 12px !important;
    }

    .main-header .header-brand {
        grid-area: brand !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .main-header .header-icon-row {
        grid-area: icons !important;
        justify-self: end !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        width: auto !important;
    }

    .main-header .header-phone-widget {
        grid-area: phone !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .main-header .accessibility-controls {
        grid-area: access !important;
        justify-self: end !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .main-header .mobile-menu-toggle,
    .main-header .navbar-toggler {
        grid-area: menu !important;
        justify-self: end !important;
        margin: 8px 0 0 !important;
    }

    .main-header .logo {
        width: 42px !important;
        height: 42px !important;
        flex: 0 0 42px !important;
    }

    .main-header .hospital-name,
    .main-header .hospital-name-compact {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        line-height: 1.1 !important;
        font-size: clamp(1rem, 4vw, 1.2rem) !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle,
    .main-header .search-toggle,
    .main-header .mobile-menu-toggle,
    .main-header .navbar-toggler {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        padding: 0 !important;
        border-radius: 50% !important;
    }

    .main-header .header-phone-widget .phone-top,
    .main-header .phone-top {
        width: 100% !important;
        max-width: none !important;
        height: 42px !important;
        justify-content: center !important;
        padding: 0 12px !important;
        border-radius: 999px !important;
    }

    .main-header .accessibility-toggle {
        height: 42px !important;
        min-height: 42px !important;
        border-radius: 999px !important;
    }

    .main-header .font-size-controls {
        min-height: 42px !important;
        border-radius: 999px !important;
    }

    .main-header .navbar-collapse {
        margin-top: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand icons"
            "phone access"
            "menu menu" !important;
        gap: 9px !important;
        padding: 8px 12px 10px !important;
    }

    .main-header .header-icon-row {
        gap: 7px !important;
    }

    .main-header .logo {
        width: 38px !important;
        height: 38px !important;
        flex-basis: 38px !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle,
    .main-header .search-toggle,
    .main-header .mobile-menu-toggle,
    .main-header .navbar-toggler {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    .main-header .hospital-name,
    .main-header .hospital-name-compact {
        font-size: .98rem !important;
    }

    .main-header .header-phone-widget .phone-top .phone-text,
    .main-header .phone-top .phone-text {
        display: none !important;
    }

    .main-header .accessibility-toggle span {
        max-width: 210px !important;
    }
}

@media (max-width: 420px) {
    .main-header .hospital-name,
    .main-header .hospital-name-compact {
        display: none !important;
    }

    .main-header .accessibility-toggle span {
        display: inline !important;
        max-width: 160px !important;
    }
}

/* 2026-06-23: production header patch. This intentionally stays last. */
.main-header {
    background: #fff !important;
}

.main-header .top-line,
.main-header .menu-line {
    background: #fff !important;
}

.main-header + main,
.home-modern {
    margin-top: 0 !important;
}

.home-hero-modern {
    background-position: center top !important;
    margin-top: 0 !important;
}

@media (min-width: 992px) {
    .main-header .top-line {
        height: auto !important;
        min-height: 88px !important;
    }

    .main-header .top-line .container,
    .main-header .menu-line .container {
        max-width: 1440px !important;
    }

    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
        min-height: 88px !important;
        margin: 0 !important;
        padding-top: 12px !important;
        padding-bottom: 10px !important;
    }

    .main-header .header-brand {
        display: inline-flex !important;
        align-items: center !important;
        min-width: 0 !important;
        max-width: calc(100vw - 620px) !important;
    }

    .main-header .header-logo-wrap,
    .main-header .header-logo {
        width: 44px !important;
        height: 44px !important;
        flex: 0 0 44px !important;
    }

    .main-header .hospital-name {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: clamp(1.35rem, 2vw, 1.85rem) !important;
        line-height: 1.1 !important;
    }

    .main-header .header-actions,
    html[data-font-scale] .main-header .header-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px 10px !important;
        max-width: 620px !important;
    }

    .main-header .header-icon-row {
        order: 1 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .main-header .header-phone-widget {
        order: 2 !important;
    }

    .main-header .accessibility-toggle {
        order: 3 !important;
    }

    .main-header .font-size-controls {
        order: 4 !important;
    }

    .main-header .phone-top,
    .main-header .accessibility-toggle,
    .main-header .font-size-controls {
        height: 44px !important;
        min-height: 44px !important;
        font-size: .95rem !important;
        line-height: 1 !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        height: auto !important;
        min-height: 58px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        justify-content: space-between !important;
        gap: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-header .main-nav-list .nav-item,
    html[data-font-scale] .main-header .main-nav-list .nav-item {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 58px !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 168px !important;
        padding: 0 8px !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        text-align: center !important;
        line-height: 1.08 !important;
        letter-spacing: 0 !important;
        font-size: clamp(.78rem, .86vw, .94rem) !important;
    }
}

@media (min-width: 992px) and (max-width: 1180px) {
    .main-header .header-brand {
        max-width: calc(100vw - 560px) !important;
    }

    .main-header .hospital-name {
        font-size: clamp(1.1rem, 2vw, 1.45rem) !important;
    }

    .main-header .header-actions,
    html[data-font-scale] .main-header .header-actions {
        max-width: 560px !important;
        gap: 7px !important;
    }

    .main-header .phone-top,
    .main-header .accessibility-toggle,
    .main-header .font-size-controls {
        font-size: .82rem !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        max-width: 132px !important;
        padding-left: 5px !important;
        padding-right: 5px !important;
        font-size: .74rem !important;
    }
}

@media (max-width: 991.98px) {
    .main-header .top-line {
        height: auto !important;
        min-height: 0 !important;
    }

    .main-header .top-line .container,
    .main-header .menu-line .container {
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand icons"
            "phone access" !important;
        align-items: center !important;
        gap: 8px 10px !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 8px 14px 10px !important;
    }

    .main-header .header-brand {
        grid-area: brand !important;
        display: inline-flex !important;
        align-items: center !important;
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    .main-header .header-logo-wrap,
    .main-header .header-logo {
        width: 40px !important;
        height: 40px !important;
        flex: 0 0 40px !important;
    }

    .main-header .hospital-name {
        min-width: 0 !important;
        max-width: calc(100vw - 190px) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-size: clamp(.95rem, 3.6vw, 1.16rem) !important;
        line-height: 1.1 !important;
    }

    .main-header .header-actions {
        display: contents !important;
    }

    .main-header .header-icon-row {
        grid-area: icons !important;
        justify-self: end !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        width: auto !important;
    }

    .main-header .social-icons {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .main-header .header-phone-widget {
        grid-area: phone !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .main-header .accessibility-controls {
        grid-area: access !important;
        justify-self: end !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .main-header .phone-top,
    .main-header .accessibility-toggle,
    .main-header .font-size-controls {
        height: 40px !important;
        min-height: 40px !important;
    }

    .main-header .phone-top {
        width: 100% !important;
        max-width: none !important;
        justify-content: center !important;
        padding: 0 12px !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle,
    .main-header .mobile-menu-toggle,
    .main-header .navbar-toggler {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        height: auto !important;
        min-height: 64px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .main-header .navbar {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        padding: 0 14px !important;
    }

    .main-header .navbar-toggler {
        margin: 0 !important;
    }

    .main-header .navbar-collapse {
        position: absolute !important;
        top: 100% !important;
        left: 14px !important;
        right: 14px !important;
        z-index: 1002 !important;
        margin-top: 0 !important;
    }

    .home-hero-modern {
        padding-top: clamp(48px, 9vw, 76px) !important;
    }
}

@media (max-width: 575.98px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        gap: 7px 8px !important;
        padding: 7px 12px 8px !important;
    }

    .main-header .header-logo-wrap,
    .main-header .header-logo {
        width: 38px !important;
        height: 38px !important;
        flex-basis: 38px !important;
    }

    .main-header .hospital-name {
        max-width: calc(100vw - 186px) !important;
        font-size: .98rem !important;
    }

    .main-header .header-icon-row .social-link,
    .main-header .header-icon-row .site-search-toggle,
    .main-header .mobile-menu-toggle,
    .main-header .navbar-toggler {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    .main-header .phone-top {
        padding: 0 !important;
    }

    .main-header .phone-top .phone-text {
        display: none !important;
    }

    .main-header .accessibility-toggle {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .main-header .accessibility-toggle span {
        display: inline-block !important;
        max-width: 190px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .main-header .font-size-toggle {
        min-width: 36px !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        min-height: 58px !important;
    }

    .home-hero-modern {
        padding-top: 42px !important;
    }
}

@media (max-width: 420px) {
    .main-header .hospital-name {
        max-width: calc(100vw - 176px) !important;
    }

    .main-header .accessibility-toggle span {
        max-width: 145px !important;
    }
}

@media (max-width: 360px) {
    .main-header .hospital-name {
        display: none !important;
    }
}

/* 2026-06-23: final header stabilization for desktop, mobile and enlarged text modes. */
.main-header + main,
body > main,
.home-modern {
    margin-top: 0 !important;
}

.main-header .header-brand,
.main-header .hospital-name,
.main-header .main-nav-list .nav-link {
    min-width: 0 !important;
}

.main-header .hospital-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

@media (min-width: 992px) {
    .main-header .top-line {
        min-height: 84px !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        min-height: 56px !important;
    }

    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        justify-content: center !important;
        gap: clamp(12px, 2.6vw, 42px) !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        min-height: 56px !important;
        max-width: none !important;
        padding: 0 4px !important;
        white-space: normal !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        hyphens: none !important;
        text-align: center !important;
        line-height: 1.08 !important;
        font-size: clamp(.82rem, .92vw, .96rem) !important;
    }

    .main-header .main-nav-list > .dropdown {
        position: relative !important;
    }

    .main-header .main-nav-list > .dropdown:last-child .dropdown-menu {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
    }

    .main-header .main-nav-list .dropdown-menu {
        max-width: min(360px, calc(100vw - 32px)) !important;
        min-width: 280px !important;
    }

    .main-header .main-nav-list .dropdown-item {
        white-space: normal !important;
        overflow-wrap: break-word !important;
        line-height: 1.25 !important;
    }

    html[data-font-scale="large"] .main-header .main-nav-list,
    html[data-font-scale="xlarge"] .main-header .main-nav-list,
    html[data-font-scale="xxlarge"] .main-header .main-nav-list {
        gap: clamp(8px, 1.4vw, 24px) !important;
    }

    html[data-font-scale="large"] .main-header .main-nav-list .nav-link,
    html[data-font-scale="xlarge"] .main-header .main-nav-list .nav-link,
    html[data-font-scale="xxlarge"] .main-header .main-nav-list .nav-link {
        font-size: clamp(.78rem, .8vw, .9rem) !important;
        max-width: 150px !important;
    }
}

@media (max-width: 991.98px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.18fr) auto !important;
        grid-template-areas:
            "brand brand icons"
            "phone access font" !important;
        align-items: center !important;
        gap: 8px 10px !important;
        padding: 7px 14px 8px !important;
    }

    .main-header .header-brand {
        grid-area: brand !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .main-header .header-icon-row {
        grid-area: icons !important;
        justify-self: end !important;
    }

    .main-header .header-phone-widget {
        grid-area: phone !important;
        width: 100% !important;
    }

    .main-header .accessibility-toggle {
        grid-area: access !important;
        justify-self: stretch !important;
        justify-content: center !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .main-header .font-size-controls {
        grid-area: font !important;
        justify-self: end !important;
    }

    .main-header .phone-top,
    .main-header .accessibility-toggle,
    .main-header .font-size-controls {
        height: 40px !important;
        min-height: 40px !important;
        margin: 0 !important;
    }

    .main-header .accessibility-toggle span {
        display: inline-block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        min-height: 56px !important;
    }

    .main-header .navbar {
        justify-content: flex-end !important;
        padding: 0 14px !important;
    }

    .home-hero-modern {
        margin-top: 0 !important;
        padding-top: clamp(42px, 8vw, 68px) !important;
    }
}

@media (max-width: 575.98px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        grid-template-columns: minmax(0, .88fr) minmax(0, 1.35fr) auto !important;
        gap: 6px 8px !important;
        padding: 6px 14px 7px !important;
    }

    .main-header .hospital-name {
        max-width: calc(100vw - 182px) !important;
    }

    .main-header .phone-top .phone-text {
        display: none !important;
    }

    .main-header .phone-top {
        padding: 0 10px !important;
    }

    .main-header .accessibility-toggle {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    .main-header .font-size-toggle {
        min-width: 36px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

@media (max-width: 430px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        grid-template-columns: 44px minmax(0, 1fr) auto !important;
        grid-template-areas:
            "brand brand icons"
            "phone access font" !important;
    }

    .main-header .hospital-name {
        display: none !important;
    }

    .main-header .header-phone-widget {
        max-width: 96px !important;
    }

    .main-header .accessibility-toggle span {
        max-width: 170px !important;
    }
}

@media (max-width: 370px) {
    .main-header .accessibility-toggle span {
        max-width: 132px !important;
    }
}

/* 2026-07-09: unified premium header shell.
   The brand row and navigation now share the same visual grid on desktop. */
@media (min-width: 992px) {
    .main-header {
        box-shadow: 0 10px 30px rgba(17, 44, 65, .08) !important;
    }

    .main-header .top-line,
    .main-header .menu-line {
        border-color: rgba(17, 44, 65, .10) !important;
    }

    .main-header .top-line .container,
    .main-header .menu-line .container {
        width: min(1440px, calc(100% - 64px)) !important;
        max-width: none !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        --bs-gutter-x: 0 !important;
        width: 100% !important;
        min-height: 82px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        gap: 18px !important;
    }

    .main-header .header-brand-row > .col-auto:first-child,
    .main-header .header-brand-row > .col-auto:last-child {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .main-header .header-brand {
        max-width: min(760px, calc(100vw - 690px)) !important;
        gap: 12px !important;
    }

    .main-header .hospital-name {
        font-size: clamp(1.45rem, 1.86vw, 2rem) !important;
        letter-spacing: 0 !important;
    }

    .main-header .header-actions,
    html[data-font-scale] .main-header .header-actions {
        max-width: 660px !important;
        gap: 8px 10px !important;
    }

    .main-header .menu-line,
    .main-header .navbar {
        min-height: 58px !important;
    }

    .main-header .navbar,
    .main-header .navbar-collapse {
        width: 100% !important;
    }

    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        width: 100% !important;
        max-width: none !important;
        justify-content: space-between !important;
        gap: 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .main-header .main-nav-list .nav-item,
    html[data-font-scale] .main-header .main-nav-list .nav-item {
        flex: 0 1 auto !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        min-height: 58px !important;
        padding: 0 8px !important;
        max-width: none !important;
        white-space: nowrap !important;
        text-align: center !important;
        font-size: clamp(.78rem, .82vw, .93rem) !important;
        font-weight: 800 !important;
        letter-spacing: 0 !important;
    }

    .main-header .main-nav-list .nav-link.active {
        color: var(--accent) !important;
    }

    .main-header .main-nav-list .dropdown-menu {
        max-width: min(380px, calc(100vw - 32px)) !important;
        min-width: 280px !important;
        border: 1px solid rgba(17, 44, 65, .10) !important;
        border-radius: 8px !important;
        box-shadow: 0 20px 48px rgba(17, 44, 65, .14) !important;
    }

    .main-header .main-nav-list > .dropdown:last-child .dropdown-menu {
        left: auto !important;
        right: 0 !important;
        transform: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1280px) {
    .main-header .top-line .container,
    .main-header .menu-line .container {
        width: min(1200px, calc(100% - 40px)) !important;
    }

    .main-header .header-brand {
        max-width: calc(100vw - 610px) !important;
    }

    .main-header .hospital-name {
        font-size: clamp(1.16rem, 1.55vw, 1.55rem) !important;
    }

    .main-header .header-actions,
    html[data-font-scale] .main-header .header-actions {
        max-width: 590px !important;
    }

    .main-header .main-nav-list,
    html[data-font-scale] .main-header .main-nav-list {
        gap: 6px !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        padding-left: 5px !important;
        padding-right: 5px !important;
        font-size: clamp(.72rem, .82vw, .84rem) !important;
    }
}

@media (min-width: 992px) and (max-width: 1120px) {
    .main-header .top-line .container,
    .main-header .menu-line .container {
        width: calc(100% - 28px) !important;
    }

    .main-header .main-nav-list .nav-link,
    html[data-font-scale] .main-header .main-nav-list .nav-link {
        font-size: .68rem !important;
        padding-left: 3px !important;
        padding-right: 3px !important;
    }
}

/* 2026-07-09: mobile header control balance. */
@media (max-width: 991.98px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        grid-template-columns: minmax(96px, .72fr) minmax(0, 1.45fr) auto !important;
        grid-template-areas:
            "brand brand icons"
            "phone access font" !important;
    }

    .main-header .header-phone-widget {
        max-width: none !important;
    }

    .main-header .accessibility-toggle {
        width: 100% !important;
        min-width: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .main-header .accessibility-toggle span {
        display: inline-block !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .main-header .font-size-controls {
        width: auto !important;
        min-width: 92px !important;
        max-width: 104px !important;
        justify-self: end !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
        gap: 2px !important;
    }

    .main-header .font-size-toggle {
        min-width: 34px !important;
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}

@media (max-width: 575.98px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        grid-template-columns: minmax(104px, .75fr) minmax(0, 1.55fr) 92px !important;
        gap: 6px 8px !important;
    }

    .main-header .font-size-controls {
        min-width: 86px !important;
        max-width: 92px !important;
    }

    .main-header .font-size-toggle {
        min-width: 32px !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
    }
}

@media (max-width: 430px) {
    .main-header .header-brand-row,
    html[data-font-scale] .main-header .header-brand-row {
        grid-template-columns: minmax(86px, .68fr) minmax(0, 1.65fr) 84px !important;
    }

    .main-header .header-phone-widget {
        max-width: none !important;
    }

    .main-header .accessibility-toggle span {
        max-width: 100% !important;
    }

    .main-header .font-size-controls {
        min-width: 80px !important;
        max-width: 84px !important;
    }
}

/* 2026-07-09: keep department phone dropdown text inside the panel. */
.main-header .phone-dropdown-menu,
.main-header .phone-dropdown-menu.show {
    box-sizing: border-box !important;
    width: min(360px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    overflow-x: hidden !important;
    white-space: normal !important;
}

.main-header .phone-dropdown-menu li,
.main-header .phone-subdivision-item {
    min-width: 0 !important;
    max-width: 100% !important;
}

.main-header .phone-dropdown-menu .phone-division-link {
    display: inline-block !important;
    max-width: 100% !important;
    line-height: 1.28 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

.main-header .phone-dropdown-menu .phone-division-number {
    display: block !important;
    max-width: 100% !important;
    margin-top: 4px !important;
    white-space: normal !important;
}

.main-header .phone-subdivision-list {
    min-width: 0 !important;
    max-width: 100% !important;
}

@media (min-width: 992px) {
    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        right: 0 !important;
        left: auto !important;
        transform: none !important;
    }
}

@media (max-width: 575.98px) {
    .main-header .phone-dropdown-menu,
    .main-header .phone-dropdown-menu.show {
        width: auto !important;
        max-width: calc(100vw - 20px) !important;
    }
}
