/* AVA MIXT — Bootstrap-native image/feed layout */

:root {
    --ava-bg: #eef3fa;
    --ava-border: #dbe5f2;
    --ava-text: #18233a;
    --ava-muted: #64748b;
    --ava-soft: #475569;
    --ava-blue: #2563eb;
    --ava-gold: #d4a43a;
}

body.ava-body {
    background: linear-gradient(180deg, #f8fbff 0%, var(--ava-bg) 100%);
    color: var(--ava-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

.ava-header {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ava-border);
    box-shadow: 0 4px 20px rgba(15,23,42,.05);
}

.ava-brand-link {
    display: inline-flex;
    align-items: center;
    gap: .85rem;
    color: var(--ava-text);
}

.ava-brand-link:hover {
    color: var(--ava-text);
}

.ava-logo {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: linear-gradient(135deg, #2563eb, #d4a43a);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: .04em;
    box-shadow: 0 10px 24px rgba(37,99,235,.18);
}

.ava-brand-link strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.1;
}

.ava-brand-link small {
    display: block;
    color: var(--ava-muted);
    font-size: .78rem;
}

.ava-search {
    min-height: 52px;
    border-radius: 18px;
    border-color: var(--ava-border);
    background: #fff;
}

.ava-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .65rem .55rem .9rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--ava-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.ava-status-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 999px;
}

.ava-sticky {
    position: sticky;
    top: 98px;
}

.ava-section-label {
    color: #a07000;
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .12em;
    margin-bottom: .35rem;
}

.ava-side-title {
    font-size: 1rem;
    font-weight: 850;
    margin-bottom: 1rem;
}

.ava-side-text {
    color: var(--ava-soft);
    line-height: 1.55;
}

.ava-identity-card {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem;
    border-radius: 18px;
    transition: .18s ease;
}

.ava-identity-card:hover {
    background: #f7faff;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(37,99,235,.08);
}

.ava-identity-avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    flex: 0 0 auto;
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ava-identity-name {
    font-weight: 800;
    font-size: .94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ava-identity-meta {
    font-size: .78rem;
    color: var(--ava-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ava-status {
    font-size: .74rem;
    font-weight: 800;
}

.ava-status.active { color: #16a34a; }
.ava-status.hidden,
.ava-status.paused,
.ava-status.archived { color: #d97706; }

.ava-hero-ratio {
    max-height: 430px;
}

.ava-hero-title {
    font-size: clamp(1.7rem, 2.4vw, 2.25rem);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -.03em;
    margin: .45rem 0 .65rem;
}

.ava-hero-text {
    font-size: 1rem;
    color: var(--ava-soft);
    line-height: 1.58;
    margin-bottom: .6rem;
}

.ava-badge-soft {
    background: #eef4ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
}

.ava-meta {
    color: var(--ava-muted);
    font-size: .82rem;
}

.ava-news-card {
    transition: .18s ease;
}

.ava-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .13) !important;
}

.ava-news-title {
    font-size: 1.18rem;
    font-weight: 850;
    line-height: 1.25;
    margin-bottom: .45rem;
}

.ava-news-text {
    color: var(--ava-soft);
    line-height: 1.5;
    margin-bottom: .65rem;
}

.ava-read-more {
    text-decoration: none;
    font-weight: 800;
    color: var(--ava-blue);
}

.ava-roadmap {
    padding-left: 1.1rem;
    color: var(--ava-soft);
}

.ava-roadmap li {
    margin-bottom: .38rem;
}

.ava-pagination .page-link {
    border-color: var(--ava-border);
    border-radius: 12px;
    margin-right: .4rem;
    color: var(--ava-soft);
}

.ava-pagination .active .page-link {
    background: var(--ava-blue);
    border-color: var(--ava-blue);
    color: #fff;
}

.ava-back-link {
    display: inline-flex;
    text-decoration: none;
    font-weight: 800;
    color: var(--ava-blue);
    margin-bottom: 1rem;
}

.ava-article-title {
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    line-height: 1.08;
    letter-spacing: -.035em;
    font-weight: 950;
    margin-bottom: .75rem;
}

.ava-article-lead {
    color: var(--ava-soft);
    font-size: 1.08rem;
}

.ava-article-body {
    font-size: 1.02rem;
    line-height: 1.7;
    color: #25334d;
}

.ava-article-body h2 {
    font-size: 1.45rem;
    font-weight: 900;
    margin: 1rem 0 .75rem;
}

.ava-gallery-title {
    font-size: 1.15rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.ava-gallery-thumb-btn {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}

.ava-gallery-thumb-btn:hover {
    transform: translateY(-2px);
}

.ava-modal-image-wrap {
    height: calc(100vh - 76px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 4rem 2rem;
}

.ava-modal-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ava-form-title {
    font-size: 1.7rem;
    font-weight: 900;
    margin-bottom: 1.2rem;
}

.ava-footer {
    margin-top: 2rem;
    border-top: 1px solid var(--ava-border);
    background: rgba(255,255,255,.72);
    color: var(--ava-muted);
    padding: 1.25rem 0;
}

@media (max-width: 1199.98px) {
    .ava-sticky {
        position: static;
    }
}

@media (max-width: 767.98px) {
    body.ava-body {
        font-size: 14px;
    }

    .ava-logo {
        width: 48px;
        height: 48px;
        border-radius: 16px;
    }

    .ava-hero-ratio {
        max-height: 280px;
    }

    .ava-modal-image-wrap {
        padding: 1rem;
    }

    .ava-news-title {
        font-size: 1.08rem;
    }
}


/* AVA auth forms */
.ava-form-title {
    font-size: 1.7rem;
    font-weight: 900;
    margin-bottom: 1.2rem;
    letter-spacing: -.02em;
}

.form-control:focus {
    border-color: rgba(37,99,235,.35);
    box-shadow: 0 0 0 .25rem rgba(37,99,235,.10);
}


/* AVA admin */
.ava-admin-title {
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 900;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
}

.ava-admin-news-title {
    font-size: 1.08rem;
    font-weight: 850;
    line-height: 1.25;
}

.border-dashed {
    border-style: dashed !important;
}


/* AVA v0.3.6 compact header + sticky offset fix */
.ava-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ava-header .container-fluid {
    padding-top: .55rem !important;
    padding-bottom: .55rem !important;
}

.ava-logo {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    font-size: .82rem;
}

.ava-brand-link strong {
    font-size: 1rem !important;
}

.ava-brand-link small {
    font-size: .72rem !important;
}

.ava-search {
    min-height: 42px !important;
    border-radius: 15px !important;
    padding-top: .45rem;
    padding-bottom: .45rem;
}

.ava-profile-pill {
    padding: .35rem .45rem .35rem .65rem !important;
    box-shadow: 0 6px 18px rgba(15,23,42,.06) !important;
}

.ava-sticky {
    top: 76px !important;
}

body.ava-body main {
    scroll-margin-top: 82px;
}

.ava-article {
    margin-top: .25rem;
}

@media (max-width: 991.98px) {
    .ava-header {
        position: relative !important;
    }

    .ava-sticky {
        top: auto !important;
    }
}


/* AVA v0.3.7 image fit fix */

.ava-news-cover,
.ava-article-cover,
.ava-article-gallery img,
.ava-feed-image,
.ava-featured-image {
    object-fit: contain !important;
    background: #f3f6fb;
}

.ava-news-cover,
.ava-article-cover,
.ava-featured-image {
    border-radius: 18px !important;
    overflow: hidden;
}

.ava-article-gallery img {
    border-radius: 14px !important;
}



/* AVA v0.3.9 — integrated image fit rebuild from v0.3.7
   No extra CSS files. All fixes are inside assets/css/ava.css
*/

.ava-hero-ratio,
.ava-news-card .ratio,
.ava-article .ratio,
.ava-gallery-thumb-btn .ratio,
.ava-news-cover-wrap,
.ava-cover-wrap {
    background: #f4f6fb;
}

.ava-hero-ratio img,
.ava-news-card .ratio img,
.ava-article .ratio img,
.ava-gallery-thumb-btn .ratio img,
.ava-modal-image-wrap img {
    object-fit: contain !important;
    object-position: center center !important;
}

.ava-article .ratio,
.ava-hero-ratio {
    border-radius: 18px !important;
    overflow: hidden !important;
}

.ava-gallery-thumb-btn .ratio {
    border-radius: 14px !important;
    overflow: hidden !important;
}

.ava-article img,
.ava-news-card img {
    max-width: 100%;
}

/* Compact header retained */
.ava-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ava-header .container-fluid {
    padding-top: .55rem !important;
    padding-bottom: .55rem !important;
}

.ava-logo {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    font-size: .82rem;
}

.ava-brand-link strong {
    font-size: 1rem !important;
}

.ava-brand-link small {
    font-size: .72rem !important;
}

.ava-search {
    min-height: 42px !important;
    border-radius: 15px !important;
    padding-top: .45rem;
    padding-bottom: .45rem;
}

.ava-profile-pill {
    padding: .35rem .45rem .35rem .65rem !important;
    box-shadow: 0 6px 18px rgba(15,23,42,.06) !important;
}

.ava-sticky {
    top: 76px !important;
}

body.ava-body main {
    scroll-margin-top: 82px;
}


/* AVA v0.3.10 safe image rebuild — no extra CSS files */

.ava-main-image-btn {
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: #f4f6fb;
    border-radius: 18px;
    overflow: hidden;
    text-align: center;
}

.ava-main-news-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 18px;
    background: #f4f6fb;
}

.ava-gallery-thumb-btn .ratio,
.ava-news-card .ratio,
.ava-hero-ratio {
    background: #f4f6fb;
}

.ava-gallery-thumb-btn img,
.ava-news-card .ratio img,
.ava-hero-ratio img {
    object-fit: contain !important;
    object-position: center center !important;
}

.ava-gallery-thumb-btn .ratio {
    border-radius: 14px !important;
    overflow: hidden;
}

.ava-news-card .ratio,
.ava-hero-ratio {
    border-radius: 18px !important;
    overflow: hidden;
}

/* broken image should not reserve huge empty space */
.ava-main-image-btn img[src=""],
.ava-main-image-btn img:not([src]) {
    display: none !important;
}

/* compact header retained */
.ava-header {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.ava-header .container-fluid {
    padding-top: .55rem !important;
    padding-bottom: .55rem !important;
}

.ava-logo {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    font-size: .82rem;
}

.ava-brand-link strong {
    font-size: 1rem !important;
}

.ava-brand-link small {
    font-size: .72rem !important;
}

.ava-search {
    min-height: 42px !important;
    border-radius: 15px !important;
    padding-top: .45rem;
    padding-bottom: .45rem;
}

.ava-profile-pill {
    padding: .35rem .45rem .35rem .65rem !important;
    box-shadow: 0 6px 18px rgba(15,23,42,.06) !important;
}

.ava-sticky {
    top: 76px !important;
}


/* AVA v0.4 identity public profile */

.ava-identity-profile {
    scroll-margin-top: 90px;
}

.ava-identity-cover-wrap {
    max-height: 320px;
    background: #f4f6fb;
    overflow: hidden;
}

.ava-identity-cover {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.ava-profile-avatar-wrap {
    flex: 0 0 auto;
}

.ava-profile-avatar {
    width: 132px;
    height: 132px;
    border-radius: 28px;
    object-fit: contain;
    background: #f4f6fb;
    border: 1px solid var(--ava-border);
    box-shadow: 0 10px 26px rgba(15,23,42,.08);
}

.ava-profile-avatar-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 950;
    color: #1d4ed8;
    background: #dbeafe;
}

.ava-identity-title {
    font-size: clamp(2rem, 3.5vw, 3.4rem);
    line-height: 1.02;
    font-weight: 950;
    letter-spacing: -.045em;
    margin-bottom: .55rem;
}

.ava-identity-lead {
    color: var(--ava-soft);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 76ch;
}

.ava-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1.25rem;
}

.ava-profile-tabs a {
    text-decoration: none;
    color: #1d4ed8;
    background: #eef4ff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: .42rem .85rem;
    font-weight: 800;
    font-size: .88rem;
}

.ava-profile-tabs a.active {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
}

.ava-profile-section-title {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -.02em;
    margin-bottom: 1rem;
}

.ava-character-facts {
    display: grid;
    gap: .7rem;
    margin: 0;
}

.ava-character-facts div {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: .75rem;
    border-bottom: 1px solid #eef2f7;
    padding-bottom: .55rem;
}

.ava-character-facts dt {
    color: var(--ava-muted);
    font-size: .82rem;
    font-weight: 800;
}

.ava-character-facts dd {
    margin: 0;
    font-weight: 700;
}

.ava-stat-box {
    border: 1px solid var(--ava-border);
    border-radius: 18px;
    padding: 1rem;
    background: #f8fbff;
}

.ava-stat-box strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 950;
}

.ava-stat-box span {
    color: var(--ava-muted);
    font-size: .82rem;
}

.ava-traits {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.ava-traits span,
.ava-relation-placeholder span {
    display: inline-flex;
    border-radius: 999px;
    padding: .4rem .75rem;
    background: #f1f5f9;
    color: #334155;
    font-weight: 750;
    font-size: .86rem;
}

.ava-tree-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--ava-soft);
}

.ava-tree-list li {
    margin-bottom: .45rem;
}

.ava-relation-placeholder {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.ava-mini-news {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1rem;
    border: 1px solid var(--ava-border);
    border-radius: 18px;
    background: #fff;
    transition: .18s ease;
}

.ava-mini-news:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

@media(max-width:767.98px) {
    .ava-profile-avatar {
        width: 96px;
        height: 96px;
        border-radius: 22px;
    }

    .ava-character-facts div {
        grid-template-columns: 1fr;
        gap: .15rem;
    }
}


/* AVA v0.4.2 identity admin */

.ava-admin-identity-card {
    transition: .18s ease;
}

.ava-admin-identity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15,23,42,.11) !important;
}

.ava-admin-identity-img {
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    border-radius: 18px;
    object-fit: contain;
    background: #f4f6fb;
    border: 1px solid var(--ava-border);
}

.ava-identity-card {
    cursor: pointer;
}

.ava-identity-card:hover .ava-identity-name {
    color: #1d4ed8;
}


/* AVA v0.4.3 pinned news + admin sidebar cleanup */

.ava-pinned-news-card .card-body {
    padding-top: 1.35rem !important;
}

.ava-pinned-image-wrap {
    display: block;
    width: 100%;
    background: #f4f6fb;
    border-radius: 18px;
    overflow: hidden;
    padding: .65rem;
}

.ava-pinned-image {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 14px;
    background: #f4f6fb;
}

@media (max-width: 767.98px) {
    .ava-pinned-image-wrap {
        padding: .45rem;
        border-radius: 16px;
    }

    .ava-pinned-image {
        border-radius: 12px;
    }
}


/* AVA v0.4.4 final pinned news layout */

.ava-pinned-news-card {
    overflow: hidden;
}

.ava-pinned-title {
    font-size: clamp(1.65rem, 2.5vw, 2.55rem);
    line-height: 1.08;
    font-weight: 950;
    letter-spacing: -.04em;
    margin: 0 0 .45rem;
}

.ava-pinned-image-wrap {
    display: block;
    width: 100%;
    background: #f4f6fb;
    border-radius: 18px;
    overflow: hidden;
    padding: .75rem;
    margin-top: .75rem;
}

.ava-pinned-image {
    display: block;
    width: 100%;
    max-height: 560px;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 14px;
    background: #f4f6fb;
}

.ava-pinned-text {
    color: var(--ava-soft);
    font-size: 1rem;
    line-height: 1.6;
    margin: 1rem 0 0;
}

@media (max-width: 767.98px) {
    .ava-pinned-title {
        font-size: 1.55rem;
    }

    .ava-pinned-image-wrap {
        padding: .45rem;
        border-radius: 16px;
    }

    .ava-pinned-image {
        border-radius: 12px;
    }
}


/* AVA v0.4.5 identity editor with reference images */

.ava-editor-column,
.ava-editor-result-column {
    background: #fff;
    border: 1px solid var(--ava-border);
    border-radius: 24px;
    padding: 1.25rem;
}

.ava-editor-result-column {
    position: sticky;
    top: 76px;
}

.ava-identity-upload-card {
    border: 1px solid var(--ava-border);
    border-radius: 18px;
    background: #f8fbff;
    padding: .65rem;
}

.ava-identity-upload-card img {
    background: #f4f6fb;
    object-fit: contain !important;
}

@media(max-width: 991.98px) {
    .ava-editor-result-column {
        position: static;
    }
}


/* AVA v0.4.6 live save + name availability */
.ava-name-check-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.45rem;
    line-height: 1;
    font-weight: 950;
}
.ava-name-check-icon.is-ok { color: #16a34a; }
.ava-name-check-icon.is-bad { color: #dc2626; }
.ava-name-check-icon.is-wait { color: #d97706; }


/* AVA v0.5.0 source image upload preview */

.ava-client-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: .75rem;
}

.ava-client-preview-card {
    border: 1px solid var(--ava-border);
    border-radius: 18px;
    background: #f8fbff;
    padding: .55rem;
}

.ava-client-preview-card img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #f4f6fb;
    border-radius: 14px;
}

.ava-client-preview-meta {
    font-size: .72rem;
    color: var(--ava-muted);
    margin: .45rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* AVA v0.5.1 upload choose button */
#identity_choose_images {
    min-width: 150px;
}


/* AVA v0.5.2 MIXT Identity Generator */

.ava-generator-ref {
    background: #f4f6fb;
    border: 1px solid var(--ava-border);
}

.ava-generator-ref img {
    object-fit: contain !important;
    background: #f4f6fb;
}

.ava-task-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--ava-border);
    border-radius: 18px;
    padding: .85rem 1rem;
    background: #f8fbff;
}


