.ister-bot-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    /*background: var(--bot-color, #0169b3);*/
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(16, 37, 66, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483646;
    transition: transform .25s ease, opacity .25s ease;
    padding: 0;
    overflow: hidden;
    font-size: 24px;
}

.ister-bot-fab:hover {
    transform: scale(1.06);
}

.ister-bot-fab img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ister-bot-fab.ister-bot-hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.ister-bot-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 380px;
    height: 620px;
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(16, 37, 66, .25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2147483647;
    transform: translateY(20px) scale(.96);
    opacity: 0;
    pointer-events: none;
    transition: transform .28s ease, opacity .28s ease;
}

.ister-bot-panel.ister-bot-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.ister-bot-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #fff;
    background: var(--bot-color, #0169b3);
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.ister-bot-header .ister-bot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    font-size: 16px;
}

.ister-bot-header .ister-bot-avatar:has(> i) {
    background: rgba(255, 255, 255, .18);
}

.ister-bot-header .ister-bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ister-bot-header .ister-bot-titles {
    flex: 1;
    min-width: 0;
}

.ister-bot-header .ister-bot-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ister-bot-header .ister-bot-sub {
    font-size: 11px;
    opacity: .85;
    font-weight: 400;
    margin-top: 2px;
}

.ister-bot-header .ister-bot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    line-height: 1;
}

.ister-bot-header .ister-bot-close:hover {
    background: rgba(255, 255, 255, .18);
}

.ister-bot-frame {
    flex: 1;
    border: none;
    width: 100%;
    background: #e8edf5;
}

@media (max-width: 768px) {
    .ister-bot-panel {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .ister-bot-fab {
        bottom: calc(14px + env(safe-area-inset-bottom));
        right: 14px;
        width: 48px;
        height: 48px;
        font-size: 20px;
        box-shadow: 0 6px 18px rgba(16, 37, 66, .22);
    }

    .ister-bot-header {
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top));
    }

    .ister-bot-header .ister-bot-avatar {
        width: 32px;
        height: 32px;
    }

    .ister-bot-header .ister-bot-title {
        font-size: 14px;
    }

    .ister-bot-header .ister-bot-sub {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .ister-bot-fab {
        width: 44px;
        height: 44px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        right: 10px;
        font-size: 18px;
    }
}

.ister-bot-greeting {
    position: fixed;
    bottom: 96px;
    right: 24px;
    max-width: 280px;
    background: #fff;
    color: #1f2937;
    border-radius: 16px;
    padding: 12px 36px 12px 14px;
    box-shadow: 0 12px 30px rgba(16, 37, 66, .18), 0 2px 6px rgba(16, 37, 66, .08);
    z-index: 2147483645;
    font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(20px) scale(.85);
    pointer-events: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
    cursor: pointer;
}

.ister-bot-greeting::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 26px;
    width: 14px;
    height: 14px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 2px 2px 4px rgba(16, 37, 66, .06);
}

.ister-bot-greeting.ister-bot-greeting-show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: ister-bot-wiggle 2.4s ease-in-out 1.2s 3;
}

.ister-bot-greeting:hover {
    transform: translateY(-2px) scale(1.02);
    animation: none;
}

.ister-bot-greeting-bubble strong {
    display: block;
    color: #0f172a;
    margin-bottom: 2px;
    font-weight: 700;
}

.ister-bot-greeting-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.ister-bot-greeting-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.ister-bot-fab.ister-bot-fab-attention {
    animation: ister-bot-pulse 1.8s ease-in-out 0.4s 4;
}

@keyframes ister-bot-wiggle {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
    20% { transform: translateY(-3px) scale(1.02) rotate(-1.5deg); }
    40% { transform: translateY(0) scale(1) rotate(1.5deg); }
    60% { transform: translateY(-2px) scale(1.01) rotate(-0.8deg); }
    80% { transform: translateY(0) scale(1) rotate(0.5deg); }
}

@keyframes ister-bot-pulse {
    0%, 100% { box-shadow: 0 10px 30px rgba(16, 37, 66, .25), 0 0 0 0 var(--bot-color, #0169b3); }
    50% { box-shadow: 0 10px 30px rgba(16, 37, 66, .25), 0 0 0 14px rgba(1, 105, 179, 0); }
}

@media (max-width: 768px) {
    .ister-bot-greeting {
        bottom: 78px;
        right: 14px;
        max-width: calc(100vw - 28px);
        font-size: 13px;
    }

    .ister-bot-greeting::after {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .ister-bot-greeting {
        bottom: 64px;
        right: 10px;
        max-width: calc(100vw - 20px);
        padding: 10px 32px 10px 12px;
        font-size: 12.5px;
    }

    .ister-bot-greeting::after {
        right: 14px;
    }
}
