/* Mobile app shell: bottom tab bar, sheets, install prompts (shared by the campus and public layouts). */
:root {
    --a4u-app-navy: #15385f;
    --a4u-app-orange: #ff5a0a;
    --a4u-safe-bottom: env(safe-area-inset-bottom, 0px);
    --a4u-tabbar-h: 0px;
}

[data-a4u-install][hidden],
[data-a4u-install-banner][hidden],
.a4u-sheet[hidden] {
    display: none !important;
}

.a4u-tabbar,
.a4u-site-header__app-actions {
    display: none;
}

/* Page loading bar: standalone apps have no browser spinner. */
.a4u-nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 0;
    height: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(90deg, #ff5a0a, #ffb347);
    opacity: 0;
    pointer-events: none;
}

.a4u-navigating .a4u-nav-progress {
    opacity: 1;
    animation: a4u-progress 6s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

@keyframes a4u-progress {
    0% { width: 0; }
    15% { width: 45%; }
    100% { width: 92%; }
}

/* Bottom sheets */
body.a4u-sheet-open {
    overflow: hidden;
}

.a4u-sheet {
    position: fixed;
    inset: 0;
    z-index: 1090;
}

.a4u-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(8 26 48 / 45%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.a4u-sheet__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 88vh;
    max-height: 88dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 24px 24px 0 0;
    background: #fff;
    padding: 8px 16px calc(18px + var(--a4u-safe-bottom));
    box-shadow: 0 -12px 40px rgb(8 26 48 / 18%);
    font-family: inherit;
    transform: translateY(105%);
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.a4u-sheet__panel--top {
    top: 0;
    bottom: auto;
    border-radius: 0 0 24px 24px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px 18px;
    transform: translateY(-105%);
}

.a4u-sheet.is-open .a4u-sheet__backdrop {
    opacity: 1;
}

.a4u-sheet.is-open .a4u-sheet__panel {
    transform: none;
}

@media (min-width: 640px) {
    .a4u-sheet__panel {
        right: auto;
        bottom: 24px;
        left: 50%;
        width: 440px;
        margin-left: -220px;
        border-radius: 24px;
    }

    .a4u-sheet__panel--top {
        top: 24px;
        bottom: auto;
        width: 560px;
        margin-left: -280px;
    }
}

.a4u-sheet__grabber {
    display: block;
    width: 40px;
    height: 5px;
    margin: 2px auto 12px;
    border-radius: 999px;
    background: #d5dbe3;
}

.a4u-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.a4u-sheet__head strong {
    color: var(--a4u-app-navy);
    font-size: 17px;
    font-weight: 800;
}

.a4u-sheet__close {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f1f4f8;
    color: #475569;
    cursor: pointer;
}

.a4u-sheet__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 6px;
}

.a4u-sheet__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    color: #1e293b !important;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none !important;
}

.a4u-sheet__tile:active .a4u-sheet__icon {
    transform: scale(0.92);
}

.a4u-sheet__icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 17px;
    font-size: 20px;
    transition: transform 0.12s ease;
}

