.aix-nen {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--cm-space-md, 14px);
    padding: 60px 20px 24px;
    background: rgba(2, 6, 23, .88);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .18s ease;
}
.aix-nen.hien { opacity: 1; }
html.aix-khoa, html.aix-khoa body { overflow: hidden !important; }
.aix-nen.trong-hop { position: absolute; z-index: 5300; padding: 44px 16px 18px; }

.aix-khung {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 74vh;
    min-width: 220px;
    min-height: 160px;
    border-radius: var(--cm-radius-md, 12px);
}
.aix-khung > img,
.aix-khung > video {
    display: block;
    max-width: 92vw;
    max-height: 74vh;
    border-radius: var(--cm-radius-md, 12px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
}
.aix-khung > img { transition: filter .28s ease-out; }
.aix-khung > img.mo { filter: blur(14px) saturate(1.05); }
.aix-nen.trong-hop .aix-khung,
.aix-nen.trong-hop .aix-khung > img,
.aix-nen.trong-hop .aix-khung > video { max-width: 100%; max-height: 68vh; }

.aix-khung.caro {
    background-color: #e2e8f0;
    background-image:
        linear-gradient(45deg, #94a3b8 25%, transparent 25%, transparent 75%, #94a3b8 75%),
        linear-gradient(45deg, #94a3b8 25%, transparent 25%, transparent 75%, #94a3b8 75%);
    background-size: 22px 22px;
    background-position: 0 0, 11px 11px;
    padding: 6px;
}

.aix-cho {
    width: min(70vw, 520px);
    height: min(52vh, 380px);
    border-radius: var(--cm-radius-md, 12px);
    background: rgba(255, 255, 255, .06);
}
.aix-quay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, .85);
    font-size: 26px;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.aix-bieu { color: rgba(255, 255, 255, .4); font-size: 80px; }
.aix-tieng { width: min(460px, 84vw); }
.aix-khung:has(.aix-loi) { flex-direction: column; gap: 10px; }
.aix-loi { color: rgba(255, 255, 255, .72); font-size: .84rem; text-align: center; max-width: 420px; }

.aix-x {
    position: absolute;
    top: 16px;
    right: 20px;
    z-index: 4;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.aix-x:hover { background: rgba(255, 255, 255, .24); }

.aix-di {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, opacity .15s;
}
.aix-di:hover:not(:disabled) { background: rgba(255, 255, 255, .24); }
.aix-di:disabled { opacity: .22; cursor: default; }
.aix-di.truoc { left: 18px; }
.aix-di.sau { right: 18px; }

.aix-tin {
    max-width: 720px;
    text-align: center;
    color: var(--cm-text-secondary, #a3b0c2);
}
.aix-ten {
    font-size: .88rem;
    color: var(--cm-text, #e5e7eb);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 720px;
}
.aix-model { font-size: .8rem; color: #d8b4fe; margin-bottom: 6px; }
.aix-prompt { font-size: .8rem; line-height: 1.5; max-height: 6em; overflow-y: auto; }
.aix-dem {
    font-size: .74rem;
    color: rgba(255, 255, 255, .5);
    font-variant-numeric: tabular-nums;
    margin-top: 6px;
}
.aix-nut {
    margin-top: 12px;
    display: flex;
    gap: var(--cm-space-sm, 10px);
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .aix-nen { padding: 52px 10px 16px; }
    .aix-di { width: 36px; height: 36px; font-size: 15px; }
    .aix-di.truoc { left: 6px; }
    .aix-di.sau { right: 6px; }
    .aix-khung, .aix-khung > img, .aix-khung > video { max-width: 96vw; }
}

@media (prefers-reduced-motion: reduce) {
    .aix-nen { transition: none; }
    .aix-khung > img { transition: none; }
}