/* AVA v0.5.3 user avatar creator */

.ava-avatar-create-card {
    overflow: hidden;
}

.ava-avatar-title {
    font-size: clamp(2rem, 3.2vw, 3.4rem);
    line-height: 1.05;
    font-weight: 950;
    letter-spacing: -.045em;
    margin-bottom: .6rem;
}

.ava-avatar-lead {
    color: var(--ava-soft);
    font-size: 1.08rem;
    max-width: 720px;
}

.ava-avatar-person {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: #f8fbff;
    border: 1px solid var(--ava-border);
    border-radius: 22px;
    padding: .9rem 1rem;
}

.ava-avatar-person-icon {
    width: 54px;
    height: 54px;
    border-radius: 17px;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 950;
    font-size: 1.35rem;
}

.ava-avatar-step-title {
    font-size: 1.05rem;
    font-weight: 900;
    margin-bottom: .85rem;
}

.ava-preset-card {
    display: block;
    height: 100%;
    border: 1px solid var(--ava-border);
    border-radius: 22px;
    padding: 1rem;
    background: #fff;
    cursor: pointer;
    transition: .18s ease;
}

.ava-preset-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: .35rem;
}

.ava-preset-card span {
    display: block;
    color: var(--ava-muted);
    font-size: .9rem;
    line-height: 1.45;
}

