.bottom-nav,
.bottom-nav-sheet {
    display: none;
}

@media (max-width: 768px) {
    :root {
        --bottom-nav-bar-h: 62px;
        --bottom-nav-h: calc(var(--bottom-nav-bar-h) + env(safe-area-inset-bottom, 0px));
    }

    body {
        padding-bottom: var(--bottom-nav-h);
    }

    body.bottom-nav-sheet-open {
        overflow: hidden;
        touch-action: none;
    }

    .sidebar,
    .sidebar-backdrop {
        display: none !important;
    }

    .menu-toggle {
        display: none !important;
    }

    .mobile-navbar-content {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 8px;
    }

    .mobile-navbar-spacer {
        display: none;
    }

    .logo-container-mobile {
        grid-column: 1;
        justify-self: start;
    }

    .mobile-actions {
        grid-column: 2;
        justify-self: end;
    }

    .bottom-nav {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1002;
        background: var(--star-navbar-bg);
        border-top: 1px solid var(--star-border-color);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.18);
    }

    .bottom-nav__bar {
        display: flex;
        justify-content: space-around;
        align-items: flex-end;
        padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        min-height: var(--bottom-nav-bar-h);
    }

    .bottom-nav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        width: 100%;
        max-width: 72px;
        min-height: 44px;
        padding: 4px 2px 2px;
        border: none;
        border-radius: 10px;
        background: transparent;
        font: inherit;
        text-decoration: none;
        color: var(--star-onemsiz-text-color);
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav__link i {
        font-size: 17px;
        line-height: 1;
        color: inherit;
    }

    .bottom-nav__text {
        font-size: 10px;
        font-weight: 500;
        line-height: 1.1;
        text-align: center;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .bottom-nav__link.is-active {
        color: var(--star-button-background-color);
        background: rgba(var(--primary-rgb), 0.1);
    }

    .bottom-nav__fab.is-active {
        border-color: rgba(var(--primary-rgb), 0.55);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 2px var(--star-button-background-color);
    }

    .bottom-nav__link--trigger[aria-expanded="true"] {
        color: var(--star-button-background-color);
        background: rgba(var(--primary-rgb), 0.12);
    }

    .bottom-nav__link:active {
        background: rgba(var(--primary-rgb), 0.16);
    }

    .bottom-nav__fab {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        margin-bottom: 6px;
        border-radius: 14px;
        background: var(--star-card-background-color);
        border: 2px solid var(--star-border-color);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav__fab img {
        width: 34px;
        height: 34px;
        object-fit: contain;
        border-radius: 8px;
    }

    .bottom-nav-sheet {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1003;
        pointer-events: none;
        visibility: hidden;
        transition: visibility 0.28s step-end;
    }

    .bottom-nav-sheet.is-open {
        pointer-events: auto;
        visibility: visible;
        transition: visibility 0s step-start;
    }

    .bottom-nav-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.48);
        opacity: 0;
        transition: opacity 0.26s ease;
    }

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

    .bottom-nav-sheet__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: min(82vh, 560px);
        margin-bottom: var(--bottom-nav-h);
        background: var(--star-card-background-color);
        border: 1px solid var(--star-border-color);
        border-bottom: none;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
        transform: translate3d(0, 105%, 0);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .bottom-nav-sheet.is-open .bottom-nav-sheet__panel {
        transform: translate3d(0, 0, 0);
    }

    .bottom-nav-sheet__head {
        position: relative;
        flex-shrink: 0;
        padding: 16px 12px 10px;
        border-bottom: 1px solid var(--star-border-color);
    }

    .bottom-nav-sheet__handle {
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.2);
        pointer-events: none;
    }

    .bottom-nav-sheet__title {
        margin: 8px 44px 0;
        font-size: 1rem;
        font-weight: 700;
        color: var(--star-normal-text-color);
        text-align: center;
    }

    .bottom-nav-sheet__x {
        position: absolute;
        right: 10px;
        top: 18px;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 10px;
        background: rgba(var(--primary-rgb), 0.08);
        color: var(--star-onemli-text-color);
        cursor: pointer;
        transition: background-color 0.18s ease;
    }

    .bottom-nav-sheet__x:active {
        background: rgba(var(--primary-rgb), 0.18);
    }

    .bottom-nav-sheet__scroll {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 12px 14px 18px;
        -webkit-overflow-scrolling: touch;
    }

    .bottom-nav-sheet__group {
        border: 1px solid var(--star-border-color);
        border-radius: 14px;
        margin-bottom: 10px;
        background: rgba(0, 0, 0, 0.12);
        overflow: hidden;
    }

    .bottom-nav-sheet__summary {
        list-style: none;
        cursor: pointer;
        padding: 12px 14px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--star-onemsiz-text-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        user-select: none;
        transition: background-color 0.18s ease;
    }

    .bottom-nav-sheet__summary::-webkit-details-marker {
        display: none;
    }

    .bottom-nav-sheet__summary::after {
        content: "";
        width: 8px;
        height: 8px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        transition: transform 0.22s ease;
        opacity: 0.7;
    }

    .bottom-nav-sheet__group[open] .bottom-nav-sheet__summary::after {
        transform: rotate(-135deg);
        margin-top: 4px;
    }

    .bottom-nav-sheet__group[open] .bottom-nav-sheet__summary {
        border-bottom: 1px solid var(--star-border-color);
    }

    .bottom-nav-sheet__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .bottom-nav-sheet__tile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 88px;
        padding: 12px 8px;
        border-radius: 14px;
        text-decoration: none;
        text-align: center;
        color: var(--star-normal-text-color);
        background: var(--star-navbar-bg);
        border: 1px solid var(--star-border-color);
        transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .bottom-nav-sheet__tile i {
        font-size: 22px;
        color: var(--star-button-background-color);
    }

    .bottom-nav-sheet__tile span {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.25;
    }

    .bottom-nav-sheet__tile.is-active {
        border-color: rgba(var(--primary-rgb), 0.45);
        background: rgba(var(--primary-rgb), 0.12);
        color: var(--star-onemli-text-color);
    }

    .bottom-nav-sheet__tile:active {
        background: rgba(var(--primary-rgb), 0.16);
    }
}

@media (max-width: 768px) and (min-width: 380px) {
    .bottom-nav-sheet__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
