/*
 * Live chat (CleverPush chat widget), opened from the top bar / mobile drawer "Live-Chat" link
 * (Cleverpush_WebPush::js/main-native.js). CleverPush injects its own stylesheet after this one,
 * so every rule here outranks it by specificity (html body + container) rather than by order.
 */

/* No floating launcher: it stays in the DOM (the Live-Chat link clicks it) but is never shown. */
html body .cleverpush-sticky-widget-btn-container,
html body #final-cleverpush-tooltip {
    display: none !important;
}

/* ---------- Panel ---------- */
html body .cleverpush-sticky-chat-widget-container {
    --lc-surface: #10151c;
    --lc-surface-2: #151c26;
    --lc-field: #0a0e14;
    --lc-border: rgba(255, 255, 255, .12);
    --lc-text: #f2f6fa;
    --lc-muted: #9eacbc;
    --lc-bubble: rgba(255, 255, 255, .08);
    --lc-accent: #3fb0f2;
    --lc-accent-ink: #06243a;
    --lc-danger: #ff7a85;
    --lc-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 2px 8px rgba(0, 0, 0, .4);
    --lc-gradient: linear-gradient(135deg, #8ed8fb 0%, #3fb0f2 55%, #1690e0 100%);
    --lc-emoji: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239eacbc' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8.5 14.5a4.5 4.5 0 0 0 7 0M9 9.5v.5M15 9.5v.5'/%3E%3C/svg%3E");
    display: none;
}

body.light-mode .cleverpush-sticky-chat-widget-container {
    --lc-surface: #ffffff;
    --lc-surface-2: #f4f8fb;
    --lc-field: #ffffff;
    --lc-border: #d5e2ec;
    --lc-text: #0f1729;
    --lc-muted: #56677a;
    --lc-bubble: #eaf2f8;
    --lc-danger: #c8323f;
    --lc-shadow: 0 24px 60px rgba(15, 23, 41, .22), 0 2px 8px rgba(15, 23, 41, .1);
    --lc-emoji: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356677a' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8.5 14.5a4.5 4.5 0 0 0 7 0M9 9.5v.5M15 9.5v.5'/%3E%3C/svg%3E");
}

html body .cleverpush-sticky-chat-widget-container.active {
    position: fixed !important;
    inset: auto 24px 24px auto !important;
    z-index: 999999 !important;
    display: flex !important;
    width: min(380px, calc(100vw - 32px)) !important;
    height: auto !important;
    max-height: calc(100vh - 48px) !important;
    max-height: calc(100dvh - 48px) !important;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--lc-border);
    border-radius: 18px !important;
    background: var(--lc-surface) !important;
    box-shadow: var(--lc-shadow) !important;
    color: var(--lc-text);
    font-family: var(--toneart-font-family, 'Toneart', Arial, sans-serif);
    animation: toneart-livechat-in .22s cubic-bezier(.2, .8, .2, 1) both;
}

/* The chat is opened on request, so it must not wait for the floating-widgets "revealed" state. */
html:not(.toneart-floating-widgets-revealed) body .cleverpush-sticky-chat-widget-container.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

@keyframes toneart-livechat-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html body .cleverpush-sticky-chat-widget-container.active { animation: none; }
}