.btn-check:checked + .ava-preset-card {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    background: #f8fbff;
}

.ava-choice-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.ava-choice-pills .btn-check:checked + .btn {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
}


/* AVA v0.5.4 avatar reference photo selection + cat mode */

.ava-ref-select-card {
    display: block;
    position: relative;
    padding: .45rem;
    background: #f8fbff;
    border: 2px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: .18s ease;
}

.ava-ref-select-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(15,23,42,.08);
}

.ava-ref-check:checked + .ava-ref-select-card {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

.ava-ref-check:not(:checked) + .ava-ref-select-card {
    opacity: .48;
    filter: grayscale(.4);
}

.ava-ref-selected-label {
    display: block;
    text-align: center;
    font-size: .78rem;
    font-weight: 800;
    color: #1d4ed8;
    padding-top: .35rem;
}

.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label {
    color: #64748b;
}

.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label::before {
    content: "не ";
}


/* AVA v0.5.5 clearer avatar creator flow */

.ava-help-box {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    color: #334155;
    border-radius: 18px;
    padding: .85rem 1rem;
    font-size: .92rem;
    line-height: 1.5;
}

.ava-ref-select-card {
    min-height: 100%;
}

.ava-ref-select-card .ratio {
    border: 1px solid var(--ava-border);
    background: #f4f6fb;
}

.ava-ref-check:checked + .ava-ref-select-card .ratio {
    border-color: #2563eb;
}

.ava-ref-selected-label {
    border-radius: 999px;
    background: #eff6ff;
    margin-top: .4rem;
    padding: .18rem .5rem;
}

.ava-ref-check:checked + .ava-ref-select-card .ava-ref-selected-label::after {
    content: "";
}

.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label {
    background: #f1f5f9;
}

.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label::before {
    content: "";
}

.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label {
    font-size: 0;
}

.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label::after {
    content: "не вибрано";
    font-size: .78rem;
}

.ava-ref-check:checked + .ava-ref-select-card .ava-ref-selected-label {
    font-size: 0;
}

.ava-ref-check:checked + .ava-ref-select-card .ava-ref-selected-label::after {
    content: "✓ вибрано";
    font-size: .78rem;
}


/* AVA v0.5.6 avatar generation process UX */

.ava-avatar-process-card {
    overflow: hidden;
}

.ava-loader-orb {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 35%, #fff 0 12%, transparent 13%),
        linear-gradient(135deg, #2563eb, #f4b400);
    box-shadow: 0 16px 34px rgba(37,99,235,.22);
    animation: avaOrbPulse 1.4s infinite ease-in-out;
}

@keyframes avaOrbPulse {
    0%, 100% { transform: scale(1); opacity: .86; }
    50% { transform: scale(1.08); opacity: 1; }
}

.ava-process-progress .progress {
    height: .75rem;
    background: #edf2f7;
}

.ava-process-progress .progress-bar {
    background: linear-gradient(90deg, #2563eb, #f4b400);
}

.ava-process-info {
    border: 1px solid var(--ava-border);
    background: #f8fbff;
    border-radius: 18px;
    padding: .85rem 1rem;
}

.ava-process-info span {
    display: block;
    color: var(--ava-muted);
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 800;
}

.ava-process-info strong {
    display: block;
    margin-top: .2rem;
}

.ava-preview-placeholder,
.ava-preview-result-card {
    border: 1px solid var(--ava-border);
    background: #f8fbff;
    border-radius: 20px;
    padding: .7rem;
}

.ava-preview-result-card img {
    background: #f4f6fb;
}

.ava-preview-placeholder-box {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    background: #f4f6fb;
    border: 1px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    align-items: center;
    justify-content: center;
    color: var(--ava-muted);
    font-size: .9rem;
    text-align: center;
}

.ava-mini-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    animation: avaSpin 1s linear infinite;
}

@keyframes avaSpin {
    to { transform: rotate(360deg); }
}

.ava-process-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 1rem;
}

.ava-process-list li {
    position: relative;
    padding: .45rem 0 .45rem 2rem;
    color: var(--ava-muted);
}

.ava-process-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .55rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #e2e8f0;
}

