#icewin-chat-fab.icewin-chat-fab-hidden {
    display: none !important;
}

#icewin-chat-fab {
    position: fixed;
    right: 16px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    z-index: 99990;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--icewin-chat-primary, #2563eb);
    color: #fff;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#icewin-chat-fab:hover {
    transform: scale(1.05);
}

#icewin-chat-fab svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

#icewin-chat-fab .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    display: none;
}

#icewin-chat-fab.has-unread .badge-dot {
    display: block;
}

#icewin-chat-panel {
    position: fixed;
    right: 16px;
    bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    z-index: 99991;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 120px));
    background: var(--icewin-chat-bg, #ffffff);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

#icewin-chat-panel.open {
    display: flex;
}

#icewin-chat-panel .chat-head {
    background: var(--icewin-chat-primary, #2563eb);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#icewin-chat-panel .chat-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#icewin-chat-panel .chat-head p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

#icewin-chat-panel .chat-head button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

#icewin-chat-closed-banner {
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    line-height: 1.4;
    padding: 10px 14px;
    border-bottom: 1px solid #fde68a;
    text-align: center;
}

#icewin-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: var(--icewin-chat-messages-bg, #f8fafc);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

#icewin-chat-messages::-webkit-scrollbar {
    width: 6px;
}

#icewin-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

#icewin-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#icewin-chat-messages .msg {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

#icewin-chat-messages .msg.user {
    margin-left: auto;
    background: var(--icewin-chat-primary, #2563eb);
    color: #fff;
    border-bottom-right-radius: 4px;
}

#icewin-chat-messages .msg.bot,
#icewin-chat-messages .msg.admin {
    margin-right: auto;
    background: #fff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

#icewin-chat-messages .msg .who {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

#icewin-chat-messages .chat-placeholder {
    text-align: center;
    color: #64748b;
    padding: 40px 16px;
    font-size: 14px;
}

#icewin-chat-compose {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

#icewin-chat-compose textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    resize: none;
    min-height: 42px;
    max-height: 100px;
    font-family: inherit;
    font-size: 14px;
}

#icewin-chat-compose button {
    border: none;
    border-radius: 10px;
    background: var(--icewin-chat-primary, #2563eb);
    color: #fff;
    width: 44px;
    cursor: pointer;
    font-size: 18px;
}

#icewin-chat-compose button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
