:root {
    --ng-footer-height: 76px;
    --ng-footer-safe-bottom: env(safe-area-inset-bottom, 0px);
    --ng-footer-icon-size: 27px;
}

body {
    padding-bottom: calc(var(--ng-footer-height) + var(--ng-footer-safe-bottom));
}

/*
 * Full-width bottom navigation inspired by the supplied reference.
 * Keep the existing 6 TuDao actions and markup.
 */
.ng-bottom-nav {
    position: fixed;
    z-index: 900;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    padding: 0 0 var(--ng-footer-safe-bottom);
    background: #ffffff;
    border: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -5px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(0);
    transition: transform 180ms ease;
    will-change: transform;
}

.ng-bottom-nav.is-hidden {
    transform: translateY(calc(100% + var(--ng-footer-safe-bottom)));
}

.ng-bottom-nav__inner {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
    max-width: none;
    height: var(--ng-footer-height);
    margin: 0;
    padding: 5px 0 4px;
    background: #ffffff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.ng-bottom-nav__item {
    position: relative;
    display: flex;
    min-width: 0;
    height: 100%;
    padding: 5px 2px 3px;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 4px;
    color: #222222;
    text-decoration: none;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ng-bottom-nav__bubble {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    margin: 0;
    padding: 0;
    color: #222222;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}

.ng-bottom-nav__bubble::before,
.ng-bottom-nav__bubble::after,
.ng-bottom-nav__item::before,
.ng-bottom-nav__item::after {
    content: none !important;
    display: none !important;
}

.ng-bottom-nav__bubble svg {
    display: block;
    width: var(--ng-footer-icon-size);
    height: var(--ng-footer-icon-size);
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ng-bottom-nav__label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto;
    max-width: calc(100% - 4px);
    margin: 0;
    padding: 2px 5px;
    overflow: hidden;
    color: #2f2f2f;
    background: transparent;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: none;
}

/* Active item like the reference: pink icon + pink pill label. */
.ng-bottom-nav__item.is-active .ng-bottom-nav__bubble {
    color: #222222;
}

.ng-bottom-nav__item.is-active .ng-bottom-nav__bubble svg {
    width: 29px;
    height: 29px;
    stroke-width: 2.2;
}

.ng-bottom-nav__item.is-active .ng-bottom-nav__label {
    color: #ffffff;
    background: var(--ng-accent);
    font-weight: 800;
    padding-right: 8px;
    padding-left: 8px;
}

.ng-bottom-nav__item:active {
    transform: scale(0.96);
}

.ng-bottom-nav__item:focus-visible {
    outline: none;
}

.ng-bottom-nav__item:focus-visible .ng-bottom-nav__bubble {
    outline: 2px solid var(--ng-accent);
    outline-offset: 2px;
    border-radius: 8px;
}

@media (max-width: 374px) {
    :root {
        --ng-footer-height: 72px;
        --ng-footer-icon-size: 24px;
    }

    .ng-bottom-nav__inner {
        padding-top: 4px;
        padding-bottom: 3px;
    }

    .ng-bottom-nav__item {
        gap: 3px;
        padding-right: 1px;
        padding-left: 1px;
    }

    .ng-bottom-nav__bubble {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .ng-bottom-nav__label {
        max-width: calc(100% - 2px);
        padding: 2px 4px;
        font-size: 9px;
    }

    .ng-bottom-nav__item.is-active .ng-bottom-nav__label {
        padding-right: 6px;
        padding-left: 6px;
    }
}

@media (min-width: 768px) {
    :root {
        --ng-footer-height: 82px;
        --ng-footer-icon-size: 29px;
    }

    .ng-bottom-nav__bubble {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .ng-bottom-nav__label {
        font-size: 11px;
    }
}

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