.ava-process-list li.done {
    color: #0f172a;
    font-weight: 700;
}

.ava-process-list li.done::before {
    content: "✓";
    background: #16a34a;
    color: #fff;
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* AVA v0.5.7 working avatar pipeline fixes */
.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label::after { content: "обрати"; font-size: .78rem; }
.ava-ref-check:checked + .ava-ref-select-card .ava-ref-selected-label::after { content: "✓ вибрано"; font-size: .78rem; }
.ava-preview-mock { opacity: .86; position: relative; }
.ava-preview-mock::after { content: "mock"; position: absolute; right: .7rem; top: .7rem; background: rgba(15,23,42,.72); color: #fff; border-radius: 999px; padding: .15rem .5rem; font-size: .72rem; font-weight: 800; }


/* AVA v0.5.9 form state + submit redirect fix */
.ava-ref-selected-label {
    display: block;
    text-align: center;
}
.ava-ref-check:not(:checked) + .ava-ref-select-card .ava-ref-selected-label::after {
    content: "обрати";
    font-size: .78rem;
}
.ava-ref-check:checked + .ava-ref-select-card .ava-ref-selected-label::after {
    content: "✓ вибрано";
    font-size: .78rem;
}


/* AVA v0.6.0 avatar gallery + local worker MVP */
.ava-saved-avatar-card {
    border: 1px solid var(--ava-border);
    background: #f8fbff;
    border-radius: 20px;
    padding: .7rem;
    transition: .18s ease;
}
.ava-saved-avatar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15,23,42,.08);
}
.ava-saved-avatar-card.is-active {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}
.ava-saved-avatar-card img { background: #f4f6fb; }


/* AVA v0.6.6 select then save avatar UX */

.ava-preview-result-card {
    transition: .18s ease;
}

.ava-preview-result-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), 0 14px 28px rgba(15, 23, 42, .10);
    transform: translateY(-2px);
}

