.app-shell {
    width: 100%;
    max-width: var(--max-width);
    min-height: 100vh;
    margin: 0 auto;
    padding: 6px 12px calc(100px + var(--safe-bottom));
}

.topbar {
    padding: 4px 2px 0;
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px 3px;
}

.topbar__brand-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    color: #0f172a;
}

.topbar__logo {
    width: auto;
    height: 40px;
    object-fit: contain;
}

.topbar__brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.topbar__brand-title {
    font-size: 19px;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.topbar__brand-sub {
    display: none;
}

.topbar__badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(89, 104, 255, 0.08);
    border: 1px solid rgba(89, 104, 255, 0.16);
    color: #4f46e5;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.tab-app {
    position: relative;
    overflow: hidden;
    min-height: 60vh;
}

.tab-screen {
    opacity: 1;
}

.section-block {
    margin-top: 18px;
}

.section-block--tight {
    margin-top: 4px;
}

.section-head {
    margin-bottom: 10px;
    padding: 0 2px;
}

.section-head--spaced {
    margin-top: 10px;
}

.section-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-caption {
    margin: 5px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-sub);
}

.card-list {
    display: grid;
    gap: 12px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.site-footer {
    margin-top: 24px;
    padding: 20px 4px 6px;
    text-align: center;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.site-footer__links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.04);
    font-size: 12px;
    font-weight: 800;
    color: #475467;
}

.site-footer__copy {
    margin-top: 12px;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1.6;
    color: #6b7280;
    text-align: center;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 100;
    width: 100%;
    max-width: var(--max-width);
    padding: 10px 10px calc(10px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: linear-gradient(to top, rgba(243, 245, 249, 0.98), rgba(243, 245, 249, 0.88));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bottom-nav::before {
    content: "";
    position: absolute;
    inset: 10px 10px calc(10px + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 22px;
    box-shadow: 0 -8px 26px rgba(17, 24, 39, 0.05);
    z-index: -1;
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    border-radius: 16px;
    color: #6b7280;
    transition:
        transform var(--transition-fast),
        background-color var(--transition-fast),
        color var(--transition-fast);
}

.bottom-nav__item.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.bottom-nav__item:focus-visible {
    outline: 2px solid rgba(91, 92, 240, 0.45);
    outline-offset: 2px;
}

.bottom-nav__icon {
    font-size: 14px;
    line-height: 1;
}

.bottom-nav__label {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 800;
}

@media (min-width: 768px) {
    .app-shell {
        padding: 10px 18px calc(108px + var(--safe-bottom));
    }

    .card-list {
        grid-template-columns: 1fr 1fr;
    }

    .topbar__logo {
        height: 44px;
    }
}

@media (max-width: 420px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .topbar__brand-link {
        gap: 5px;
    }

    .topbar__logo {
        height: 38px;
    }

    .topbar__brand-title {
        font-size: 18px;
    }

    .topbar__badge {
        min-height: 26px;
        padding: 0 8px;
        font-size: 10px;
    }
}
