.amx-chatbot {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99999;
    font-family: 'Raleway', sans-serif;
    color: #2d2117;
}

.amx-chatbot__toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    padding: 0;
    border: 1px solid rgba(121, 88, 56, 0.22);
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), rgba(247, 238, 226, 0.96) 62%, rgba(233, 219, 199, 0.96) 100%);
    box-shadow: 0 18px 46px rgba(38, 24, 15, 0.18);
    backdrop-filter: blur(14px);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    overflow: hidden;
}

.amx-chatbot__toggle::before,
.amx-chatbot__toggle::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.amx-chatbot__toggle::before {
    border: 1px solid rgba(209, 174, 111, 0.28);
}

.amx-chatbot__toggle::after {
    inset: 4px;
    background: conic-gradient(
        from 0deg,
        rgba(224, 188, 110, 0) 0deg 286deg,
        rgba(244, 208, 128, 1) 286deg 326deg,
        rgba(224, 188, 110, 0.82) 326deg 344deg,
        rgba(224, 188, 110, 0) 344deg 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
    filter: drop-shadow(0 0 9px rgba(219, 180, 101, 0.35));
    transform-origin: center;
    will-change: transform;
    animation: amxChatbotTrace 1.25s linear infinite;
}

.amx-chatbot__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 54px rgba(38, 24, 15, 0.24);
}

.amx-chatbot__toggle-word,
.amx-chatbot__toggle-logo {
    position: absolute;
    inset: 0;
    margin: auto;
    z-index: 1;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.amx-chatbot__toggle-word.is-visible,
.amx-chatbot__toggle-logo.is-visible {
    opacity: 1;
    transform: scale(1);
}

.amx-chatbot__toggle-word {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #5a3c22;
    text-shadow: 0 4px 12px rgba(90, 60, 34, 0.12);
}

.amx-chatbot__toggle-logo {
    display: block;
    width: 82%;
    height: 82%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 10px 18px rgba(58, 35, 16, 0.22));
}

@keyframes amxChatbotTrace {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.amx-chatbot__panel {
    position: absolute;
    right: 0;
    bottom: 112px;
    width: min(356px, calc(100vw - 28px));
    height: min(528px, calc(100vh - 118px));
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    border: 1px solid rgba(130, 96, 63, 0.2);
    border-radius: 32px;
    background:
        radial-gradient(circle at top right, rgba(224, 184, 122, 0.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.66), transparent 34%),
        linear-gradient(180deg, rgba(255, 251, 244, 0.985), rgba(245, 235, 222, 0.975));
    box-shadow: 0 34px 82px rgba(25, 16, 10, 0.26);
    backdrop-filter: blur(18px);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(18px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.amx-chatbot__panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.amx-chatbot__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 1rem 1rem 0.92rem;
    border-bottom: 1px solid rgba(255, 228, 191, 0.12);
    background:
        radial-gradient(circle at top right, rgba(227, 191, 137, 0.22), transparent 34%),
        linear-gradient(135deg, rgba(92, 63, 39, 0.98), rgba(56, 37, 24, 0.96));
}

.amx-chatbot__identity {
    display: flex;
    align-items: flex-start;
    gap: 0.78rem;
    min-width: 0;
}

.amx-chatbot__avatar {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.98), rgba(247, 237, 224, 0.96) 68%, rgba(228, 208, 181, 0.96) 100%);
    border: 1px solid rgba(255, 230, 194, 0.34);
    box-shadow: 0 14px 26px rgba(16, 10, 6, 0.22);
}

.amx-chatbot__avatar img {
    width: 74%;
    height: 74%;
    object-fit: contain;
}

.amx-chatbot__header-copy {
    min-width: 0;
}

.amx-chatbot__eyebrow {
    margin-bottom: 0.2rem;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(246, 228, 204, 0.78);
}

.amx-chatbot__name {
    font-family: 'Playfair Display', serif;
    font-size: 1.26rem;
    font-weight: 700;
    color: #fff7ed;
}

.amx-chatbot__status {
    margin-top: 0.22rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(249, 236, 218, 0.76);
}

