.ct-chat,
.ct-chat * { box-sizing: border-box; }

.ct-chat-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10050;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #10233f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(16, 35, 63, .28);
}

.ct-chat-fab svg { width: 26px; height: 26px; }
.ct-chat-fab .is-close { display: none; }
.ct-chat-fab.is-open .is-open-icon { display: none; }
.ct-chat-fab.is-open .is-close { display: block; }

.ct-chat {
    position: fixed;
    right: 18px;
    bottom: 88px;
    z-index: 10050;
    width: min(380px, calc(100vw - 24px));
    max-height: min(560px, calc(100vh - 110px));
    display: none;
    flex-direction: column;
    background: #fff;
    border: 3px solid #2f6fe4;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(16, 35, 63, .22);
    font-family: Inter, system-ui, sans-serif;
}

.ct-chat.is-open { display: flex; }

.ct-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 16px;
    background: #10233f;
    color: #fff;
}

.ct-chat-mark {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #2f6fe4;
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .04em;
}

.ct-chat-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.ct-chat-head p { margin: 2px 0 0; font-size: 12px; color: #c9d4e5; }
.ct-chat-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.ct-chat-log {
    flex: 1;
    min-height: 220px;
    overflow-y: auto;
    padding: 14px;
    background: #f4f7fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ct-chat-bubble {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    font-size: 14px;
    line-height: 1.45;
}

.ct-chat-bubble.is-user {
    align-self: flex-end;
    background: #10233f;
    color: #fff;
}

.ct-chat-meta { margin-top: 4px; font-size: 11px; opacity: .65; }

.ct-chat-typing { display: flex; gap: 4px; align-items: center; width: 64px; }
.ct-chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8aa0bd;
    animation: ct-chat-dot 1s infinite;
}
.ct-chat-typing span:nth-child(2) { animation-delay: .15s; }
.ct-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ct-chat-dot {
    0%, 80%, 100% { opacity: .3; }
    40% { opacity: 1; }
}

.ct-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e4eaf2;
    background: #fff;
}

.ct-chat-form textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 96px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
}

.ct-chat-form button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: #10233f;
    color: #fff;
    cursor: pointer;
}

.ct-chat-human, .ct-chat-transfer {
    align-self: stretch;
    background: #fff;
    border: 1px solid #d5deea;
    border-radius: 12px;
    padding: 12px;
}

.ct-chat-human p, .ct-chat-transfer p { margin: 0 0 8px; font-size: 13px; color: #334155; }
.ct-chat-human button, .ct-chat-transfer button {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #2f6fe4;
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 10px 12px;
    cursor: pointer;
}
.ct-chat-transfer input {
    width: 100%;
    margin-bottom: 8px;
    border: 1px solid #d5deea;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}
.ct-chat-error { color: #b42318; font-size: 12px; margin: 0 0 8px; }