.ava-preview-result-card.is-selected .ratio {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: -3px;
}

#avatar_selected_save_btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}


/* AVA v0.6.7 select-save hardfix */

.ava-preview-result-card {
    transition: .18s ease;
}

.ava-preview-result-card.is-selected {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), 0 14px 28px rgba(15, 23, 42, .10) !important;
    transform: translateY(-2px);
}

.ava-preview-result-card.is-selected .ratio {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: -3px;
}

#avatar_selected_save_btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}


/* AVA v0.6.8 multiselect save avatars */
.ava-avatar-candidate-checkbox:checked + .ava-avatar-choose-btn {
    font-weight: 800;
}


/* AVA v0.7.0 stable avatar select/save UX */
.ava-preview-result-card {
    transition: .18s ease;
}

.ava-preview-result-card.is-selected {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14), 0 14px 28px rgba(15, 23, 42, .10) !important;
    transform: translateY(-2px);
}

.ava-preview-result-card.is-selected .ratio {
    outline: 3px solid rgba(37, 99, 235, .45);
    outline-offset: -3px;
}

#avatar_selected_save_btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}


/* AVA v0.7.1 avatar create upload/reference UX */
.ava-ref-select-card {
    cursor: pointer;
}
.ava-ref-check:not(:checked) + .ava-ref-select-card {
    opacity: .72;
}
.ava-ref-check:checked + .ava-ref-select-card {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(37,99,235,.35);
}


