html {
    scroll-padding-top: 128px;
}

[data-site-header] {
    position: sticky;
    top: 0;
    z-index: 500;
    isolation: isolate;
}

.site-header,
.home-page .site-header,
body[data-home] .site-header {
    position: relative !important;
    inset: auto !important;
    z-index: auto !important;
    background: rgba(255, 255, 255, .97) !important;
    border-bottom: 1px solid rgba(15, 45, 55, .1) !important;
    box-shadow: 0 8px 28px rgba(15, 35, 48, .07) !important;
    backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

/* Shared institutional information bar, directly above the shared navbar. */
#top-bar.premium-topbar,
body[data-home] #top-bar.premium-topbar {
    display: block !important;
    width: 100%;
    min-height: 40px;
    overflow: hidden;
    color: #f5f8f7;
    background: linear-gradient(105deg, #092d3a 0%, #0d4952 58%, #123b4c 100%);
    border-bottom: 1px solid rgba(210, 177, 104, .55);
    font-size: 11px;
    line-height: 1.35;
}

.epi-info-viewport { width: min(1760px, calc(100% - clamp(32px, 5vw, 88px))); margin-inline: auto; overflow: hidden; }
.epi-info-track { display: flex; width: max-content; min-height: 40px; align-items: center; }
.epi-info-set { display: flex; flex: 0 0 auto; align-items: center; white-space: nowrap; }
.epi-info-item, .premium-topbar .epi-info-item { display: inline-flex; align-items: center; min-height: 18px; padding: 0 12px; color: inherit; font-size: inherit; text-decoration: none; }
.epi-info-item + .epi-info-item { border-left: 1px solid rgba(255,255,255,.22); }
.epi-info-item::before { display: inline-block; margin-right: 7px; color: #d8b56e; font-size: 11px; font-weight: 700; }
.epi-info-approval::before { content: "◆"; font-size: 8px; }
.epi-info-affiliation::before { content: "▤"; }
.epi-info-codes::before { content: "⌑"; }
.epi-info-phone::before { content: "☎"; }
.epi-info-email::before { content: "✉"; }
.epi-info-office::before { content: "↗"; }
.epi-info-item:is(a):hover, .epi-info-item:is(a):focus-visible { color: #f1cf83; }
.epi-info-set-copy { display: none; }

@media (min-width: 1281px) and (max-width: 1500px) {
    #top-bar.premium-topbar, body[data-home] #top-bar.premium-topbar { font-size: 9.7px; }
    .epi-info-viewport { width: 100%; }
    .epi-info-item { padding-inline: 0; }
    .epi-info-item::before { margin-right: 3px; }
}

@media (max-width: 1280px) {
    #top-bar.premium-topbar, body[data-home] #top-bar { display: block !important; min-height: 38px; }
    .epi-info-viewport { width: 100%; }
    .epi-info-track { min-height: 38px; animation: epi-info-marquee 38s linear infinite; }
    .epi-info-set-copy { display: flex; }
    #top-bar.premium-topbar:hover .epi-info-track,
    #top-bar.premium-topbar:focus-within .epi-info-track { animation-play-state: paused; }
}

@keyframes epi-info-marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .epi-info-track { animation: none !important; } }

@media (max-width: 600px) {
    #top-bar.premium-topbar, body[data-home] #top-bar { display: block !important; min-height: 36px; font-size: 10px; }
    .epi-info-track { min-height: 36px; animation-duration: 32s; }
    .epi-info-item { padding-inline: 10px; }
}

.navbar,
.home-page .navbar,
body[data-home] .navbar {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) auto;
    grid-template-rows: minmax(70px, auto);
    align-items: center;
    width: min(1760px, calc(100% - clamp(32px, 5vw, 88px))) !important;
    min-width: 0;
    min-height: 70px !important;
    height: auto !important;
    margin-inline: auto;
    padding: 7px 0 !important;
    gap: 0 clamp(10px, 1.2vw, 20px) !important;
}

.navbar > .brand {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: initial;
    align-items: center;
    gap: 10px;
    color: #102a38;
    text-decoration: none;
}

.navbar > .brand img {
    flex: 0 0 54px;
    width: 54px !important;
    height: 54px !important;
    padding: 3px;
    object-fit: contain;
    border: 1px solid rgba(15, 45, 55, .12);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(15, 35, 48, .1);
}

.navbar > .brand > span {
    display: grid !important;
    min-width: 0;
    gap: 2px;
}

.navbar > .brand small {
    display: block;
    color: #657783;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .025em;
    overflow-wrap: anywhere;
}

.navbar > .brand strong {
    display: block;
    color: #102a38;
    font-size: clamp(13px, 1.06vw, 16px);
    font-weight: 850;
    line-height: 1.13;
    letter-spacing: -.015em;
    overflow-wrap: anywhere;
}

.navbar > .brand em {
    display: block;
    color: #0c716d;
    font-size: 9px;
    font-style: normal;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: .015em;
    overflow-wrap: anywhere;
}

.navbar > .nav-links {
    position: static !important;
    z-index: auto;
    grid-column: 2;
    grid-row: 1;
    display: flex !important;
    width: 100%;
    min-width: 0;
    max-height: none;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: visible;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    opacity: 1;
    visibility: visible;
}

.navbar > .nav-links:not(.open) {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.navbar > .nav-links li {
    min-width: 0;
    flex: 0 1 auto;
}

.navbar > .nav-links .nav-admission-link { display: none; }

.navbar > .nav-links a {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 7px clamp(3px, .38vw, 7px);
    border-radius: 7px;
    color: #213746;
    font-size: clamp(10.5px, .82vw, 12px);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: color .18s ease, background .18s ease;
}

.navbar > .nav-links a:hover,
.navbar > .nav-links a.active {
    color: #086b66 !important;
    background: #eef7f5 !important;
}

.nav-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    min-width: 0;
    align-items: center;
    justify-self: end;
    gap: 8px;
}

.navbar .nav-apply {
    display: inline-flex !important;
    flex: 0 0 auto;
    min-width: 112px;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #c4a44e !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #d8bb68, #efd98e) !important;
    color: #122d39 !important;
    box-shadow: 0 5px 14px rgba(174, 139, 50, .18) !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
}

.navbar .nav-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(174, 139, 50, .24) !important;
}

