.hasbi-widget {
    position: fixed;
    z-index: 1190;
    right: 24px;
    bottom: 22px;
    width: 112px;
    height: 112px;
    pointer-events: none;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hasbi-orb {
    position: absolute;
    inset: 0;
    width: 112px;
    height: 112px;
    padding: 0;
    border: 0;
    border-radius: 44% 56% 48% 52% / 49% 44% 56% 51%;
    color: #fff;
    cursor: grab;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    background:
        radial-gradient(circle at 32% 23%, rgba(255, 255, 255, .55) 0 6%, transparent 7%),
        linear-gradient(145deg, #38d98a 0%, #13a967 48%, #087a55 100%);
    box-shadow:
        0 17px 38px rgba(5, 111, 72, .28),
        0 5px 12px rgba(7, 73, 51, .24),
        inset 0 2px 2px rgba(255, 255, 255, .42),
        inset 0 -7px 14px rgba(0, 83, 53, .18);
    transform-origin: 50% 75%;
    animation: hasbiFloat 4.2s ease-in-out infinite, hasbiHello 1s ease 1.2s 1;
    transition: filter .2s ease, box-shadow .2s ease;
}

.hasbi-orb:hover,
.hasbi-orb:focus-visible {
    filter: saturate(1.08) brightness(1.04);
    box-shadow:
        0 20px 44px rgba(5, 111, 72, .34),
        0 6px 14px rgba(7, 73, 51, .24),
        0 0 0 5px rgba(31, 196, 121, .13),
        inset 0 2px 2px rgba(255, 255, 255, .42);
    outline: 0;
}

.hasbi-widget.hasbi-dragging .hasbi-orb {
    cursor: grabbing;
    animation: none;
    filter: brightness(1.04);
    transform: scale(1.04) rotate(-2deg);
}

.hasbi-orb strong {
    position: absolute;
    left: 50%;
    bottom: 13px;
    transform: translateX(-50%);
    font-size: 14px;
    line-height: 1;
    letter-spacing: .025em;
    text-shadow: 0 1px 3px rgba(0, 62, 41, .32);
}

.hasbi-orb > small {
    position: absolute;
    right: 86px;
    top: 12px;
    width: max-content;
    padding: 7px 10px;
    border: 1px solid #d7efe3;
    border-radius: 12px 12px 3px 12px;
    color: #0a6f4d;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 22px rgba(11, 73, 52, .14);
    font-size: 11px;
    font-weight: 750;
    opacity: 0;
    transform: translateX(5px) scale(.96);
    transition: opacity .2s ease, transform .2s ease;
}

.hasbi-orb:hover > small,
.hasbi-orb:focus-visible > small {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.hasbi-widget.hasbi-left .hasbi-orb > small {
    right: auto;
    left: 86px;
    border-radius: 12px 12px 12px 3px;
}

.hasbi-face {
    position: absolute;
    inset: 18px 16px 30px;
}

.hasbi-eye {
    position: absolute;
    top: 9px;
    width: 25px;
    height: 31px;
    overflow: hidden;
    border-radius: 52% 48% 48% 52% / 58% 58% 42% 42%;
    background: #fff;
    box-shadow: inset 0 -3px 4px rgba(7, 91, 58, .12), 0 2px 3px rgba(0, 75, 50, .18);
    transform-origin: center;
    animation: hasbiBlink 5.4s infinite;
}

.hasbi-eye-left {
    left: 8px;
    transform: rotate(-3deg);
}

.hasbi-eye-right {
    right: 8px;
    transform: rotate(3deg);
}

.hasbi-eye i {
    position: absolute;
    left: 8px;
    top: 10px;
    width: 10px;
    height: 13px;
    border-radius: 50%;
    background: #123a30;
    box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .8);
}

.hasbi-smile {
    position: absolute;
    left: 50%;
    top: 41px;
    width: 36px;
    height: 20px;
    transform: translateX(-50%);
    border: 0;
    border-bottom: 7px solid #064d3a;
    border-radius: 0 0 50% 50%;
    filter: drop-shadow(0 2px 0 rgba(255, 255, 255, .18));
}

.hasbi-smile::after {
    content: "";
    position: absolute;
    left: 9px;
    bottom: -6px;
    width: 18px;
    height: 5px;
    border-radius: 50%;
    background: #ff8f9d;
}

.hasbi-cheek {
    position: absolute;
    top: 42px;
    width: 14px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 151, 166, .48);
}

.hasbi-cheek-left { left: 3px; transform: rotate(-8deg); }
.hasbi-cheek-right { right: 3px; transform: rotate(8deg); }

.hasbi-spark {
    position: absolute;
    color: #fff8a8;
    font-weight: 800;
    text-shadow: 0 1px 4px rgba(0, 83, 53, .25);
    animation: hasbiSpark 2.8s ease-in-out infinite;
}

.hasbi-spark-one {
    left: 8px;
    top: 15px;
    font-size: 12px;
}

.hasbi-spark-two {
    right: 10px;
    top: 20px;
    font-size: 18px;
    animation-delay: 1s;
}

.hasbi-panel {
    position: absolute;
    right: 0;
    bottom: 126px;
    display: flex;
    flex-direction: column;
    width: min(390px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 155px));
    min-height: 430px;
    overflow: hidden;
    border: 1px solid rgba(12, 124, 83, .18);
    border-radius: 24px;
    background: rgba(255, 255, 255, .985);
    box-shadow: 0 28px 70px rgba(6, 56, 40, .23), 0 8px 24px rgba(13, 96, 68, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.97);
    transform-origin: right bottom;
    transition: opacity .22s ease, visibility .22s ease, transform .22s ease;
    pointer-events: auto;
}