/* AVA v0.7.2 avatar gallery active/management UX */

/* прибираємо кольорові службові позначки з avatar gallery */
.ava-saved-avatar-card::before,
.ava-saved-avatar-card::after {
    display: none !important;
    content: none !important;
}

.ava-saved-avatar-card {
    position: relative;
}

.ava-avatar-manage-icon,
.ava-avatar-edit-mini {
    position: absolute;
    z-index: 4;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(148,163,184,.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-decoration: none;
    color: #2563eb;
    box-shadow: 0 8px 18px rgba(15,23,42,.12);
}

.ava-profile-avatar-wrap {
    position: relative;
}

.ava-identity-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}


/* AVA v0.7.3 admin AI/Local mode switch */
.ava-admin-mode-box {
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 18px;
    padding: .75rem;
    background: #f8fbff;
}


/* AVA v0.7.4 global AI/Local mode switch */
.ava-admin-mode-box {
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 18px;
    padding: .75rem;
    background: #f8fbff;
}


/* AVA v0.7.6 generation busy guard */

.ava-disabled-form {
    pointer-events: none;
    opacity: .6;
}

.ava-generation-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(248, 251, 255, .72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ava-generation-busy-box {
    width: min(520px, 92vw);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .18);
    padding: 32px;
    text-align: center;
}

