/* Shared app/account/privacy navigation and the app step shell. */
.app-sticky-shell,
.site-sticky-nav {
    position: sticky;
    top: 0;
    z-index: 60;
}

.app-sticky-shell {
    width: 100%;
    flex: 0 0 auto;
}

.glass-nav {
    min-height: 64px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 1px 3px rgba(76, 29, 149, 0.05);
}

.glass-nav > .container {
    width: 100%;
}

.app-nav-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem 1rem;
    width: 100%;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.app-brand:hover,
.app-brand:focus-visible {
    text-decoration: none;
}

.app-brand h1 {
    min-width: 0;
    white-space: nowrap;
}

.app-nav-tabs {
    min-width: 0;
    justify-content: flex-end;
}

.app-nav-controls {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    min-width: 0;
}

.glass-nav .nav-tabs {
    white-space: nowrap;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-medium);
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    font-size: 1.2rem;
}

.logo-icon-sm {
    width: 32px;
    height: 32px;
    font-size: 1rem;
}

.nav-link-inline {
    color: #6b7280;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link-inline:hover {
    color: var(--color-primary);
}

.lang-selector {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 9999px;
    color: #4b5563;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.lang-selector:hover {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.session-status {
    position: relative;
    display: flex;
    align-items: center;
}

.session-status.hidden,
.nav-sign-in.hidden {
    display: none;
}

.nav-sign-in {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 1.1rem;
    border: 1px solid rgba(124, 58, 237, 0.28);
    border-radius: 9999px;
    color: #6d28d9;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-sign-in:hover {
    border-color: rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.08);
}

.account-capsule {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 9999px;
    color: #374151;
    background: rgba(245, 243, 255, 0.75);
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.account-capsule:hover {
    border-color: rgba(124, 58, 237, 0.32);
    background: rgba(237, 233, 254, 0.95);
}

.account-avatar {
    width: 1.6rem;
    height: 1.6rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    font-size: 0.8rem;
    font-weight: 700;
}

.account-email {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-quota-pill {
    flex: 0 0 auto;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.12);
    font-size: 0.78rem;
    font-weight: 600;
}

.account-quota-pill.is-exhausted {
    color: #b45309;
    background: rgba(245, 158, 11, 0.16);
}

.account-caret {
    color: #9ca3af;
    font-size: 0.7rem;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 70;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.875rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.account-dropdown.hidden {
    display: none;
}

.account-dropdown-email {
    padding: 0.25rem 0.375rem 0.5rem;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 650;
    line-height: 1.35;
    word-break: break-word;
}

.account-dropdown-quota {
    padding: 0 0.375rem;
    color: #4b5563;
    font-size: 0.8rem;
    line-height: 1.35;
}

.account-dropdown-reset {
    padding: 0 0.375rem 0.25rem;
    color: #9ca3af;
    font-size: 0.78rem;
    line-height: 1.35;
}

.account-dropdown-mycenter,
.account-dropdown-logout {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.625rem;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.account-dropdown-mycenter,
.account-dropdown-mycenter:visited {
    color: #4f46e5;
}

.account-dropdown-mycenter:hover,
.account-dropdown-mycenter:focus-visible {
    color: #4338ca;
    background: rgba(79, 70, 229, 0.08);
    text-decoration: none;
}

.account-dropdown-logout {
    margin-top: 0.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    color: #dc2626;
}

.account-dropdown-logout:hover,
.account-dropdown-logout:focus-visible {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.08);
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-tab:hover {
    color: var(--color-primary);
}

.nav-tab-active,
.nav-tab.active {
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
}

.step-indicator-container {
    min-height: 48px;
    display: flex;
    align-items: center;
    padding: 0.375rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.step-indicator-container > .container {
    width: 100%;
}

.step-indicator {
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.step-indicator-compact .step-item {
    flex-direction: row;
    gap: 0.25rem;
}

.step-indicator-compact .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
}

.step-indicator-compact .step-label {
    font-size: 0.75rem;
}

.step-item {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #9ca3af;
    background: #e5e7eb;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-normal);
}

.step-item.active .step-number {
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
    box-shadow: var(--shadow-glow);
}

.step-item.completed .step-number {
    color: #fff;
    background: var(--color-accent);
}

.step-label {
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition-normal);
}

.step-item.active .step-label {
    color: var(--color-primary);
}

.step-line {
    position: relative;
    height: 2px;
    flex: 1;
    align-self: center;
    max-width: 100px;
    margin: 0 0.75rem;
    background: #e5e7eb;
}

.step-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width 0.5s ease;
}

.step-item.completed + .step-line::after {
    width: 100%;
}

.main-content {
    flex: 1 0 auto;
    min-height: 0;
    padding-top: clamp(1rem, 3vw, 2rem);
}

.privacy-main,
.account-main {
    padding-top: 1.5rem;
}

@media (max-width: 640px) {
    .glass-nav {
        min-height: 104px;
        align-items: stretch;
    }

    .glass-nav > .container {
        display: flex;
        align-items: center;
    }

    .app-nav-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "brand controls"
            "tabs tabs";
        column-gap: 0.5rem;
        row-gap: 0.45rem;
    }

    .app-brand {
        grid-area: brand;
        gap: 0.45rem;
    }

    .app-brand h1 {
        overflow: hidden;
        font-size: 0.95rem;
        line-height: 1.2;
        text-overflow: ellipsis;
    }

    .app-nav-tabs {
        grid-area: tabs;
        width: 100%;
        justify-content: flex-start;
        gap: 0.4rem;
        padding: 0.1rem 0 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
    }

    .app-nav-controls {
        grid-area: controls;
        gap: 0.35rem;
    }

    .nav-tab {
        padding: 0.35rem 0.55rem;
        border: 1px solid rgba(99, 102, 241, 0.14);
        border-radius: 9999px;
        background: rgba(255, 255, 255, 0.72);
        font-size: 0.76rem;
        line-height: 1.1;
    }

    .nav-tab-active,
    .nav-tab.active {
        border-color: rgba(99, 102, 241, 0.28);
        background: rgba(99, 102, 241, 0.1);
    }

    .lang-selector,
    .nav-sign-in {
        height: 36px;
        font-size: 0.76rem;
    }

    .lang-selector {
        max-width: 82px;
        padding: 0 0.45rem;
    }

    .nav-sign-in {
        padding: 0 0.65rem;
    }

    .account-email,
    .account-caret {
        display: none;
    }

    .account-capsule {
        min-height: 36px;
        gap: 0.35rem;
        padding: 0.25rem 0.45rem;
    }

    .account-quota-pill {
        padding: 0.08rem 0.35rem;
        font-size: 0.72rem;
    }

    .account-dropdown {
        width: min(220px, calc(100vw - 32px));
    }

    .step-indicator-container {
        min-height: 52px;
    }

    .step-indicator {
        max-width: 100%;
        padding: 0 0.25rem;
    }

    .step-line {
        min-width: 20px;
        margin: 0 0.3rem;
    }

    .main-content {
        padding-top: 1rem;
    }
}

@media (max-width: 350px) {
    .app-brand h1 {
        max-width: 6.5rem;
    }

    .logo-icon-sm {
        width: 28px;
        height: 28px;
    }

    .nav-tab {
        padding-inline: 0.45rem;
        font-size: 0.72rem;
    }

    .step-line {
        min-width: 14px;
        margin-inline: 0.2rem;
    }
}
