:root {
    --tabbar-h: 50px;
    --tabbar-safe: env(safe-area-inset-bottom, 0px);
}

body.has-tabbar {
    padding-bottom: calc(var(--tabbar-h) + var(--tabbar-safe));
}

.app-tabbar {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 200;
    width: 100%;
    max-width: 430px;
    height: calc(var(--tabbar-h) + var(--tabbar-safe));
    padding-bottom: var(--tabbar-safe);
    display: flex;
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .04);
}

.app-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 11px;
    -webkit-tap-highlight-color: transparent;
}

.app-tab-item.active {
    color: var(--color-accent);
}

.app-tab-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.app-tab-label {
    line-height: 1.2;
}

.app-tab-badge {
    position: absolute;
    top: -4px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--color-accent);
    color: #fff;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    display: none;
}

.app-tab-badge.show {
    display: block;
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tabbar-h) + var(--tabbar-safe) + 16px);
    transform: translateX(-50%);
    padding: 8px 20px;
    border-radius: 20px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font-size: 13px;
    z-index: 300;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    max-width: 80%;
    text-align: center;
}

.app-toast.show {
    opacity: 1;
}