.navbar .nav-ai-slot {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
}

.navbar .nav-ai-slot .ask-ai-nav {
    display: inline-flex !important;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 4px 10px 4px 5px;
    border: 1px solid rgba(12, 91, 94, .2);
    border-radius: 8px;
    background: #fff;
    color: #123b48;
    box-shadow: 0 3px 10px rgba(15, 35, 48, .06);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.navbar .nav-ai-slot .ask-ai-nav:hover {
    border-color: rgba(9, 112, 105, .45);
    background: #f1f8f7;
    color: #086b66;
}

.navbar .nav-ai-slot .ask-ai-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    overflow: hidden;
    border: 1px solid rgba(15, 45, 55, .12);
    border-radius: 50%;
    background: #fff;
}

.navbar .nav-ai-slot .ask-ai-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.navbar .nav-toggle {
    display: none !important;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(16, 42, 56, .15);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.navbar .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0;
    border-radius: 2px;
    background: #123b48;
    transition: transform .2s ease, opacity .2s ease;
}

.navbar .nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.navbar .nav-toggle.open span:nth-child(2) { opacity: 0; }
.navbar .nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.navbar > .nav-links a:focus-visible,
.navbar .nav-actions a:focus-visible,
.navbar .nav-actions button:focus-visible {
    outline: 3px solid rgba(10, 126, 117, .3);
    outline-offset: 2px;
}

@media (max-width: 1280px) {
    .navbar,
    .home-page .navbar,
    body[data-home] .navbar {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: minmax(64px, auto);
        gap: 0 12px !important;
    }

    .navbar > .nav-links {
        position: absolute !important;
        z-index: 520;
        grid-column: 1 / -1;
        grid-row: 1;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        box-sizing: border-box;
        display: none !important;
        width: 100%;
        max-height: min(72vh, 560px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        justify-content: stretch;
        gap: 4px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        padding: 10px;
        border: 1px solid rgba(16, 42, 56, .13);
        border-radius: 12px;
        background: rgba(255, 255, 255, .99);
        box-shadow: 0 18px 44px rgba(15, 35, 48, .16);
    }

    .navbar > .nav-links.open {
        display: grid !important;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        isolation: isolate;
    }

    .navbar > .nav-links:not(.open) {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .navbar > .nav-links a {
        min-height: 46px;
        justify-content: flex-start;
        padding: 10px 12px;
        font-size: 13px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .navbar > .nav-links .nav-admission-link { display: block; }

    .nav-actions {
        grid-column: 2;
        grid-row: 1;
        gap: 7px;
    }

    .navbar .nav-toggle { display: inline-flex !important; }
}

@media (max-width: 600px) {
    .navbar,
    .home-page .navbar,
    body[data-home] .navbar {
        width: calc(100% - 28px) !important;
        min-height: 62px !important;
        grid-template-rows: minmax(62px, auto);
        gap: 0 8px !important;
        padding-block: 5px !important;
    }

    .navbar > .brand { gap: 8px; }
    .navbar > .brand img { flex-basis: 42px; width: 42px !important; height: 42px !important; border-radius: 10px; }
    .navbar > .brand small { display: none; }
    .navbar > .brand strong { font-size: 13px; line-height: 1.1; }
    .navbar > .brand em,
    .home-page .navbar > .brand em,
    body[data-home] .navbar > .brand em { display: block !important; font-size: 8px; line-height: 1.15; }
    .nav-actions { gap: 5px; }
    .navbar .nav-apply { display: none !important; }
    .navbar .nav-ai-slot .ask-ai-nav { width: 40px; min-width: 40px; height: 40px; padding: 4px; }
    .navbar .nav-ai-slot .ask-ai-nav > span:last-child { display: none; }
    .navbar .nav-ai-slot .ask-ai-mark { width: 30px; height: 30px; flex-basis: 30px; }
    .navbar .nav-toggle { flex-basis: 40px; width: 40px; height: 40px; }
    .navbar > .nav-links { grid-template-columns: 1fr; max-height: min(72vh, 520px); }
}
