#alctw-root, #alctw-root * { box-sizing: border-box; }

.alctw-root {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 999999;
    font-family: Tahoma, Arial, sans-serif;
}

.alctw-toggle {
    border: 0;
    border-radius: 999px;
    padding: 0 20px;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg,#0e4b8b,#082d58);
    color: #fff;
    box-shadow: 0 14px 36px rgba(8,45,88,.28);
    cursor: pointer;
}

.alctw-panel {
    position: absolute;
    left: 0;
    bottom: 70px;
    width: min(380px, calc(100vw - 28px));
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: .2s ease;
}

.alctw-root.open .alctw-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.alctw-header {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg,#0e4b8b,#082d58);
    color: #fff;
}

.alctw-header strong,
.alctw-header small {
    display: block;
}

.alctw-header small {
    margin-top: 4px;
    opacity: .8;
    font-size: 11px;
}

.alctw-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.alctw-body {
    padding: 16px;
    background: #f7f9fc;
}

.alctw-start-form label {
    display: block;
    margin: 10px 0 6px;
    font-size: 12px;
    font-weight: 700;
}

.alctw-start-form input,
.alctw-message-form textarea {
    width: 100%;
    border: 1px solid #dbe3ec;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    outline: 0;
}

.alctw-start-form button,
.alctw-message-form button {
    border: 0;
    border-radius: 12px;
    background: #d7aa4b;
    font-weight: 800;
    cursor: pointer;
}

.alctw-start-form button {
    width: 100%;
    padding: 12px;
    margin-top: 14px;
}

.alctw-error,
.alctw-status {
    min-height: 18px;
    margin-top: 7px;
    color: #b42318;
    font-size: 11px;
}

.alctw-messages {
    height: 300px;
    overflow-y: auto;
    padding: 4px 2px 12px;
}

.alctw-message {
    max-width: 86%;
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.alctw-message.support {
    margin-left: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-right-radius: 4px;
}

.alctw-message.customer {
    margin-right: auto;
    background: #0e4b8b;
    color: #fff;
    border-bottom-left-radius: 4px;
}

.alctw-message-form {
    display: grid;
    grid-template-columns: 1fr 72px;
    gap: 8px;
    align-items: end;
}

.alctw-message-form textarea {
    resize: vertical;
    min-height: 48px;
    max-height: 120px;
}

.alctw-message-form button {
    height: 48px;
}

@media (max-width:520px) {
    .alctw-root {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    .alctw-panel {
        width: 100%;
    }

    .alctw-toggle {
        margin-right: auto;
        width: 56px;
        padding: 0;
        justify-content: center;
    }

    .alctw-toggle b {
        display: none;
    }
}


.alctw-toggle {
    position: relative;
    overflow: visible;
    animation: alctw-button-float 3.2s ease-in-out infinite;
}

.alctw-toggle-icon {
    position: relative;
    z-index: 2;
    font-size: 22px;
}

.alctw-pulse-ring {
    position: absolute;
    inset: -5px;
    border: 2px solid rgba(14, 75, 139, .48);
    border-radius: 999px;
    pointer-events: none;
    animation: alctw-pulse-ring 2s ease-out infinite;
}

.alctw-notification-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #e53935;
    box-shadow: 0 0 0 0 rgba(229, 57, 53, .55);
    animation: alctw-dot-pulse 1.5s infinite;
}

.alctw-notification-dot.hidden {
    display: none;
}

.alctw-attention-bubble {
    position: absolute;
    left: 0;
    bottom: 70px;
    min-width: 245px;
    padding: 11px 14px;
    border: 1px solid rgba(14, 75, 139, .12);
    border-radius: 14px 14px 4px 14px;
    background: #fff;
    color: #17324d;
    box-shadow: 0 12px 36px rgba(8, 45, 88, .18);
    font-size: 13px;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(.96);
    transition: .3s ease;
    pointer-events: none;
}

.alctw-attention-bubble.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: alctw-bubble-nudge 1s ease 2;
}

.alctw-attention-bubble::after {
    content: "";
    position: absolute;
    left: 22px;
    bottom: -8px;
    width: 15px;
    height: 15px;
    background: #fff;
    border-right: 1px solid rgba(14, 75, 139, .12);
    border-bottom: 1px solid rgba(14, 75, 139, .12);
    transform: rotate(45deg);
}

.alctw-message-form textarea {
    resize: none;
}

@keyframes alctw-pulse-ring {
    0% {
        opacity: .8;
        transform: scale(.92);
    }
    70% {
        opacity: 0;
        transform: scale(1.18);
    }
    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

@keyframes alctw-dot-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, .55);
    }
    70% {
        box-shadow: 0 0 0 9px rgba(229, 57, 53, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
    }
}

@keyframes alctw-button-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes alctw-bubble-nudge {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.01);
    }
}

@media (prefers-reduced-motion: reduce) {
    .alctw-toggle,
    .alctw-pulse-ring,
    .alctw-notification-dot,
    .alctw-attention-bubble.show {
        animation: none !important;
    }
}
