:root {
    --app-purple: #3f36c5;
    --app-purple-dark: #352db4;
    --app-surface: #ffffff;
    --app-background: #f7f7fa;
    --app-text: #23252b;
    --app-text-muted: #727b8d;
    --app-border: #d8d8df;
    --app-shadow: 0 3px 16px rgba(22, 27, 45, 0.12);
    --app-bottom-nav-height: 92px;
    --page-max-width: 392px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--app-background);
    color: var(--app-text);
    font-family: "Barlow", sans-serif;
}

html.auth-pending body {
    visibility: hidden;
}

body {
    user-select: none;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
    background: transparent;
    color: inherit;
}

.app-page {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--app-purple);
    box-shadow: 0 3px 12px rgba(34, 39, 77, 0.15);
}

.app-header__bar {
    width: min(100%, var(--page-max-width));
    min-height: 82px;
    margin: 0 auto;
    padding: 20px 16px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
}

.app-header__icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
}

.app-header__icon-btn svg {
    width: 26px;
    height: 26px;
}

.app-header__icon-btn--ghost {
    pointer-events: none;
}

.app-header__title {
    margin: 0;
    flex: 1;
    font-size: 24px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.page-content {
    width: min(100%, var(--page-max-width));
    margin: 0 auto;
    padding: 14px 12px calc(var(--app-bottom-nav-height) + 20px);
}

.page-content--tight {
    padding-top: 16px;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 30;
    width: min(100%, var(--page-max-width));
    height: var(--app-bottom-nav-height);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    align-items: start;
    padding: 8px 10px 14px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(25, 31, 55, 0.08);
    box-shadow: 0 -3px 10px rgba(28, 33, 56, 0.08);
}

.bottom-nav__item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 0 0;
    color: #6f7078;
    cursor: pointer;
}

.bottom-nav__item--active {
    color: var(--app-purple);
}

.bottom-nav__icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bottom-nav__icon svg {
    width: 26px;
    height: 26px;
}

.bottom-nav__item span:last-child {
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--app-bottom-nav-height) + 12px);
    transform: translate(-50%, 24px);
    z-index: 50;
    min-width: 240px;
    max-width: calc(100vw - 32px);
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(20, 21, 28, 0.92);
    color: #fff;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.plan-lock-shell {
    position: relative;
}

.plan-lock-shell--card {
    display: inline-block;
    max-width: 100%;
    width: fit-content;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
}

.plan-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-radius: inherit;
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.08) 0 10%,
            rgba(255, 154, 199, 0.25) 10% 20%,
            rgba(255, 255, 255, 0.06) 20% 30%,
            rgba(255, 188, 218, 0.24) 30% 40%,
            rgba(255, 255, 255, 0.04) 40% 50%,
            rgba(255, 133, 189, 0.18) 50% 60%,
            rgba(255, 255, 255, 0.04) 60% 70%);
    background-size: 180px 180px;
    backdrop-filter: blur(1.5px);
    animation: plan-lock-stripes 1.6s linear infinite, plan-lock-pulse 1.8s ease-in-out infinite;
}

.plan-lock-overlay[hidden] {
    display: none;
}

.plan-lock-overlay__card {
    width: min(100%, 280px);
    padding: 18px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 28px rgba(96, 29, 70, 0.16);
    text-align: center;
}

.plan-lock-overlay__eyebrow {
    margin: 0 0 8px;
    color: #b03072;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.plan-lock-overlay__title {
    margin: 0;
    color: #23252b;
    font-size: 18px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.plan-lock-overlay__copy {
    margin: 10px 0 0;
    color: #5e6270;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 500;
}

.plan-lock-overlay__cta {
    margin-top: 14px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    background: #b03072;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
}

@keyframes plan-lock-stripes {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 180px 0;
    }
}

@keyframes plan-lock-pulse {
    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }
}

@media (max-width: 390px) {
    .app-header__bar {
        min-height: 76px;
        padding: 18px 14px 12px;
    }

    .app-header__title {
        font-size: 22px;
    }

    .bottom-nav__item span:last-child {
        font-size: 13px;
    }

    .plan-lock-overlay {
        padding: 16px;
    }

    .plan-lock-overlay__card {
        padding: 16px 14px;
    }

    .plan-lock-overlay__title {
        font-size: 17px;
    }

    .plan-lock-overlay__copy {
        font-size: 13px;
    }
}