.hasbi-widget.hasbi-left .hasbi-panel {
    right: auto;
    left: 0;
    transform-origin: left bottom;
}

.hasbi-widget.hasbi-panel-below .hasbi-panel {
    top: 126px;
    bottom: auto;
    transform-origin: right top;
}

.hasbi-widget.hasbi-left.hasbi-panel-below .hasbi-panel {
    transform-origin: left top;
}

.hasbi-widget.hasbi-open .hasbi-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.hasbi-panel-head {
    display: grid;
    grid-template-columns: 46px 1fr 34px;
    gap: 10px;
    align-items: center;
    min-height: 72px;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(135deg, #087a55 0%, #15ad6b 72%, #34ce84 100%);
}

.hasbi-panel-head > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hasbi-panel-head strong {
    font-size: 17px;
    line-height: 1.2;
}

.hasbi-panel-head small {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 3px;
    color: rgba(255, 255, 255, .86);
    font-size: 11px;
}

.hasbi-panel-head small span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b9ffcf;
    box-shadow: 0 0 0 4px rgba(185, 255, 207, .15);
}

.hasbi-mini-face {
    position: relative;
    display: block;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, .38);
    border-radius: 43% 57% 52% 48%;
    background: #29c87e;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, .28);
}

.hasbi-mini-face i {
    position: absolute;
    top: 12px;
    width: 8px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    animation: hasbiMiniBlink 5.4s infinite;
}

.hasbi-mini-face i:first-child { left: 10px; }
.hasbi-mini-face i:nth-child(2) { right: 10px; }

.hasbi-mini-face b {
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 18px;
    height: 8px;
    transform: translateX(-50%);
    border-bottom: 3px solid #064d3a;
    border-radius: 0 0 50% 50%;
}

.hasbi-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.hasbi-close:hover,
.hasbi-close:focus-visible {
    background: rgba(255, 255, 255, .25);
    outline: 2px solid rgba(255, 255, 255, .5);
}

.hasbi-privacy {
    padding: 7px 14px;
    overflow: hidden;
    border-bottom: 1px solid #e4f2eb;
    color: #527064;
    background: #f4fbf7;
    font-size: 10.5px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hasbi-messages {
    flex: 1;
    min-height: 0;
    padding: 15px 13px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        radial-gradient(circle at 10% 20%, rgba(43, 202, 126, .06), transparent 32%),
        linear-gradient(#fbfefc, #f7fcf9);
    scrollbar-color: #b9ddcc transparent;
    scrollbar-width: thin;
}

.hasbi-message {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 0 12px;
    animation: hasbiMessageIn .2s ease both;
}

.hasbi-user-message {
    align-items: flex-end;
}

.hasbi-message-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border: 1px solid #dceee5;
    border-radius: 7px 17px 17px 17px;
    color: #17372c;
    background: #fff;
    box-shadow: 0 3px 10px rgba(13, 86, 61, .06);
    font-size: 13px;
    line-height: 1.48;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.hasbi-user-message .hasbi-message-bubble {
    border-color: #0d9162;
    border-radius: 17px 7px 17px 17px;
    color: #fff;
    background: linear-gradient(135deg, #0c8a5d, #16ad6d);
}

.hasbi-message-tools,
.hasbi-message-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 90%;
    margin-top: 6px;
}

.hasbi-message-tools button,
.hasbi-message-actions a,
.hasbi-message-actions button {
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #cce6da;
    border-radius: 9px;
    color: #08744f;
    background: #fff;
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.hasbi-message-tools button:hover,
.hasbi-message-actions a:hover,
.hasbi-message-actions button:hover {
    border-color: #59be92;
    background: #effaf4;
    transform: translateY(-1px);
}

.hasbi-typing .hasbi-message-bubble {
    display: flex;
    gap: 5px;
    align-items: center;
    min-width: 50px;
}

.hasbi-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1aac70;
    animation: hasbiTyping 1s infinite;
}

.hasbi-typing i:nth-child(2) { animation-delay: .14s; }
.hasbi-typing i:nth-child(3) { animation-delay: .28s; }

.hasbi-quick-actions {
    display: flex;
    gap: 6px;
    padding: 8px 11px;
    overflow-x: auto;
    border-top: 1px solid #e6f2ec;
    background: #fff;
    scrollbar-width: none;
}

.hasbi-quick-actions::-webkit-scrollbar { display: none; }

.hasbi-quick-actions button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 6px 9px;
    border: 1px solid #d6ebdf;
    border-radius: 999px;
    color: #23604a;
    background: #f6fcf9;
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
}

.hasbi-quick-actions button:hover {
    border-color: #75caa3;
    background: #eaf8f1;
}

.hasbi-form {
    display: grid;
    grid-template-columns: 1fr 40px;
    gap: 8px;
    align-items: end;
    padding: 10px 11px 5px;
    border-top: 1px solid #e4f0ea;
    background: #fff;
}

.hasbi-form textarea {
    width: 100%;
    min-height: 40px;
    max-height: 112px;
    margin: 0;
    padding: 9px 11px;
    resize: none;
    border: 1px solid #cfe3d9;
    border-radius: 13px;
    color: #18382d;
    background: #f9fcfa;
    box-shadow: none;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
}

.hasbi-form textarea:focus {
    border-color: #26aa75;
    outline: 3px solid rgba(38, 170, 117, .12);
    background: #fff;
}

.hasbi-form button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #0d8b5e, #1ab875);
    box-shadow: 0 5px 12px rgba(12, 139, 94, .22);
    cursor: pointer;
}

