.tp-live-chat-card__title {
    margin-bottom: 0.75rem;
}

.tp-live-chat-card__button {
    margin-bottom: 0;
}

.tp-live-chat {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.tp-live-chat [hidden] {
    display: none !important;
}

.tp-live-chat__launcher,
.tp-live-chat__titlebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: 0;
    background: linear-gradient(135deg, #0f6f5c, #1779ba);
    box-shadow: 0 18px 40px rgba(12, 45, 60, 0.25);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    text-align: left;
}

.tp-live-chat__launcher {
    border-radius: 999px;
    padding: 0.9rem 1.1rem;
}

.tp-live-chat__launcher-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.15;
    text-align: left;
}

.tp-live-chat__launcher-copy span:last-child {
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.9;
}

.tp-live-chat__launcher-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.tp-live-chat__launcher-logo {
    width: 1.65rem;
    height: 1.65rem;
    object-fit: contain;
    display: block;
}

.tp-live-chat__panel {
    width: min(24rem, calc(100vw - 2rem));
    max-height: min(40rem, calc(100vh - 1.5rem));
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 60px rgba(12, 45, 60, 0.28);
    border: 1px solid rgba(23, 121, 186, 0.14);
}

.tp-live-chat__panel-header {
    display: flex;
    align-items: stretch;
    background: linear-gradient(135deg, #0f6f5c, #1779ba);
    color: #fff;
}

.tp-live-chat__titlebar-toggle {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 0.9rem 0.95rem 1rem;
    border-radius: 0;
    box-shadow: none;
}

.tp-live-chat__titlebar-copy {
    min-width: 0;
}

.tp-live-chat__titlebar-copy strong,
.tp-live-chat__titlebar-copy span {
    margin: 0;
    white-space: normal;
}

.tp-live-chat__titlebar-copy strong {
    font-size: 1rem;
}

.tp-live-chat__titlebar-copy span:last-child {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.82rem;
}

.tp-live-chat__panel-actions {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.7rem 0.75rem 0 0;
}

.tp-live-chat__panel-action {
    width: 2.2rem;
    height: 2.2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.tp-live-chat__panel-action:hover,
.tp-live-chat__panel-action:focus,
.tp-live-chat__titlebar-toggle:hover,
.tp-live-chat__titlebar-toggle:focus {
    filter: brightness(1.06);
}

.tp-live-chat__panel-body {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    background: #fff;
}

.tp-live-chat__close {
    font-size: 1.5rem;
}

.tp-live-chat__status {
    margin: 1rem 1rem 0;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    font-size: 0.88rem;
    background: #edf6f3;
    color: #0f6f5c;
}

.tp-live-chat__status[data-tone="error"] {
    background: #fdeeed;
    color: #ad2e24;
}

.tp-live-chat__status[data-tone="warning"] {
    background: #fff5df;
    color: #946200;
}

.tp-live-chat__status[data-tone="pending"] {
    background: #eef4fb;
    color: #125d95;
}

.tp-live-chat__start-form,
.tp-live-chat__message-form {
    padding: 1rem;
    margin: 0;
}

.tp-live-chat__start-form label,
.tp-live-chat__message-form label {
    display: block;
    font-weight: 600;
    color: #26343d;
}

.tp-live-chat__start-form input,
.tp-live-chat__start-form textarea,
.tp-live-chat__message-form textarea {
    margin-top: 0.35rem;
    margin-bottom: 0.85rem;
    border-radius: 12px;
    border: 1px solid #c9d7de;
    box-shadow: none;
    background: #fff;
    color: #22323a;
}

.tp-live-chat__start-form input:focus,
.tp-live-chat__start-form textarea:focus,
.tp-live-chat__message-form textarea:focus {
    border-color: #1779ba;
    box-shadow: 0 0 0 3px rgba(23, 121, 186, 0.12);
}

.tp-live-chat__start-form .button,
.tp-live-chat__message-form .button {
    margin: 0;
}

.tp-live-chat__conversation {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.tp-live-chat__messages {
    overflow-y: auto;
    padding: 0 1rem;
    display: grid;
    gap: 0.75rem;
}

.tp-live-chat__message {
    border-radius: 18px;
    padding: 0.85rem 0.95rem;
    background: #f3f7f8;
    color: #22323a;
}

.tp-live-chat__message--agent {
    background: #e9f4fb;
}

.tp-live-chat__message-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 0.45rem;
    color: #5b6b76;
}

.tp-live-chat__message-body {
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
}

.tp-live-chat__message-body a {
    color: #0f6f5c;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.tp-live-chat__typing-indicator {
    justify-self: start;
    border-radius: 999px;
    background: #edf6f3;
    color: #0f6f5c;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.45rem 0.75rem;
}

.tp-live-chat--minimized .tp-live-chat__panel {
    max-height: none;
}

@media screen and (max-width: 39.9375em) {
    .tp-live-chat {
        right: 0.75rem;
        left: 0.75rem;
        bottom: 0.75rem;
        align-items: stretch;
    }

    .tp-live-chat__launcher {
        width: 100%;
        justify-content: center;
    }

    .tp-live-chat__titlebar-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .tp-live-chat__panel {
        width: 100%;
        max-height: min(38rem, calc(100vh - 1.5rem));
    }

    .tp-live-chat__panel-header {
        align-items: center;
    }

    .tp-live-chat__panel-actions {
        padding-top: 0;
        padding-bottom: 0;
        align-self: stretch;
        align-items: center;
    }

    .tp-live-chat__panel-action {
        width: 2.4rem;
        height: 2.4rem;
    }
}