.amx-chatbot__header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.amx-chatbot__icon-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 229, 195, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff6eb;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.amx-chatbot__icon-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 229, 195, 0.22);
    transform: translateY(-1px);
}

.amx-chatbot__messages {
    padding: 0.88rem 0.88rem 0.5rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    background:
        radial-gradient(circle at top left, rgba(230, 194, 142, 0.1), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 10%),
        linear-gradient(180deg, rgba(250, 244, 236, 0.98), rgba(246, 236, 223, 0.98));
}

.amx-chatbot__message {
    display: flex;
    margin-bottom: 0.5rem;
}

.amx-chatbot__message--greeting {
    align-items: flex-end;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}

.amx-chatbot__message--user {
    justify-content: flex-end;
}

.amx-chatbot__greeting-fox {
    position: relative;
    flex: 0 0 68px;
    min-width: 68px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0.12rem;
}

.amx-chatbot__greeting-fox::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.1rem;
    width: 52px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(178, 132, 76, 0.24) 0%, rgba(178, 132, 76, 0) 72%);
    transform: translateX(-50%);
    filter: blur(5px);
}

.amx-chatbot__greeting-fox img {
    position: relative;
    z-index: 1;
    width: 72px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 14px 20px rgba(78, 50, 25, 0.18));
}

.amx-chatbot__bubble {
    max-width: min(84%, 17.75rem);
    padding: 0.86rem 0.94rem;
    border-radius: 20px;
    font-size: 0.9rem;
    line-height: 1.58;
    white-space: normal;
}

.amx-chatbot__message--assistant .amx-chatbot__bubble {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 244, 0.88));
    border: 1px solid rgba(139, 107, 74, 0.12);
    color: #2f2318;
    border-top-left-radius: 10px;
    box-shadow: 0 14px 28px rgba(72, 50, 29, 0.08);
}

.amx-chatbot__message--greeting .amx-chatbot__bubble {
    position: relative;
    max-width: min(79%, 16.8rem);
    padding: 0.96rem 1rem;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 249, 240, 0.92));
    box-shadow: 0 18px 32px rgba(72, 50, 29, 0.08);
}

.amx-chatbot__message--greeting .amx-chatbot__bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 1rem;
    width: 18px;
    height: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 249, 240, 0.92));
    border-left: 1px solid rgba(139, 107, 74, 0.12);
    border-bottom: 1px solid rgba(139, 107, 74, 0.12);
    border-bottom-left-radius: 5px;
    transform: rotate(45deg);
}

.amx-chatbot__message--user .amx-chatbot__bubble {
    background: linear-gradient(180deg, #5c3f27 0%, #3c2819 100%);
    color: #fff8ef;
    border-top-right-radius: 10px;
    box-shadow: 0 14px 28px rgba(35, 22, 13, 0.2);
}

.amx-chatbot__bubble p {
    margin: 0;
}

.amx-chatbot__bubble p + p {
    margin-top: 0.72rem;
}

.amx-chatbot__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.48rem;
    margin-top: 0.78rem;
}

.amx-chatbot__action {
    border: 1px solid rgba(175, 127, 76, 0.22);
    border-radius: 999px;
    background: rgba(255, 251, 244, 0.96);
    color: #543a23;
    padding: 0.5rem 0.78rem;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.amx-chatbot__action:hover {
    transform: translateY(-1px);
    background: rgba(246, 233, 211, 0.98);
}

.amx-chatbot__message-meta {
    margin: -0.04rem 0 0.64rem;
    padding: 0 0.12rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(94, 69, 45, 0.38);
}

.amx-chatbot__message--greeting + .amx-chatbot__message-meta {
    padding-left: 4.6rem;
}

.amx-chatbot__message--user + .amx-chatbot__message-meta {
    text-align: right;
}

.amx-chatbot__typing {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.amx-chatbot__typing span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgba(120, 89, 58, 0.38);
    animation: amx-chatbot-typing 1s infinite ease-in-out;
}

.amx-chatbot__typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.amx-chatbot__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

.amx-chatbot__suggestions {
    display: grid;
    gap: 0.64rem;
    padding: 0.08rem 0.82rem 0.82rem;
    background: linear-gradient(180deg, rgba(246, 236, 223, 0), rgba(246, 236, 223, 0.94));
}

.amx-chatbot__suggestions.is-empty {
    display: none;
}

.amx-chatbot__suggestion-heading {
    padding: 0 0.1rem;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(94, 69, 45, 0.46);
}

.amx-chatbot__suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.58rem;
}

