:root {
    --home-bottom-navigation-height: 74px;
    --home-bottom-navigation-mobile-inset: 8px;
    --home-bottom-navigation-desktop-inset: 18px;
}

body:has(.home-bottom-navigation) {
    padding-block-end: calc(98px + env(safe-area-inset-bottom, 0px));
}

.home-bottom-navigation,
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation {
    box-sizing: border-box;
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(var(--home-bottom-navigation-desktop-inset) + env(safe-area-inset-bottom, 0px));
    z-index: 2200;
    width: min(840px, calc(100vw - 48px));
    min-height: var(--home-bottom-navigation-height);
    margin: 0;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    gap: 6px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 22px 48px rgba(15, 23, 42, 0.22),
        0 8px 18px rgba(124, 58, 237, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px) saturate(1.12);
    -webkit-backdrop-filter: blur(20px) saturate(1.12);
    transform: translateX(-50%);
}

.home-bottom-navigation__item,
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item {
    box-sizing: border-box;
    min-width: 0;
    min-height: 58px;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #475569;
    background: rgba(248, 250, 252, 0.74);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 140ms ease,
        color 140ms ease,
        background 140ms ease,
        box-shadow 140ms ease;
}

.home-bottom-navigation__icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    line-height: 1;
}

.home-bottom-navigation__label {
    min-width: 0;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-bottom-navigation__item:hover,
.home-bottom-navigation__item:focus-visible,
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item:hover,
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item:focus-visible {
    outline: 0;
    color: #1e293b;
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.1),
        inset 0 0 0 1px rgba(148, 163, 184, 0.18);
    transform: translateY(-1px);
}

.home-bottom-navigation__item:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.32);
    outline-offset: 2px;
}

.home-bottom-navigation__item[aria-selected="true"],
.home-bottom-navigation__item[aria-current="page"],
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item[aria-selected="true"],
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item[aria-current="page"] {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow:
        0 12px 24px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.home-bottom-navigation__item[aria-selected="true"]:hover,
.home-bottom-navigation__item[aria-selected="true"]:focus-visible,
.home-bottom-navigation__item[aria-current="page"]:hover,
.home-bottom-navigation__item[aria-current="page"]:focus-visible {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

[dir="rtl"] .home-bottom-navigation,
[dir="rtl"] #homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation {
    direction: rtl;
}

@media (max-width: 640px) {
    body:has(.home-bottom-navigation) {
        padding-block-end: calc(92px + env(safe-area-inset-bottom, 0px));
    }

    .home-bottom-navigation,
    #homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation {
        inset-inline-start: var(--home-bottom-navigation-mobile-inset);
        inset-inline-end: var(--home-bottom-navigation-mobile-inset);
        bottom: calc(var(--home-bottom-navigation-mobile-inset) + env(safe-area-inset-bottom, 0px));
        width: auto;
        min-height: 72px;
        padding: 6px;
        gap: 3px;
        border-radius: 24px;
        transform: none;
    }

    .home-bottom-navigation__item,
    #homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item {
        min-height: 58px;
        padding: 5px 2px;
        border-radius: 17px;
        flex-direction: column;
        gap: 3px;
        font-size: clamp(8.5px, 2.7vw, 11px);
        line-height: 1;
    }

    .home-bottom-navigation__icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;
        font-size: 18px;
    }

    .home-bottom-navigation__label {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .home-bottom-navigation,
    #homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation {
        inset-inline-start: 5px;
        inset-inline-end: 5px;
        gap: 2px;
        padding: 5px;
    }

    .home-bottom-navigation__item,
    #homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .home-bottom-navigation__item {
        padding-inline: 1px;
        font-size: 8.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-bottom-navigation__item {
        transition: none;
    }
}