.ava-generation-busy-box h2 {
    font-weight: 900;
    margin: 12px 0 8px;
}

.ava-generation-busy-box p {
    color: #475569;
    margin: 0;
}

.ava-generation-spinner {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #2563eb, #f8c006, #2563eb);
    animation: avaSpin 1.1s linear infinite;
    position: relative;
}

.ava-generation-spinner::after {
    content: "";
    position: absolute;
    inset: 13px;
    background: #fff;
    border-radius: 50%;
}

.ava-generation-progress-line {
    margin-top: 20px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.ava-generation-progress-line span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #f8c006);
    border-radius: inherit;
}

@keyframes avaSpin {
    to { transform: rotate(360deg); }
}


/* AVA v0.7.7 admin tasks + busy guard */
.ava-admin-mode-box {
    border: 1px solid rgba(148, 163, 184, .45);
    border-radius: 18px;
    padding: .75rem;
    background: #f8fbff;
}

.ava-generation-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(248, 251, 255, .72);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ava-generation-busy-box {
    width: min(520px, 92vw);
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 28px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .18);
    padding: 32px;
    text-align: center;
}

.ava-generation-busy-box h2 {
    font-weight: 900;
    margin: 12px 0 8px;
}

.ava-generation-busy-box p {
    color: #475569;
    margin: 0;
}

.ava-generation-spinner {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #2563eb, #f8c006, #2563eb);
    animation: avaSpin 1.1s linear infinite;
    position: relative;
}

.ava-generation-spinner::after {
    content: "";
    position: absolute;
    inset: 13px;
    background: #fff;
    border-radius: 50%;
}

.ava-generation-progress-line {
    margin-top: 20px;
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.ava-generation-progress-line span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #f8c006);
    border-radius: inherit;
}

@keyframes avaSpin {
    to { transform: rotate(360deg); }
}


/* AVA v0.7.8 overlay controls */
.ava-generation-busy-overlay.is-hidden {
    display: none !important;
}

.ava-generation-busy-box .btn {
    pointer-events: auto;
}


/* AVA v0.8.0 admin messages */
.ava-message-unread {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .10), 0 12px 32px rgba(15, 23, 42, .08) !important;
}