.amx-chatbot__suggestion {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 46px;
    border: 1px solid rgba(139, 107, 74, 0.14);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 251, 244, 0.8));
    color: #4c3520;
    padding: 0.68rem 0.82rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: none;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(88, 57, 31, 0.05);
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.amx-chatbot__suggestion:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 14px 24px rgba(88, 57, 31, 0.08);
}

.amx-chatbot__composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.66rem;
    padding: 0.78rem 0.82rem 0.82rem;
    border-top: 1px solid rgba(139, 107, 74, 0.1);
    background: rgba(255, 252, 246, 0.96);
}

.amx-chatbot__input {
    width: 100%;
    min-height: 50px;
    border: 1px solid rgba(139, 107, 74, 0.22);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    padding: 0.82rem 0.92rem;
    color: #2f2318;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.amx-chatbot__input::placeholder {
    color: rgba(83, 59, 38, 0.52);
}

.amx-chatbot__input:focus {
    border-color: rgba(175, 127, 76, 0.54);
    box-shadow: 0 0 0 4px rgba(175, 127, 76, 0.14);
}

.amx-chatbot__send {
    min-width: 108px;
    min-height: 50px;
    border: 0;
    border-radius: 20px;
    background: linear-gradient(180deg, #5a3d27 0%, #342215 100%);
    color: #fff8ef;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.amx-chatbot__send:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(46, 31, 21, 0.22);
    filter: brightness(1.05);
}

@keyframes amx-chatbot-typing {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

@media (max-width: 640px) {
    .amx-chatbot {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
    }

    .amx-chatbot__toggle {
        width: 78px;
        height: 78px;
        box-shadow: 0 16px 36px rgba(38, 24, 15, 0.2);
    }

    .amx-chatbot__panel {
        position: fixed;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: 380px;
        height: min(74dvh, 560px);
        bottom: calc(max(12px, env(safe-area-inset-bottom)) + 88px);
        margin-left: auto;
        border-radius: 28px;
    }

    .amx-chatbot__header {
        padding: 0.92rem 0.92rem 0.88rem;
    }

    .amx-chatbot__avatar {
        width: 50px;
        height: 50px;
        border-radius: 18px;
    }

    .amx-chatbot__name {
        font-size: 1.1rem;
    }

    .amx-chatbot__greeting-fox {
        flex-basis: 58px;
        min-width: 58px;
    }

    .amx-chatbot__greeting-fox img {
        width: 62px;
    }

    .amx-chatbot__message--greeting .amx-chatbot__bubble {
        max-width: min(80%, 15.4rem);
    }

    .amx-chatbot__message--greeting + .amx-chatbot__message-meta {
        padding-left: 4rem;
    }

    .amx-chatbot__suggestion-grid {
        grid-template-columns: 1fr;
    }

    .amx-chatbot__composer {
        grid-template-columns: 1fr;
        padding-bottom: calc(0.82rem + env(safe-area-inset-bottom));
    }

    .amx-chatbot__send {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .amx-chatbot {
        right: max(8px, env(safe-area-inset-right));
        bottom: max(8px, env(safe-area-inset-bottom));
    }

    .amx-chatbot__panel {
        left: 8px;
        right: 8px;
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + 82px);
        height: min(76dvh, 540px);
        border-radius: 24px;
    }

    .amx-chatbot__bubble {
        font-size: 0.86rem;
    }

    .amx-chatbot__message--greeting {
        gap: 0.45rem;
    }

    .amx-chatbot__message--greeting .amx-chatbot__bubble {
        max-width: min(82%, 14.2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .amx-chatbot *,
    .amx-chatbot *::before,
    .amx-chatbot *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }

    .amx-chatbot__toggle::after {
        animation: amxChatbotTrace 1.25s linear infinite !important;
    }
}
