#aj-store-chat {
    --aj-ink: #253221;
    --aj-olive: #30452a;
    --aj-olive-dark: #233622;
    --aj-moss: #e5ecdc;
    --aj-paper: #faf8f1;
    --aj-gold: #d4b972;
    --aj-line: #e1decc;
    position: fixed;
    z-index: 1000;
    inset-inline-end: max(1rem, env(safe-area-inset-right));
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: .7rem;
    width: min(25rem, calc(100vw - 2rem));
    color: var(--aj-ink);
    pointer-events: none;
    font: 400 .94rem/1.5 system-ui, sans-serif;
    text-align: start;
}

#aj-store-chat *, #aj-store-chat *::before, #aj-store-chat *::after { box-sizing: border-box; }
#aj-store-chat [hidden] { display: none !important; }
#aj-store-chat button { cursor: pointer; font: inherit; letter-spacing: normal; text-transform: none; }
#aj-store-chat button:disabled { opacity: .55; cursor: default; }
#aj-store-chat button:focus-visible, #aj-store-chat input:focus-visible, #aj-store-chat a:focus-visible {
    outline: 2px solid #8a6724;
    outline-offset: 3px;
}

#aj-store-chat .aj-launcher {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    min-height: 50px;
    padding: 5px 16px 5px 6px;
    border: 1px solid #8a9878;
    border-radius: 999px;
    color: #fffdf3;
    background: linear-gradient(135deg, #3c5334, var(--aj-olive-dark) 75%);
    box-shadow: 0 5px 16px #26362547, inset 0 1px 0 #ffffff19;
    font-weight: 700;
    pointer-events: auto;
    transition: box-shadow .15s ease;
}
#aj-store-chat .aj-launcher:hover { box-shadow: 0 6px 20px #26362568, inset 0 1px 0 #ffffff26; }
#aj-store-chat .aj-launcher-badge {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid #eece88;
    border-radius: 50%;
    background: #e5c277;
    color: #2c3c24;
}
#aj-store-chat .aj-chat-icon {
    position: relative;
    display: grid;
    place-items: center;
    width: 1.35rem;
    height: 1rem;
    border: 1.5px solid currentColor;
    border-radius: .42rem;
}
#aj-store-chat .aj-chat-icon::before {
    content: '';
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: -.24rem 0 currentColor, .24rem 0 currentColor;
}
#aj-store-chat .aj-chat-icon::after {
    content: '';
    position: absolute;
    bottom: -.2rem;
    left: .23rem;
    width: .35rem;
    height: .35rem;
    border-bottom: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    background: #e5c277;
    transform: skewY(-30deg);
}

#aj-store-chat .aj-panel {
    order: -1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100dvh - 10rem);
    border: 1px solid #cccdbb;
    border-radius: 1.25rem;
    background: var(--aj-paper);
    overflow: hidden;
    box-shadow: 0 1rem 3.25rem #25322136, 0 .15rem .65rem #25322124;
    pointer-events: auto;
}
#aj-store-chat .aj-heading {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-shrink: 0;
    min-width: 0;
    padding: .8rem .7rem .8rem 1rem;
    border-bottom: 1px solid #5c6847;
    background: linear-gradient(115deg, #243622, #395034);
    color: #fffdf3;
}
#aj-store-chat .aj-olive-mark {
    position: relative;
    width: 2.5rem;
    aspect-ratio: 1;
    flex: 0 0 auto;
    border: 1px solid #a89156;
    border-radius: 50%;
    background: #ffffff0b;
}
#aj-store-chat .aj-olive-mark::before, #aj-store-chat .aj-olive-mark::after {
    position: absolute;
    content: '';
    background: var(--aj-gold);
}
#aj-store-chat .aj-olive-mark::before {
    top: .63rem;
    left: .51rem;
    width: .67rem;
    height: 1.05rem;
    border-radius: 80% 0 90% 10%;
    transform: rotate(-25deg);
}
#aj-store-chat .aj-olive-mark::after {
    top: .53rem;
    left: 1.23rem;
    width: .61rem;
    height: 1.18rem;
    border-radius: 90% 0 80% 10%;
    transform: rotate(31deg);
}
#aj-store-chat .aj-identity { flex: 1; min-width: 0; }
#aj-store-chat .aj-identity strong { display: block; font: 600 1.22rem/1.2 Georgia, serif; }
#aj-store-chat .aj-identity span { color: #efe4c6; font-size: .76rem; }
#aj-store-chat .aj-close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    color: inherit;
    background: transparent;
    font-size: 1.55rem;
    line-height: 1;
}
#aj-store-chat .aj-close:hover { background: #ffffff17; border-color: #ffffff38; }
#aj-store-chat .aj-close:focus-visible { outline-color: #f1d891; outline-offset: 0; }
#aj-store-chat .aj-current {
    flex: 0 0 auto;
    margin: 0;
    padding: .52rem 1rem;
    border-bottom: 1px solid var(--aj-line);
    background: #efebdc;
    color: #425039;
    font-weight: 650;
    font-size: .8rem;
    overflow-wrap: anywhere;
}

