.mc-ai-floating {
    align-items: center;
    bottom: 24px;
    display: flex;
    gap: 10px;
    position: fixed;
    right: 24px;
    z-index: 1040;
}

.mc-ai-launcher {
    align-items: center;
    background: linear-gradient(145deg, #7655d9, #5b38bd);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(91, 56, 189, .3);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    height: 56px;
    justify-content: center;
    transition: box-shadow .2s ease, transform .2s ease;
    width: 56px;
}

.mc-ai-launcher:hover { box-shadow: 0 12px 30px rgba(91, 56, 189, .4); transform: translateY(-2px); }
.mc-ai-launcher:focus-visible, .mc-ai-close:focus-visible, .mc-ai-send:focus-visible, .mc-ai-suggestions button:focus-visible, .mc-ai-compose textarea:focus-visible { outline: 3px solid rgba(112, 79, 210, .28); outline-offset: 2px; }
.mc-ai-launcher.is-attending { animation: mc-ai-pulse 1.4s ease-in-out 2; }
.mc-ai-launcher .material-symbols-rounded { font-size: 27px; }

.mc-ai-attention {
    background: #fff;
    border: 1px solid rgba(91, 56, 189, .14);
    border-radius: 999px;
    box-shadow: 0 7px 22px rgba(31, 27, 46, .13);
    color: #4f378f;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 13px;
    transform: translateX(0);
    transition: opacity .25s ease, transform .25s ease;
    white-space: nowrap;
}

.mc-ai-attention.is-hiding { opacity: 0; transform: translateX(8px); }

.mc-ai-chat {
    background: #fff;
    border: 1px solid rgba(35, 28, 54, .1);
    border-radius: 18px;
    bottom: 92px;
    box-shadow: 0 20px 55px rgba(31, 27, 46, .2);
    display: flex;
    flex-direction: column;
    height: min(570px, calc(100dvh - 116px));
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    position: fixed;
    right: 24px;
    transform: translateY(12px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .18s ease, transform .18s ease;
    visibility: hidden;
    width: min(400px, calc(100vw - 48px));
    z-index: 1040;
}

.mc-ai-chat.is-open { opacity: 1; pointer-events: auto; transform: none; visibility: visible; }
.mc-ai-header { align-items: center; border-bottom: 1px solid #eeeaf5; display: flex; justify-content: space-between; padding: 14px 16px; }
.mc-ai-identity { align-items: center; display: flex; gap: 10px; }
.mc-ai-identity > span:last-child { display: flex; flex-direction: column; }
.mc-ai-identity strong { color: #282137; font-size: 15px; line-height: 1.35; }
.mc-ai-identity small { align-items: center; color: #777080; display: flex; font-size: 11px; gap: 5px; margin-top: 1px; }
.mc-ai-identity small i { background: #37ad72; border-radius: 50%; height: 7px; width: 7px; }
.mc-ai-avatar { align-items: center; background: #f0ebff; border-radius: 10px; color: #6744c7; display: inline-flex; font-size: 20px; height: 36px; justify-content: center; width: 36px; }
.mc-ai-close { align-items: center; background: transparent; border: 0; border-radius: 8px; color: #777080; cursor: pointer; display: inline-flex; height: 34px; justify-content: center; width: 34px; }
.mc-ai-close:hover { background: #f5f3f8; color: #312942; }

.mc-ai-body { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.mc-ai-empty { align-items: center; display: flex; flex-direction: column; height: 100%; justify-content: center; padding: 24px; text-align: center; }
.mc-ai-empty[hidden] { display: none; }
.mc-ai-empty-icon { align-items: center; background: #f0ebff; border-radius: 16px; color: #6744c7; display: inline-flex; font-size: 27px; height: 52px; justify-content: center; width: 52px; }
.mc-ai-empty p { color: #4a4354; font-size: 14px; line-height: 1.55; margin: 14px 0 16px; max-width: 320px; }
.mc-ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mc-ai-suggestions button { background: #faf8ff; border: 1px solid #ded4f7; border-radius: 999px; color: #59419a; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.3; padding: 8px 11px; }
.mc-ai-suggestions button:hover { background: #f0ebff; border-color: #c9b8f2; }

.mc-ai-history { height: 100%; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.mc-ai-history:empty { display: none; }
.mc-ai-message { display: flex; margin-bottom: 10px; }
.mc-ai-message > span { border-radius: 14px; font-size: 13px; line-height: 1.55; max-width: 84%; overflow-wrap: anywhere; padding: 9px 12px; white-space: pre-wrap; }
.mc-ai-message--user { justify-content: flex-end; }
.mc-ai-message--user > span { background: #6a48c8; border-bottom-right-radius: 5px; color: #fff; }
.mc-ai-message--assistant { justify-content: flex-start; }
.mc-ai-message--assistant > span { background: #f4f2f7; border-bottom-left-radius: 5px; color: #37313f; }
.mc-ai-message--assistant.is-typing > span { color: #8b8492; font-style: italic; }

.mc-ai-error { background: #fff3f1; border-radius: 8px; color: var(--color-danger, #b42318); font-size: 12px; margin: 0 14px 8px; padding: 8px 10px; }
.mc-ai-compose { align-items: flex-end; background: #fff; border-top: 1px solid #eeeaf5; display: flex; gap: 8px; padding: 11px 12px; }
.mc-ai-compose textarea { border: 1px solid #dcd7e4; border-radius: 12px; flex: 1; font: inherit; font-size: 13px; line-height: 1.4; max-height: 104px; min-height: 40px; padding: 10px 12px; resize: none; }
.mc-ai-compose textarea:focus { border-color: #8062d6; }
.mc-ai-send { align-items: center; background: #6744c7; border: 0; border-radius: 11px; color: #fff; cursor: pointer; display: inline-flex; flex: 0 0 40px; height: 40px; justify-content: center; }
.mc-ai-send:disabled { cursor: default; opacity: .55; }
.mc-ai-send .material-symbols-rounded { font-size: 20px; }

@keyframes mc-ai-pulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(91, 56, 189, .3); transform: scale(1); }
    50% { box-shadow: 0 10px 30px rgba(91, 56, 189, .52), 0 0 0 7px rgba(112, 79, 210, .1); transform: scale(1.035); }
}

@media (max-width: 575.98px) {
    .mc-ai-floating { bottom: 16px; right: 16px; }
    .mc-ai-chat { bottom: 82px; height: min(620px, calc(100dvh - 98px)); right: 12px; width: calc(100vw - 24px); }
    .mc-ai-empty { padding: 20px 16px; }
    .mc-ai-message > span { max-width: 89%; }
}

@media (prefers-reduced-motion: reduce) {
    .mc-ai-launcher, .mc-ai-attention, .mc-ai-chat { animation: none !important; transition: none; }
    .mc-ai-history { scroll-behavior: auto; }
}