.a4u-sheet__icon.is-blue { background: #e8f0fe; color: #2563eb; }
.a4u-sheet__icon.is-amber { background: #fff4e0; color: #d97706; }
.a4u-sheet__icon.is-violet { background: #f1ecff; color: #7c3aed; }
.a4u-sheet__icon.is-rose { background: #ffe9ef; color: #e11d48; }
.a4u-sheet__icon.is-teal { background: #e0f7f4; color: #0d9488; }
.a4u-sheet__icon.is-red { background: #ffe9e6; color: #dc2626; }
.a4u-sheet__icon.is-sky { background: #e3f4fd; color: #0284c7; }
.a4u-sheet__icon.is-orange { background: #fff0e6; color: #ff5a0a; }
.a4u-sheet__icon.is-slate { background: #eef1f5; color: #475569; }
.a4u-sheet__icon.is-green { background: #e6f7ec; color: #16a34a; }

.a4u-sheet__actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.a4u-sheet__action {
    display: flex;
    height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    background: #f1f4f8;
    color: var(--a4u-app-navy) !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
}

.a4u-sheet__action.is-wa {
    background: #e7f8ee;
    color: #128c4a !important;
}

.a4u-sheet__install {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    border: 1px dashed #ffb48a;
    border-radius: 16px;
    background: #fff7f2;
    padding: 10px 14px;
    color: var(--a4u-app-navy);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.a4u-sheet__install img {
    border-radius: 11px;
}

.a4u-sheet__install span {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.a4u-sheet__install strong {
    font-size: 14px;
}

.a4u-sheet__install small {
    color: #64748b;
    font-size: 12px;
}

.a4u-sheet__install > i {
    color: var(--a4u-app-orange);
}

/* Search sheet */
.a4u-search__tabs {
    display: inline-flex;
    margin-bottom: 12px;
    border-radius: 12px;
    background: #f1f4f8;
    padding: 3px;
}

.a4u-search__tabs button {
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 7px 16px;
    color: #64748b;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.a4u-search__tabs .is-active {
    background: #fff;
    color: var(--a4u-app-navy);
    box-shadow: 0 1px 4px rgb(0 0 0 / 10%);
}

.a4u-search__field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.a4u-search__field > i,
.a4u-search__field > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.a4u-search__field input {
    width: 100%;
    min-width: 0;
    height: 48px;
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    padding: 0 14px 0 40px;
    color: #0f172a;
    font: inherit;
    font-size: 16px;
    outline: none;
}

.a4u-search__field input:focus {
    border-color: var(--a4u-app-orange);
    background: #fff;
}

.a4u-search__field button {
    border: 0;
    background: none;
    padding: 0;
    color: var(--a4u-app-orange);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.a4u-search__chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.a4u-search__chips span {
    width: 100%;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.a4u-search__chips a {
    border-radius: 999px;
    background: #f1f4f8;
    padding: 7px 13px;
    color: var(--a4u-app-navy) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
}

/* Install banner (Android prompt / iOS hint) */
.a4u-install-open .whatsapp-float,
.a4u-install-open .a4u-float-wa,
.a4u-install-open .chatbot-widget,
.a4u-install-open .a4u-float-chat {
    opacity: 0;
    pointer-events: none;
}

.a4u-install-banner {
    position: fixed;
    right: 12px;
    bottom: calc(var(--a4u-tabbar-h) + 12px);
    left: 12px;
    z-index: 1050;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #eef1f5;
    border-radius: 18px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 14px 40px rgb(8 26 48 / 22%);
    font-family: inherit;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.a4u-install-banner.is-open {
    opacity: 1;
    transform: none;
}

@media (min-width: 640px) {
    .a4u-install-banner {
        right: 24px;
        bottom: calc(var(--a4u-tabbar-h) + 24px);
        left: auto;
        width: 400px;
    }
}

@media (min-width: 992px) {
    .has-announce-bar .a4u-install-banner {
        bottom: 64px;
    }
}

.a4u-install-banner img {
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(8 26 48 / 12%);
}

.a4u-install-banner__text {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.a4u-install-banner__text strong {
    color: var(--a4u-app-navy);
    font-size: 14px;
}

.a4u-install-banner__text small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.3;
}

.a4u-install-banner__btn {
    border: 0;
    border-radius: 12px;
    background: var(--a4u-app-orange);
    padding: 9px 16px;
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.a4u-install-banner__close {
    display: grid;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    place-items: center;
    border: 0;
    background: none;
    color: #94a3b8;
    cursor: pointer;
}

/* iOS "Add to Home Screen" steps */
.a4u-ios {
    padding: 4px 4px 0;
    text-align: center;
}

.a4u-ios img {
    border-radius: 16px;
    box-shadow: 0 6px 18px rgb(8 26 48 / 14%);
}

.a4u-ios > strong {
    display: block;
    margin-top: 12px;
    color: var(--a4u-app-navy);
    font-size: 18px;
}

.a4u-ios p {
    margin: 6px 0 16px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.a4u-ios ol {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.a4u-ios li {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    background: #f8fafc;
    padding: 12px;
    color: #1e293b;
    font-size: 14px;
}

.a4u-ios__step {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--a4u-app-orange);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.a4u-ios__share {
    display: inline-block;
    width: 20px;
    height: 20px;
    color: #007aff;
    vertical-align: -4px;
}

.a4u-ios__done {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 14px;
    background: var(--a4u-app-navy);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.a4u-site-header__install {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 5px;
    border: 1px dashed #ffb48a;
    border-radius: 8px;
    background: #fff7f2;
    padding: 11px 12px;
    color: #15385f;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.a4u-site-header__install i {
    width: 16px;
    color: #ff5a0a;
}

/* App layout on phones and small tablets */
@media (max-width: 991.98px) {
    :root {
        --a4u-tabbar-h: calc(64px + var(--a4u-safe-bottom));
        --a4u-header-stick: 61px;
    }

    html {
        -webkit-tap-highlight-color: transparent;
    }

    body,
    body.has-announce-bar {
        padding-bottom: var(--a4u-tabbar-h) !important;
    }

    .a4u-tabbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1045;
        display: grid;
        height: var(--a4u-tabbar-h);
        grid-template-columns: repeat(5, minmax(0, 1fr));
        border-top: 1px solid #e8ecf2;
        background: rgb(255 255 255 / 96%);
        padding-bottom: var(--a4u-safe-bottom);
        box-shadow: 0 -6px 24px rgb(8 26 48 / 8%);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
    }

    .a4u-tabbar__item,
    .a4u-tabbar__apply {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border: 0;
        background: none;
        padding: 0;
        color: #7b8798 !important;
        font: inherit;
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1;
        text-decoration: none !important;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
    }

    .a4u-tabbar__item > i,
    .a4u-tabbar__item > svg {
        height: 21px;
        font-size: 19px;
        line-height: 21px;
        transition: transform 0.15s ease;
    }

    .a4u-tabbar__item:active > i,
    .a4u-tabbar__item:active > svg {
        transform: scale(0.86);
    }

    .a4u-tabbar__item[aria-current="page"] {
        color: var(--a4u-app-orange) !important;
        font-weight: 700;
    }

    .a4u-tabbar__item[aria-current="page"]::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 28px;
        height: 3px;
        margin-left: -14px;
        border-radius: 0 0 4px 4px;
        background: var(--a4u-app-orange);
    }

    .a4u-tabbar__apply {
        color: var(--a4u-app-navy) !important;
        font-weight: 700;
    }

    .a4u-tabbar__fab {
        display: grid;
        width: 54px;
        height: 54px;
        margin-top: -24px;
        place-items: center;
        border: 4px solid #fff;
        border-radius: 50%;
        background: linear-gradient(135deg, #ff7a2f, #ff5a0a);
        color: #fff;
        font-size: 18px;
        box-shadow: 0 8px 20px rgb(255 90 10 / 40%);
        transition: transform 0.15s ease;
    }

    .a4u-tabbar__apply:active .a4u-tabbar__fab {
        transform: scale(0.9);
    }

    /* Compact app header */
    .a4u-site-header {
        box-shadow: 0 1px 0 #edf0f4, 0 6px 18px rgb(8 26 48 / 6%);
    }

    .a4u-site-header__main-inner {
        min-height: 60px !important;
    }

    .a4u-site-header__brand img {
        height: 40px !important;
        max-width: 134px !important;
    }

    .a4u-site-header__mobile-apply,
    .a4u-site-header__mobile-menu {
        display: none !important;
    }

    .a4u-site-header__app-actions {
        display: flex;
        gap: 8px;
        margin-left: auto;
    }

    .a4u-site-header__app-btn {
        display: grid;
        width: 40px;
        height: 40px;
        place-items: center;
        border: 0;
        border-radius: 12px;
        background: #f3f6fa;
        color: var(--a4u-app-navy) !important;
        font-size: 16px;
        text-decoration: none !important;
        cursor: pointer;
    }

    .a4u-site-header__app-btn:active {
        background: #fff0e6;
        color: var(--a4u-app-orange) !important;
    }

    /* The tab bar replaces these on phones. */
    .announce-ticker,
    .enquire-side-tab,
    .a4u-enquire-tab,
    .a4u-footer__top {
        display: none !important;
    }

    .whatsapp-float,
    .a4u-float-wa {
        bottom: calc(var(--a4u-tabbar-h) + 14px) !important;
        left: 14px !important;
        width: 48px !important;
        height: 48px !important;
        font-size: 1.45rem;
    }

    .chatbot-widget,
    .a4u-float-chat {
        right: 14px !important;
        bottom: calc(var(--a4u-tabbar-h) + 14px) !important;
    }

    .chatbot-launcher,
    .a4u-float-chat > button {
        width: 48px !important;
        height: 48px !important;
    }

    .a4u-above-tabbar {
        bottom: calc(var(--a4u-tabbar-h) + 10px) !important;
    }
}

/* Compact, app-style page heroes on phones */
@media (max-width: 767.98px) {
    .home-search-hero {
        min-height: 0;
        overflow: hidden;
        border-radius: 0 0 26px 26px;
    }

    .home-search-hero .container {
        padding-top: 1.6rem;
        padding-bottom: 1.4rem;
    }

    .home-search-hero-title {
        margin-bottom: 0.5rem;
        font-size: 1.6rem;
    }

    .home-search-hero-sub {
        margin-bottom: 1.1rem;
        font-size: 0.88rem;
    }

    .home-hero-search {
        border-radius: 16px;
    }

    .home-hero-search input {
        padding: 0.85rem 1rem;
        font-size: 16px;
    }

    .home-hero-search button {
        padding: 0 1.1rem;
    }

    .home-hero-counselling,
    .online-hero-counselling {
        display: none;
    }

    .online-search-hero {
        min-height: 0;
        overflow: hidden;
        border-radius: 0 0 26px 26px;
    }

    .online-search-hero-inner {
        padding: 1.5rem 1rem 1.4rem;
    }

    .online-search-hero-title {
        margin-bottom: 0.5rem;
        font-size: 1.55rem;
    }

    .online-search-hero-sub {
        margin-bottom: 1.1rem;
        font-size: 0.88rem;
    }

    .online-hero-pills {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-right: -1rem;
        margin-left: -1rem;
        overflow-x: auto;
        padding: 0 1rem 2px;
        scrollbar-width: none;
    }

    .online-hero-pills::-webkit-scrollbar {
        display: none;
    }

    .online-hero-pill {
        flex: 0 0 auto;
    }

    .home-top-links,
    .a4u-page-hero__links,
    .a4u-page-hero__links--stack {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .home-top-links::-webkit-scrollbar,
    .a4u-page-hero__links::-webkit-scrollbar {
        display: none;
    }

    .home-top-links {
        margin: 1rem -12px 0;
        padding: 0 12px 2px;
    }

    .home-top-link-pill {
        flex: 0 0 auto;
    }

    .a4u-page-hero {
        overflow: hidden;
        border-radius: 0 0 26px 26px;
    }

    .a4u-page-hero__inner {
        padding: 1.1rem 1rem 1.4rem;
    }

    .a4u-page-hero__crumbs {
        margin-bottom: 0.6rem;
        font-size: 0.75rem;
    }

    .a4u-page-hero__badge {
        margin-bottom: 0.55rem;
        padding: 0.3rem 0.75rem;
        font-size: 0.72rem;
    }

    .a4u-page-hero__title {
        margin-bottom: 0.45rem;
        font-size: 1.5rem;
    }

    .a4u-page-hero__sub {
        display: -webkit-box;
        overflow: hidden;
        font-size: 0.86rem;
        line-height: 1.5;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .a4u-page-hero__filters {
        margin-top: 1rem;
    }

    .a4u-page-hero__select,
    .a4u-page-hero__search,
    .a4u-page-hero__submit {
        height: 46px;
        border-radius: 12px;
    }

    .a4u-page-hero__search input {
        font-size: 16px;
    }

    .a4u-page-hero__stats {
        flex-wrap: nowrap;
        gap: 0.45rem;
        margin-top: 1rem;
    }

    .a4u-page-hero__stats div {
        min-width: 0;
        flex: 1 1 0;
        border-radius: 0.8rem;
        padding: 0.55rem 0.3rem;
    }

    .a4u-page-hero__stats dt {
        font-size: 1.05rem;
    }

    .a4u-page-hero__stats dd {
        font-size: 0.62rem;
    }

    .a4u-page-hero__perks {
        display: none;
    }

    .a4u-page-hero__links,
    .a4u-page-hero__links--stack {
        margin: 1rem -1rem 0;
        padding: 0 1rem;
    }

    .a4u-page-hero__links .a4u-page-hero__link,
    .a4u-page-hero__links--stack .a4u-page-hero__link {
        width: auto;
        flex: 0 0 auto;
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
    }
}
