.h2o-ai-agent {
    z-index: 2147483647 !important;
}

.h2o-ai-agent__button {
    z-index: 2147483647;
    isolation: isolate;
}

.h2o-ai-agent__lottie {
    position: relative;
    z-index: 1;
}

.h2o-ai-agent__bubble {
    border: 0;
    border-radius: 58% 42% 51% 49% / 47% 56% 44% 53%;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .16), 0 3px 10px rgba(15, 23, 42, .08);
}

.h2o-ai-agent__bubble::before {
    top: calc(100% - 5px);
    left: 54%;
    width: 22px;
    height: 24px;
    background: #fff;
    clip-path: polygon(0 0, 100% 0, 28% 100%);
    filter: drop-shadow(4px 6px 5px rgba(15, 23, 42, .14));
    transform: translateX(-50%) rotate(12deg);
}

.h2o-ai-agent__bubble::after { display: none; }

.h2o-ai-agent__chat {
    z-index: 2147483647;
    isolation: isolate;
    left: calc(100% - 14px);
    right: auto;
    width: min(390px, calc(100vw - 32px));
    max-height: min(440px, calc(100vh - 28px));
}

.h2o-ai-agent__chat::before {
    z-index: 0;
    filter: drop-shadow(0 18px 34px rgba(15, 23, 42, .18)) drop-shadow(0 3px 10px rgba(15, 23, 42, .14));
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 500' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M90 22C170 0 290 8 352 52C396 83 390 148 389 214C388 282 400 353 380 414C358 481 288 510 208 508C130 510 66 488 40 438C18 395 28 339 55 286C35 279 16 265 5 245C32 242 51 228 63 207C51 166 49 117 59 79C66 50 76 32 90 22Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 500' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M90 22C170 0 290 8 352 52C396 83 390 148 389 214C388 282 400 353 380 414C358 481 288 510 208 508C130 510 66 488 40 438C18 395 28 339 55 286C35 279 16 265 5 245C32 242 51 228 63 207C51 166 49 117 59 79C66 50 76 32 90 22Z'/%3E%3C/svg%3E");
}

.h2o-ai-agent__chat > * { position: relative; z-index: 1; }
.h2o-ai-agent__messages {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 250px;
    padding: 24px 34px 2px 62px;
}

.h2o-ai-agent__message {
    box-sizing: border-box;
    margin-bottom: 4px;
    padding: 20px;
    font-size: 17px;
    line-height: 1.5;
    border-radius: 19px 15px 20px 14px / 17px 19px 15px 20px;
    transition: opacity 180ms ease, transform 180ms ease;
}

.h2o-ai-agent__message--assistant { padding: 20px; background: transparent; }
.h2o-ai-agent__chat-status {
    min-height: 0;
    padding: 0 34px 2px 62px;
}
.h2o-ai-agent__chat-status:empty { display: none; }

.h2o-ai-agent__choices {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 4px 34px 28px 62px;
}

.h2o-ai-agent__choices[hidden], .h2o-ai-agent__form[hidden] { display: none !important; }

.h2o-ai-agent__choice {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 20px;
    border: 1px solid rgba(15, 23, 42, .13);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .06);
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    opacity: 1;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.h2o-ai-agent__choice:hover, .h2o-ai-agent__choice:focus-visible { background: #fff; box-shadow: 0 5px 14px rgba(15, 23, 42, .10); transform: translateY(-1px); }
.h2o-ai-agent__choice:focus-visible { outline: 2px solid rgba(59, 130, 246, .35); outline-offset: 2px; }

.h2o-ai-agent__form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 4px 34px 28px 62px;
    border-top: 0;
    box-shadow: none;
}
.h2o-ai-agent__fields { display: flex; flex-direction: column; gap: 9px; }
.h2o-ai-agent__field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; line-height: 1.35; }
.h2o-ai-agent__field > span { display: block; }
.h2o-ai-agent__input {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    flex: 0 0 auto;
    border: 0;
    border-radius: 15px;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .13), 0 3px 10px rgba(15, 23, 42, .05);
    opacity: 1;
}
.h2o-ai-agent__send {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border: 0;
    border-radius: 14px;
    background: #172033;
    box-shadow: 0 5px 14px rgba(15, 23, 42, .14);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .h2o-ai-agent__message { transition: none; }
}

@media (max-width: 760px) {
    .h2o-ai-agent__chat { left: 12px; right: 12px; width: auto; bottom: 12px; max-height: min(54vh, 440px); }
    .h2o-ai-agent__chat::before {
        z-index: 0;
        filter: drop-shadow(0 14px 28px rgba(15, 23, 42, .16)) drop-shadow(0 3px 9px rgba(15, 23, 42, .12));
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 500' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M78 22C150 3 278 8 345 48C390 75 394 135 388 204C384 270 398 348 384 410C369 470 310 503 232 510C154 518 84 500 48 456C19 421 24 363 40 310C49 280 52 249 47 218C42 169 47 117 58 79C65 49 73 31 78 22Z'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 500' preserveAspectRatio='none'%3E%3Cpath fill='black' d='M78 22C150 3 278 8 345 48C390 75 394 135 388 204C384 270 398 348 384 410C369 470 310 503 232 510C154 518 84 500 48 456C19 421 24 363 40 310C49 280 52 249 47 218C42 169 47 117 58 79C65 49 73 31 78 22Z'/%3E%3C/svg%3E");
    }
    .h2o-ai-agent__messages { min-height: 0; max-height: 220px; padding: 20px 32px 2px 44px; }
    .h2o-ai-agent__chat-status { min-height: 0; padding: 0 32px 2px 44px; }
    .h2o-ai-agent__choices { gap: 7px; padding: 4px 32px 26px 44px; }
    .h2o-ai-agent__form { gap: 9px; padding: 4px 32px 26px 44px; }
}
