/**
 * Pill-блок AI Gen под меню Astra.
 */

.ai-gen-header-bar-wrap,
.ai-gen-header-bar-wrap .ai-gen-header-bar,
.ai-gen-header-bar-wrap .ast-primary-header-bar,
.ai-gen-header-bar-wrap .main-header-bar,
.ai-gen-header-bar-wrap .site-primary-header-wrap {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    box-shadow: none !important;
}

.ai-gen-header-bar-wrap .site-primary-header-wrap {
    padding-top: 0;
    padding-bottom: 0;
}

.ai-gen-header-bar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    min-height: 32px;
    padding: 2px 0 4px;
}

@media (min-width: 922px) {
    .ai-gen-header-bar-inner {
        padding-right: 10px;
    }
}

@media (max-width: 921px) {
    .ai-gen-header-bar-inner {
        padding: 15px 0 3px;
    }
}

/* Pill-контейнер — фон задаётся inline из админки (opacity). */
.ai-gen-header-pill {
    display: inline-flex;
    align-items: stretch;
    flex-wrap: nowrap;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 999px;
    overflow: hidden;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.ai-gen-header-pill-seg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    margin: 0;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    cursor: default;
    -webkit-appearance: none;
    appearance: none;
    text-transform: none;
    text-shadow: none;
    box-shadow: none;
    transition: background 0.15s ease, color 0.15s ease;
}

button.ai-gen-header-pill-seg {
    cursor: pointer;
}

button.ai-gen-header-pill-seg:hover {
    background: rgba(255, 255, 255, 0.08);
}

button.ai-gen-header-pill-seg:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: -2px;
}

.ai-gen-header-pill-divider {
    flex: 0 0 1px;
    align-self: stretch;
    width: 1px;
    background: rgba(255, 255, 255, 0.28);
}

.ai-gen-header-pill-icon {
    flex: 0 0 auto;
    display: block;
}

.ai-gen-header-pill-icon--wallet {
    color: #38bdf8;
}

.ai-gen-header-pill-icon--logout {
    color: rgba(255, 255, 255, 0.72);
}

.ai-gen-header-pill-icon--login {
    color: rgba(255, 255, 255, 0.88);
}

.ai-gen-header-pill-icon--register {
    color: #38bdf8;
}

.ai-gen-header-pill-balance .ai-gen-balance-label {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
}

.ai-gen-header-pill-email {
    min-width: 0;
    max-width: 220px;
    padding-left: 12px;
    padding-right: 12px;
}

.ai-gen-header-pill-email .ai-gen-auth-email {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.88);
}

.ai-gen-header-pill-logout {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
}

.ai-gen-header-pill-logout:hover {
    color: #fff;
}

.ai-gen-header-pill-logout:hover .ai-gen-header-pill-icon--logout {
    color: #fff;
}

/* Гость */
.ai-gen-header-pill--guest .ai-gen-header-pill-login {
    color: rgba(255, 255, 255, 0.92);
}

.ai-gen-header-pill--guest .ai-gen-header-pill-login:hover .ai-gen-header-pill-icon--login {
    color: #fff;
}

.ai-gen-header-pill--guest .ai-gen-header-pill-register {
    font-weight: 600;
    color: #fff;
}

.ai-gen-header-pill--guest .ai-gen-header-pill-register:hover .ai-gen-header-pill-icon--register {
    color: #7dd3fc;
}

@media (max-width: 921px) {
    .ai-gen-header-pill-email,
    .ai-gen-header-pill-divider--before-logout {
        display: none;
    }

    .ai-gen-header-pill-balance {
        padding-left: 12px;
    }

    .ai-gen-header-pill-logout {
        padding-right: 12px;
    }
}

@media (max-width: 420px) {
    .ai-gen-header-pill-seg {
        padding: 7px 11px;
        font-size: 12px;
        gap: 6px;
    }

    .ai-gen-header-pill-balance .ai-gen-balance-label {
        font-size: 13px;
    }
}
