#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 { text-align: start; border-radius: .6rem; overflow-wrap: anywhere; }
#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 (prefers-reduced-motion: reduce) {
    #aj-store-chat .aj-launcher { transition: none; }
}