#aj-store-chat .aj-log {
    display: flex;
    flex-direction: column;
    gap: .53rem;
    min-height: 3rem;
    max-height: 18rem;
    padding: .9rem .9rem .65rem;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: #a8ad93 transparent;
}
#aj-store-chat .aj-message {
    flex: 0 0 auto;
    align-self: flex-start;
    max-width: 93%;
    margin: 0;
    padding: .64rem .8rem;
    overflow-wrap: anywhere;
    color: var(--aj-ink);
    background: #fffefd;
    border: 1px solid var(--aj-line);
    border-radius: .95rem .95rem .95rem .25rem;
}
#aj-store-chat .aj-question {
    align-self: flex-end;
    background: var(--aj-moss);
    border-color: #d4dfc8;
    border-radius: .95rem .95rem .25rem .95rem;
}
#aj-store-chat .aj-waiting { color: #57624a; font-size: .83rem; }
#aj-store-chat .aj-message a {
    display: block;
    color: #34562d;
    margin-top: .33rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-size: .86rem;
    font-weight: 650;
}
#aj-store-chat .aj-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    flex-shrink: 0;
    padding: .1rem .9rem .7rem;
}
#aj-store-chat .aj-suggestions button, #aj-store-chat .aj-choices button {
    min-height: 34px;
    padding: .3rem .67rem;
    border: 1px solid #8d9b7d;
    border-radius: 999px;
    color: #344a2e;
    background: transparent;
    font-size: .79rem;
    font-weight: 620;
}
#aj-store-chat .aj-suggestions button:hover, #aj-store-chat .aj-choices button:hover { background: var(--aj-moss); }
#aj-store-chat .aj-choices { display: grid; gap: .35rem; align-self: start; }
#aj-store-chat .aj-choices button {
    display: flex;
    align-items: center;
    gap: .5rem;
    text-align: start;
    border-radius: .6rem;
    overflow-wrap: anywhere;
}
#aj-store-chat .aj-choices button img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; border-radius: .35rem; }
#aj-store-chat .aj-buy-card {
    width: 100%;
    flex: 0 0 auto;
    padding: .65rem .75rem .75rem;
    border: 1px solid #cbd3bd;
    border-radius: .8rem;
    background: #fffefb;
    overflow-wrap: anywhere;
}
#aj-store-chat .aj-buy-card strong { display: block; line-height: 1.3; }
#aj-store-chat .aj-buy-header { display: flex; align-items: center; gap: .65rem; margin-bottom: .55rem; }
#aj-store-chat .aj-buy-header img { width: 70px; height: 70px; flex: 0 0 auto; object-fit: contain; border-radius: .45rem; background: #faf8ef; }
#aj-store-chat .aj-buy-price { margin: .3rem 0 0; color: #30452a; font-weight: 740; }
#aj-store-chat .aj-buy-description { margin: 0 0 .65rem; font-size: .85rem; line-height: 1.4; }
#aj-store-chat .aj-buy-features {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .07rem .55rem;
    margin: 0 0 .65rem;
    font-size: .79rem;
}
#aj-store-chat .aj-buy-features dt { font-weight: 680; }
#aj-store-chat .aj-buy-features dd { margin: 0; }
#aj-store-chat .aj-variant-picker { display: grid; gap: .38rem; margin: .35rem 0 .6rem; }
#aj-store-chat .aj-variant-picker label { display: grid; gap: .15rem; font-size: .81rem; font-weight: 650; }
#aj-store-chat .aj-variant-picker select {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    border: 1px solid #879577;
    border-radius: .48rem;
    background-color: #fff;
    font-size: 16px;
}
#aj-store-chat .aj-variant-status { margin: 0; font-size: .81rem; color: #415335; }
#aj-store-chat .aj-variant-status:empty { display: none; }
#aj-store-chat .aj-buy-actions, #aj-store-chat .aj-buy-secondary {
    display: flex;
    align-items: center;
    gap: .4rem .7rem;
    flex-wrap: wrap;
}
#aj-store-chat .aj-buy-actions a { color: #34562d; text-decoration: underline; text-underline-offset: 3px; }
#aj-store-chat .aj-buy-card .aj-purchase-primary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: .35rem .65rem;
    border: 1px solid #30452a;
    border-radius: .65rem;
    background: #30452a;
    color: #fffdf3;
    text-decoration: none;
    font-weight: 690;
}
#aj-store-chat .aj-form {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: .46rem;
    margin: 0;
    padding: .62rem .88rem;
    border-top: 1px solid var(--aj-line);
    background: #fffdf7;
}
#aj-store-chat .aj-form input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: .48rem .72rem;
    border: 1px solid #8b987b;
    border-radius: .78rem;
    background: #fffefd;
    color: var(--aj-ink);
    font: 1rem system-ui, sans-serif;
}
#aj-store-chat .aj-form input::placeholder { color: #626957; opacity: 1; }
#aj-store-chat .aj-form button {
    min-height: 44px;
    padding: .52rem .75rem;
    border: 1px solid transparent;
    border-radius: .78rem;
    background: var(--aj-olive);
    color: #fffdf3;
    font-weight: 700;
}
#aj-store-chat .aj-form button:hover:not(:disabled) { background: #3b5434; }
#aj-store-chat .aj-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 480px) {
    #aj-store-chat {
        inset-inline-end: max(.75rem, env(safe-area-inset-right));
        width: min(25rem, calc(100vw - 1.5rem));
    }
    #aj-store-chat .aj-form { padding-inline: .65rem; }
}
@media (max-width: 767px) {
    body #aj-store-chat.aj-store-chat[data-open="true"] {
        --aj-dock-gap: max(6px, env(safe-area-inset-bottom));
        --aj-dock-top: 0px;
        --aj-edge-left: max(6px, env(safe-area-inset-left));
        --aj-edge-right: max(6px, env(safe-area-inset-right));
        bottom: calc(var(--aj-visible-bottom, 0px) + var(--aj-dock-gap));
        left: calc(var(--aj-visible-left, 0px) + var(--aj-edge-left));
        right: auto;
        width: calc(var(--aj-visible-width, 100vw) - var(--aj-edge-left) - var(--aj-edge-right));
        max-width: none;
        align-items: stretch;
    }
    body.admin-bar #aj-store-chat[data-open="true"] { --aj-dock-top: 46px; }
    body #aj-store-chat[data-open="true"] .aj-launcher { display: none; }
    body.aj-chat-mobile-open a.aj-mobile-whatsapp { display: none !important; }
    body #aj-store-chat.aj-store-chat[data-open="true"] .aj-panel {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        height: min(440px, calc(var(--aj-visible-height, 100dvh) * .53));
        max-height: calc(var(--aj-visible-height, 100dvh) - var(--aj-dock-gap) - var(--aj-dock-top) - 6px);
    }
    body #aj-store-chat.aj-store-chat[data-open="true"][data-compact="true"] .aj-panel {
        height: min(330px, calc(var(--aj-visible-height, 100dvh) - var(--aj-dock-gap) - 12px));
    }
    body #aj-store-chat[data-open="true"] .aj-log {
        flex: 1 1 auto;
        min-height: 0;
        min-width: 0;
        max-height: none;
        overflow-x: hidden;
    }
    #aj-store-chat .aj-choices { align-self: stretch; min-width: 0; }
    #aj-store-chat .aj-choices button { min-width: 0; width: 100%; }
    #aj-store-chat .aj-choices button span { min-width: 0; }
    #aj-store-chat .aj-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; }
    #aj-store-chat .aj-form #aj-store-question { width: 100%; max-width: 100%; min-width: 0; font-size: 16px; }
    #aj-store-chat[data-compact="true"] .aj-suggestions { display: none; }
    #aj-store-chat[data-compact="true"] .aj-heading { padding-block: .35rem; }
    #aj-store-chat[data-compact="true"] .aj-current {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
@media (prefers-reduced-motion: reduce) {
    #aj-store-chat .aj-launcher { transition: none; }
}