.hasbi-form button:disabled {
    opacity: .5;
    cursor: wait;
}

.hasbi-form button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hasbi-hint {
    display: block;
    padding: 0 13px 8px;
    color: #779087;
    background: #fff;
    font-size: 9.5px;
    text-align: center;
}

.hasbi-guide-highlight {
    position: relative !important;
    z-index: 1402 !important;
    border-radius: 10px !important;
    outline: 4px solid #39dd8f !important;
    outline-offset: 5px !important;
    box-shadow: 0 0 0 10px rgba(57, 221, 143, .18), 0 10px 30px rgba(4, 97, 62, .25) !important;
    animation: hasbiGuidePulse 1.15s ease-in-out infinite !important;
}

.hasbi-guide-callout {
    position: fixed;
    z-index: 1405;
    max-width: min(300px, calc(100vw - 24px));
    padding: 11px 13px;
    border: 1px solid rgba(8, 122, 85, .18);
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #087a55, #1ab775);
    box-shadow: 0 14px 34px rgba(5, 84, 56, .28);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    pointer-events: none;
    animation: hasbiMessageIn .25s ease both;
}

.hasbi-guide-callout::after {
    content: "";
    position: absolute;
    left: 22px;
    bottom: -8px;
    width: 15px;
    height: 15px;
    background: #119b65;
    transform: rotate(45deg);
}

.hasbi-guide-callout.hasbi-callout-below::after {
    top: -8px;
    bottom: auto;
}

@keyframes hasbiFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes hasbiHello {
    0%, 100% { transform: rotate(0) scale(1); }
    35% { transform: rotate(-8deg) scale(1.05); }
    65% { transform: rotate(7deg) scale(1.05); }
}

@keyframes hasbiBlink {
    0%, 43%, 47%, 76%, 80%, 100% { transform: scaleY(1); }
    45%, 78% { transform: scaleY(.08); }
}

@keyframes hasbiMiniBlink {
    0%, 44%, 47%, 78%, 81%, 100% { transform: scaleY(1); }
    45.5%, 79.5% { transform: scaleY(.08); }
}

@keyframes hasbiSpark {
    0%, 100% { opacity: .45; transform: scale(.8) rotate(0); }
    50% { opacity: 1; transform: scale(1.25) rotate(20deg); }
}

@keyframes hasbiTyping {
    0%, 60%, 100% { opacity: .35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes hasbiMessageIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes hasbiGuidePulse {
    0%, 100% { outline-color: #39dd8f; }
    50% { outline-color: #fff176; }
}

@media (max-width: 700px) {
    .hasbi-widget {
        right: 15px;
        bottom: 15px;
        width: 92px;
        height: 92px;
    }

    .hasbi-orb {
        width: 92px;
        height: 92px;
    }

    .hasbi-face {
        inset: 12px 10px 24px;
        transform: scale(.83);
    }

    .hasbi-orb strong {
        bottom: 10px;
        font-size: 12px;
    }

    .hasbi-panel,
    .hasbi-widget.hasbi-left .hasbi-panel,
    .hasbi-widget.hasbi-panel-below .hasbi-panel,
    .hasbi-widget.hasbi-left.hasbi-panel-below .hasbi-panel {
        position: fixed;
        inset: auto 8px 8px 8px;
        width: auto;
        height: min(680px, calc(100dvh - 16px));
        max-height: calc(100dvh - 16px);
        border-radius: 22px;
        transform-origin: center bottom;
    }

    .hasbi-widget.hasbi-open .hasbi-orb {
        opacity: 0;
        visibility: hidden;
    }

    .hasbi-privacy {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hasbi-orb,
    .hasbi-eye,
    .hasbi-mini-face i,
    .hasbi-spark,
    .hasbi-message,
    .hasbi-guide-highlight {
        animation: none !important;
    }

    .hasbi-panel {
        transition-duration: .01ms;
    }
}
