/*
    Sticky public live chat widget styles.

    The widget is intentionally self-contained so it can be included from the
    public base template without depending on page-specific CSS.
*/

.courier-live-chat {
    bottom: 24px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: fixed;
    right: 24px;
    z-index: 9998;
}

.courier-chat-launcher {
    align-items: center;
    background: #001c4e;
    border: 0;
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    gap: 8px;
    padding: 14px 18px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.courier-chat-launcher:hover {
    background: #003078;
    transform: translateY(-2px);
}

.courier-chat-launcher__icon {
    font-size: 1.2rem;
}

.courier-chat-panel {
    background: #ffffff;
    border-radius: 18px;
    bottom: 0;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    display: none;
    flex-direction: column;
    height: 520px;
    max-height: calc(100vh - 48px);
    max-width: calc(100vw - 32px);
    overflow: hidden;
    position: absolute;
    right: 0;
    width: 360px;
}

.courier-chat-panel.is-open {
    display: flex;
}

.courier-chat-panel__header {
    align-items: center;
    background: #001c4e;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    padding: 16px;
}

.courier-chat-panel__header p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    margin: 3px 0 0;
}

.courier-chat-panel__close {
    background: transparent;
    border: 0;
    color: #ffffff;
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
}

.courier-chat-messages {
    background: #f3f6fb;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding: 14px;
}

.courier-chat-message {
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(9, 19, 50, 0.08);
    font-size: 0.9rem;
    line-height: 1.35;
    max-width: 82%;
    padding: 10px 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.courier-chat-message small {
    display: block;
    font-size: 0.68rem;
    margin-bottom: 4px;
    opacity: 0.7;
}

.courier-chat-message--visitor {
    align-self: flex-end;
    background: #001c4e;
    color: #ffffff;
}

.courier-chat-message--agent {
    align-self: flex-start;
    background: #ffffff;
    color: #111827;
}

.courier-chat-message--system {
    align-self: center;
    background: #dce8f8;
    color: #091332;
    font-size: 0.82rem;
    max-width: 94%;
    text-align: center;
}

.courier-chat-message--typing {
    opacity: 0.8;
}

.courier-chat-form {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    padding: 10px;
}

.courier-chat-form__input {
    border: 1px solid #cfd8e3;
    border-radius: 999px;
    flex: 1;
    font-size: 0.9rem;
    outline: none;
    padding: 10px 13px;
}

.courier-chat-form__input:focus {
    border-color: #001c4e;
}

.courier-chat-form__submit {
    background: #001c4e;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    padding: 10px 14px;
}

.courier-chat-form__submit:hover {
    background: #003078;
}

@media (max-width: 480px) {
    .courier-live-chat {
        bottom: 16px;
        right: 16px;
    }

    .courier-chat-panel {
        height: 70vh;
        right: -8px;
        width: calc(100vw - 32px);
    }
}