/* ---------- Header ---------- */
html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-widget-header {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding: 12px 12px 12px 18px !important;
    border-radius: 0 !important;
    background: var(--lc-gradient) !important;
    color: var(--lc-accent-ink) !important;
    font-family: inherit !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-header-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    color: var(--lc-accent-ink) !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.2;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-header-title::before {
    content: '';
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306243a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a7.5 7.5 0 0 1-11 6.6L4 20l1.4-4.6A7.5 7.5 0 1 1 20 12Z'/%3E%3Cpath d='M9 11h6M9 14h4'/%3E%3C/svg%3E") center / 18px no-repeat;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-header-close-btn {
    display: flex !important;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(6, 36, 58, .1);
    color: var(--lc-accent-ink) !important;
    transition: background-color .15s ease;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-header-close-btn:hover,
html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-header-close-btn:focus-visible {
    background: rgba(6, 36, 58, .2);
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-header-close-btn:focus-visible {
    outline: 2px solid var(--lc-accent-ink);
    outline-offset: 2px;
}

/* ---------- Body ---------- */
html body .cleverpush-sticky-chat-widget-container.active .cleverpush-sticky-widget {
    display: flex !important;
    min-height: 0;
    /* Conversation view: fixed height so the message list scrolls. */
    height: min(460px, calc(100vh - 110px)) !important;
    height: min(460px, calc(100dvh - 110px)) !important;
    flex: 1 1 auto;
    flex-direction: column;
    background: var(--lc-surface) !important;
    color: var(--lc-text);
    font-family: inherit !important;
}

/* Guest form (name + e-mail): only as tall as its content. */
html body .cleverpush-sticky-chat-widget-container.active .cleverpush-sticky-widget:has(.cleverpush-chat-guest-info-container) {
    height: auto !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap {
    min-height: 0;
    height: auto !important;
    flex: 1 1 auto;
    background: transparent !important;
    scrollbar-width: thin;
    scrollbar-color: var(--lc-border) transparent;
}

/* ---------- Guest form ---------- */
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container {
    height: auto !important;
    margin: 0 !important;
    padding: 18px 18px 8px !important;
    overflow: visible;
}

html body .cleverpush-sticky-chat-widget-container .toneart-livechat-intro {
    margin: 0 0 16px;
    color: var(--lc-muted);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-label {
    padding: 0 0 6px !important;
    color: var(--lc-muted) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    line-height: 1.3;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-label strong {
    color: var(--lc-text) !important;
    font-weight: 600 !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-br {
    display: none !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-br + .cleverpush-label {
    margin-top: 14px;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input {
    display: block;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px;
    margin: 0 !important;
    padding: 0 14px !important;
    border: 1px solid var(--lc-border) !important;
    border-radius: 10px !important;
    background: var(--lc-field) !important;
    box-shadow: none !important;
    color: var(--lc-text) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    line-height: 1.3;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input:hover {
    border-color: var(--lc-muted) !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input:focus {
    border-color: var(--lc-accent) !important;
    box-shadow: 0 0 0 3px rgba(63, 176, 242, .28) !important;
    outline: none !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input.error,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input.error:hover {
    border-color: var(--lc-danger) !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input.error:focus {
    border-color: var(--lc-danger) !important;
    box-shadow: 0 0 0 3px rgba(255, 122, 133, .28) !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-email-error-case {
    margin-top: 8px !important;
    color: var(--lc-danger) !important;
    font-family: inherit;
    font-size: 12.5px !important;
}

/* ---------- Footer: "Chat starten" / message input ---------- */
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container {
    flex: 0 0 auto;
    gap: 8px;
    padding: 12px 14px 14px !important;
    border-top: 1px solid var(--lc-border) !important;
    border-radius: 0 !important;
    background: var(--lc-surface-2) !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget:has(.cleverpush-chat-guest-info-container) .cleverpush-chat-input-container {
    padding: 14px 18px 18px !important;
    border-top: 0 !important;
    background: transparent !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-guest-info-submit-button,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-subscribebtn {
    width: 100% !important;
    height: 46px !important;
    padding: 0 18px !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--lc-gradient) !important;
    box-shadow: 0 8px 20px rgba(22, 144, 224, .28);
    color: var(--lc-accent-ink) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: .01em;
    transition: filter .15s ease, transform .15s ease;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-guest-info-submit-button:hover,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-subscribebtn:hover {
    opacity: 1 !important;
    filter: brightness(1.06);
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-btn:focus-visible {
    outline: 2px solid var(--lc-text);
    outline-offset: 2px;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-input-textarea {
    min-width: 0;
    height: 42px;
    min-height: 42px;
    max-height: 120px;
    flex: 1 1 auto;
    margin: 0 !important;
    padding: 10px 12px !important;
    overflow-y: auto;
    resize: none;
    scrollbar-width: none;
    border: 1px solid var(--lc-border) !important;
    border-radius: 12px !important;
    background: var(--lc-field) !important;
    box-shadow: none !important;
    color: var(--lc-text) !important;
    font-family: inherit !important;
    font-size: 15px !important;
    line-height: 1.4;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-input-textarea::placeholder {
    color: var(--lc-muted);
    opacity: 1;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-input-textarea:focus {
    border-color: var(--lc-accent) !important;
    box-shadow: 0 0 0 3px rgba(63, 176, 242, .28) !important;
    outline: none !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-emojibtn,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-sendbtn {
    flex: 0 0 40px;
    width: 40px !important;
    min-width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-emojibtn {
    background: var(--lc-emoji) center / 22px no-repeat transparent !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-sendbtn {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2306243a'%3E%3Cpath d='M3.4 20.4 21 12 3.4 3.6 3.4 10.1 15 12 3.4 13.9z'/%3E%3C/svg%3E") center / 18px no-repeat,
        var(--lc-gradient) !important;
}

/* ---------- Conversation ---------- */
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container {
    padding: 14px 10px 10px;
    color: var(--lc-text) !important;
    font-family: inherit;
    font-size: 14.5px;
    scrollbar-width: thin;
    scrollbar-color: var(--lc-border) transparent;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container a {
    color: inherit !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-channel,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-channel-arrow.cleverpush-chat-link {
    max-width: 78% !important;
    border-radius: 14px 14px 14px 4px !important;
    background-color: var(--lc-bubble) !important;
    color: var(--lc-text) !important;
    line-height: 1.4 !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-subscriber,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-subscriber-arrow {
    max-width: 78% !important;
    padding: 10px 12px !important;
    border-radius: 14px 14px 4px 14px !important;
    background-color: var(--lc-accent) !important;
    color: var(--lc-accent-ink) !important;
    line-height: 1.4 !important;
}

/* The redesigned bubbles carry their own corner, so CleverPush's drawn tails are dropped. */
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-channel-arrow::before,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-channel-arrow::after,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-subscriber-arrow::before,
html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-bubble-subscriber-arrow::after {
    display: none !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-bubble-container .cleverpush-chat-date {
    margin: 14px 0 8px !important;
    color: var(--lc-muted) !important;
    font-size: 12px !important;
}

html body .cleverpush-sticky-chat-widget-container .cleverpush-chat-status {
    position: static;
    padding: 4px 10px;
    background: var(--lc-surface-2);
    color: var(--lc-muted);
    font-family: inherit;
    font-size: 12px;
}

/* ---------- Mobile: bottom sheet ---------- */
@media (max-width: 640px) {
    html body .cleverpush-sticky-chat-widget-container.active {
        inset: auto 8px calc(8px + env(safe-area-inset-bottom, 0px)) 8px !important;
        width: auto !important;
        max-height: calc(100vh - 16px) !important;
        max-height: calc(100dvh - 16px) !important;
    }

    html body .cleverpush-sticky-chat-widget-container.active .cleverpush-sticky-widget {
        height: min(460px, calc(100vh - 86px)) !important;
        height: min(460px, calc(100dvh - 86px)) !important;
    }

    /* 16px keeps iOS from zooming the page when a field gets focus. */
    html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-wrap .cleverpush-chat-guest-info-container .cleverpush-input,
    html body .cleverpush-sticky-chat-widget-container .cleverpush-sticky-widget .cleverpush-chat-input-container .cleverpush-chat-input-textarea {
        font-size: 16px !important;
    }
}

/* ---------- Mobile drawer entry ---------- */
.toneart-mobile-service-top > a.toneart-mobile-livechat {
    grid-column: 1 / -1;
}

.toneart-mobile-service-top > a.toneart-mobile-livechat.is-loading {
    opacity: .6;
    pointer-events: none;
}
