﻿﻿﻿ /* Base container */
#cg4wp-chat-root,
#cg4wp-chat-root-inline {
    --cg4wp-chat-ink: #111827;
    --cg4wp-chat-muted: #6b7280;
    --cg4wp-chat-soft: #f6f7fb;
    --cg4wp-chat-line: #e5e7eb;
    --cg4wp-chat-accent: #2563eb;
    --cg4wp-chat-accent-dark: #1d4ed8;
    --cg4wp-chat-panel: #ffffff;
    --cg4wp-chat-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
    --cg4wp-chat-width: 460px;
    --cg4wp-chat-radius: 20px;
    --cg4wp-message-radius: 16px;
    --cg4wp-chat-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --cg4wp-chat-font-size: 15px;
    --cg4wp-composer-height: 42px;
    font-family: var(--cg4wp-chat-font-family);
    font-size: var(--cg4wp-chat-font-size);
    line-height: 1.5;
    color: var(--cg4wp-chat-ink);
}

#cg4wp-chat-root *,
#cg4wp-chat-root-inline * {
    box-sizing: border-box;
}

.cg4wp-modal.cg4wp-hidden {
    display: none !important;
}

/* IMPORTANT: do NOT hide root container */
#cg4wp-chat-root.cg4wp-hidden,
#cg4wp-chat-root-inline.cg4wp-hidden {
    display: block !important;
}

/* Launcher (bubble) */
.cg4wp-launcher {
    position: fixed;
    right: 20px;
    bottom: var(--cg4wp-launcher-bottom, 20px);
    z-index: 9999;
    cursor: pointer;
}

#cg4wp-chat-root.cg4wp-position-left .cg4wp-launcher {
    right: auto;
    left: 20px;
}

.cg4wp-launcher-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    background: var(--cg4wp-chat-ink);
    color: #ffffff;
    padding: 9px 14px 9px 10px;
    border-radius: 999px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.26);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.cg4wp-launcher-circle .cg4wp-launcher-inner {
    width: 58px;
    min-width: 58px;
    min-height: 58px;
    justify-content: center;
    gap: 0;
    padding: 11px;
    border-radius: 999px;
}

.cg4wp-launcher-circle .cg4wp-logo {
    width: 34px;
    height: 34px;
}

.cg4wp-launcher-circle .cg4wp-label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cg4wp-launcher:hover .cg4wp-launcher-inner,
.cg4wp-launcher:focus-within .cg4wp-launcher-inner {
    transform: translateY(-2px);
    background: var(--cg4wp-chat-ink);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.3);
}

@keyframes cg4wp-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 14px 32px rgba(15, 23, 42, 0.38);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cg4wp-launcher-inner {
        transition: none;
    }
}

.cg4wp-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #fff;
    object-fit: cover;
}

.cg4wp-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

/* Modal wrapper */
.cg4wp-modal {
    position: fixed;
    right: 20px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: min(var(--cg4wp-chat-width), 88vw);
    max-width: calc(100% - 32px);
    z-index: 99999;
}

#cg4wp-chat-root.cg4wp-position-left .cg4wp-modal {
    right: auto;
    left: 20px;
}

#cg4wp-chat-root-inline .cg4wp-modal {
    position: static;
    width: 100%;
    bottom: auto;
}

/* Modal inner */
.cg4wp-modal-inner {
    background: var(--cg4wp-chat-panel);
    border-radius: var(--cg4wp-chat-radius);
    box-shadow: var(--cg4wp-chat-shadow);
    border: 1px solid rgba(17, 24, 39, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 112px);
}

/* Header */
.cg4wp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 66px;
    padding: 12px 14px 12px 16px;
    background: var(--cg4wp-chat-ink);
    color: #ffffff;
}

.cg4wp-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.cg4wp-header-logo {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #fff;
    object-fit: cover;
    flex: 0 0 auto;
}

.cg4wp-header-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cg4wp-header-title {
    font-size: 14px;
    font-weight: 750;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg4wp-header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.74);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cg4wp-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.cg4wp-end {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

    .cg4wp-end:hover,
    .cg4wp-end:focus {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.3);
    }

.cg4wp-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease;
}

    .cg4wp-close:hover,
    .cg4wp-close:focus {
        background: rgba(255, 255, 255, 0.12);
        color: #ffffff;
    }

/* Body */
.cg4wp-body {
    display: flex;
    flex-direction: column;
    height: clamp(470px, 68vh, 680px);
    min-height: 0;
}

#cg4wp-chat-root-inline .cg4wp-body {
    height: clamp(380px, 58vh, 600px);
}

/* Messages */
.cg4wp-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 14px 12px;
    overflow-y: auto;
    background: var(--cg4wp-chat-soft);
    scroll-behavior: smooth;
    scrollbar-color: rgba(17, 24, 39, 0.32) transparent;
    scrollbar-width: thin;
}

.cg4wp-messages::-webkit-scrollbar {
    width: 8px;
}

.cg4wp-messages::-webkit-scrollbar-track {
    background: transparent;
}

.cg4wp-messages::-webkit-scrollbar-thumb {
    background: rgba(17, 24, 39, 0.24);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.cg4wp-msg {
    margin-bottom: 12px;
    max-width: 90%;
    font-size: calc(var(--cg4wp-chat-font-size) - 1px);
}

.cg4wp-msg-user {
    align-self: flex-end;
    text-align: right;
}

    .cg4wp-msg-user p {
        display: inline-block;
        background: var(--cg4wp-chat-ink);
        color: #ffffff;
        padding: 9px 13px;
        border-radius: var(--cg4wp-message-radius) var(--cg4wp-message-radius) 5px var(--cg4wp-message-radius);
        font-size: calc(var(--cg4wp-chat-font-size) - 1px);
        margin: 0;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
    }

/* Unified assistant bubble wrapper (one bubble per assistant response) */
.cg4wp-msg-assistant {
    align-self: flex-start;
    text-align: left;
}

.cg4wp-bubble {
    display: inline-block;
    max-width: 100%;
    border-radius: var(--cg4wp-message-radius) var(--cg4wp-message-radius) var(--cg4wp-message-radius) 5px;
    padding: 11px 13px;
    font-size: calc(var(--cg4wp-chat-font-size) - 1px);
    line-height: 1.48;
}

.cg4wp-bubble-assistant {
    background: #ffffff;
    color: var(--cg4wp-chat-ink);
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.cg4wp-bubble p {
    margin: 0;
}

    .cg4wp-bubble p + p {
        margin-top: 6px;
    }

/* Ensure listings & templates appear inside the same assistant bubble without becoming separate bubbles */
.cg4wp-msg-assistant .cg4wp-card-list,
.cg4wp-msg-assistant .cg4wp-template-list {
    display: block;
    background: transparent;
    padding: 0;
    margin: 8px 0 0;
}

.cg4wp-msg-assistant .cg4wp-template-list--text {
    gap: 10px;
}

.cg4wp-msg-assistant .cg4wp-text-wrapper {
    background: transparent;
    border-radius: 12px;
    padding: 0 0 14px 0;
    margin: 0;
}

.cg4wp-text-header h4 {
    margin: 0 0 0 0;
    line-height: 1.25;
}

.cg4wp-msg-assistant .cg4wp-text-header {
    margin-bottom: 6px;
    padding-bottom: 4px;
}

.cg4wp-msg-assistant .cg4wp-text-excerpt {
    margin: 0 0 8px;
}

.cg4wp-msg-assistant .cg4wp-action-links {
    margin-top: 8px;
    gap: 8px;
}

.cg4wp-view-all {
    margin: 0 0 12px;
}

.cg4wp-text-links.cg4wp-action-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
}

.cg4wp-text-link {
    display: inline-flex;
    align-items: center;
    padding: 0;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--cg4wp-chat-muted) !important;
    text-decoration: none;
    transition: color 0.15s ease;
}

    .cg4wp-text-link:hover {
        color: var(--cg4wp-chat-accent-dark);
        text-decoration: underline;
    }

.cg4wp-button.cg4wp-button--secondary {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--cg4wp-chat-ink);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

    .cg4wp-button.cg4wp-button--secondary:hover {
        background: #0b1220;
        transform: translateY(-1px);
    }

.cg4wp-view-all-link--text {
    display: inline-flex;
    align-items: center;
    padding-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    border-top: 1px solid #e5e7eb;
}

    .cg4wp-view-all-link--text:hover {
        color: var(--cg4wp-chat-ink);
        text-decoration: underline;
    }

.cg4wp-view-all-link--text {
    gap: 4px;
}

    .cg4wp-view-all-link--text:hover {
        gap: 6px;
    }

/* Links inside assistant message */
.cg4wp-chat-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin: 6px 0 2px;
    padding: 7px 11px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 9px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--cg4wp-chat-accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: middle;
    overflow-wrap: anywhere;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .cg4wp-chat-link:hover,
    .cg4wp-chat-link:focus {
        background: rgba(37, 99, 235, 0.13);
        border-color: rgba(37, 99, 235, 0.35);
        color: var(--cg4wp-chat-accent-dark);
        text-decoration: none;
    }

.cg4wp-site-item-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.cg4wp-site-item-action {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 9px 10px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 10px;
    background: rgba(246, 247, 251, 0.78);
}

.cg4wp-site-item-title {
    color: var(--cg4wp-chat-ink);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.25;
}

.cg4wp-site-item-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cg4wp-site-item-link,
.cg4wp-site-item-discuss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.cg4wp-site-item-link {
    border: 1px solid rgba(37, 99, 235, 0.24);
    background: rgba(37, 99, 235, 0.08);
    color: var(--cg4wp-chat-accent);
}

.cg4wp-site-item-link:hover,
.cg4wp-site-item-link:focus {
    background: rgba(37, 99, 235, 0.13);
    color: var(--cg4wp-chat-accent-dark);
    text-decoration: none;
}

.cg4wp-site-item-discuss {
    border: 1px solid rgba(17, 24, 39, 0.14);
    background: #ffffff;
    color: var(--cg4wp-chat-ink);
}

.cg4wp-site-item-discuss:hover,
.cg4wp-site-item-discuss:focus,
.cg4wp-site-item-discuss-active {
    border-color: rgba(37, 99, 235, 0.32);
    background: var(--cg4wp-chat-ink);
    color: #ffffff;
}

/* Input row density */
.cg4wp-input-row {
    padding: 12px 14px 12px;
    border-top: 1px solid var(--cg4wp-chat-line);
    background: #ffffff;
}

.cg4wp-listening-status {
    display: none;
    align-items: center;
    gap: 8px;
    margin: 0 2px 8px;
    padding: 7px 10px;
    width: fit-content;
    max-width: 100%;
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 999px;
    background: rgba(254, 242, 242, 0.95);
    color: #991b1b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.cg4wp-is-listening .cg4wp-listening-status {
    display: inline-flex;
}

.cg4wp-listening-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #dc2626;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.46);
    animation: cg4wp-recording-pulse 1.25s ease-out infinite;
}

.cg4wp-voice-bars {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 16px;
}

.cg4wp-voice-bars span {
    width: 3px;
    height: 14px;
    border-radius: 999px;
    background: #dc2626;
    transform-origin: center;
    transform: scaleY(0.28);
    opacity: 0.85;
}

.cg4wp-is-listening .cg4wp-voice-bars span:nth-child(1) {
    transform: scaleY(var(--cg4wp-voice-level-1, 0.45));
    animation: cg4wp-voice-fallback 0.72s ease-in-out infinite alternate;
}

.cg4wp-is-listening .cg4wp-voice-bars span:nth-child(2) {
    transform: scaleY(var(--cg4wp-voice-level-2, 0.85));
    animation: cg4wp-voice-fallback 0.58s ease-in-out 0.08s infinite alternate;
}

.cg4wp-is-listening .cg4wp-voice-bars span:nth-child(3) {
    transform: scaleY(var(--cg4wp-voice-level-3, 0.62));
    animation: cg4wp-voice-fallback 0.64s ease-in-out 0.14s infinite alternate;
}

.cg4wp-is-listening .cg4wp-voice-bars span:nth-child(4) {
    transform: scaleY(var(--cg4wp-voice-level-4, 0.38));
    animation: cg4wp-voice-fallback 0.8s ease-in-out 0.2s infinite alternate;
}

.cg4wp-voice-meter-active .cg4wp-voice-bars span {
    animation: none !important;
}

.cg4wp-input-shell {
    position: relative;
    background: #ffffff;
    border: 1px solid #d7dbe3;
    border-radius: 20px;
    min-height: 54px;
    padding: 9px 88px 9px 15px;
    box-shadow: 0 2px 10px rgba(17, 24, 39, 0.06);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.cg4wp-input-shell:focus-within {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.cg4wp-is-listening .cg4wp-input-shell {
    border-color: rgba(220, 38, 38, 0.42);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.11), 0 8px 22px rgba(127, 29, 29, 0.08);
}

.cg4wp-input-main {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 34px;
}

.cg4wp-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.4;
    color: var(--cg4wp-chat-ink);
    padding: 8px 0 6px;
    min-height: 34px;
    max-height: 144px;
    resize: none;
    overflow-y: auto;
}

.cg4wp-input-actions {
    position: absolute;
    right: 6px;
    top: auto;
    bottom: auto;
    bottom: 10px;
    transform: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cg4wp-transcribe,
.cg4wp-send {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: var(--cg4wp-chat-ink);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

    .cg4wp-transcribe:hover {
        background: #f3f4f6;
    }

.cg4wp-send {
    background: var(--cg4wp-chat-ink);
    color: #ffffff;
    border-color: var(--cg4wp-chat-ink);
}

    .cg4wp-send:hover,
    .cg4wp-send:focus {
        background: #0b1220;
        border-color: #0b1220;
    }

.cg4wp-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.cg4wp-warning-row {
    padding: 0 16px 12px;
    background: transparent;
}

.cg4wp-input-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--cg4wp-chat-muted);
    line-height: 1.4;
}

.cg4wp-density-compact .cg4wp-body {
    height: clamp(420px, 62vh, 600px);
}

.cg4wp-density-compact .cg4wp-messages {
    padding: 12px;
}

.cg4wp-density-compact .cg4wp-msg {
    margin-bottom: 8px;
}

.cg4wp-density-compact .cg4wp-bubble,
.cg4wp-density-compact .cg4wp-msg-user p {
    padding: 8px 11px;
}

.cg4wp-density-spacious .cg4wp-body {
    height: clamp(520px, 72vh, 720px);
}

.cg4wp-density-spacious .cg4wp-messages {
    padding: 18px;
}

.cg4wp-density-spacious .cg4wp-msg {
    margin-bottom: 15px;
    max-width: 92%;
}

.cg4wp-typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--cg4wp-chat-muted);
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px 16px 16px 4px;
    padding: 8px 11px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.cg4wp-send:disabled,
.cg4wp-transcribe:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.cg4wp-transcribe.cg4wp-transcribing {
    border-color: rgba(220, 38, 38, 0.55);
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.14), 0 8px 18px rgba(220, 38, 38, 0.24);
    transform: translateY(-1px);
    animation: cg4wp-mic-listening 1.35s ease-in-out infinite;
}

.cg4wp-transcribe.cg4wp-transcribing .cg4wp-icon-mic {
    filter: brightness(0) invert(1);
}

.cg4wp-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.cg4wp-icon-mic {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23111827'%3E%3Cpath d='M12 14a3 3 0 0 0 3-3V6a3 3 0 1 0-6 0v5a3 3 0 0 0 3 3Zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.93V20H8v2h8v-2h-3v-2.07A7 7 0 0 0 19 11h-2Z'/%3E%3C/svg%3E");
}

.cg4wp-icon-send {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f9fafb'%3E%3Cpath d='M2.01 21 23 12 2.01 3 2 10l14 2-14 2 .01 7Z'/%3E%3C/svg%3E");
}

@keyframes cg4wp-recording-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.46);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

@keyframes cg4wp-mic-listening {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12), 0 8px 18px rgba(220, 38, 38, 0.22);
    }

    50% {
        box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.2), 0 10px 24px rgba(220, 38, 38, 0.28);
    }
}

@keyframes cg4wp-voice-fallback {
    from {
        transform: scaleY(0.3);
    }

    to {
        transform: scaleY(1);
    }
}

.cg4wp-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cg4wp-warning-icon {
    font-size: 12px;
    line-height: 1;
    opacity: 0.8;
}

/* =========================================================
   Mobile Fullscreen Chat Mode (Keyboard Safe)
   ========================================================= */
@media (max-width: 640px) {

    /* Launcher positioning */
    .cg4wp-launcher {
        right: 12px;
        --cg4wp-launcher-bottom: 14px;
    }

    #cg4wp-chat-root.cg4wp-position-left .cg4wp-launcher {
        left: 12px;
    }

    .cg4wp-launcher-inner {
        padding: 9px 11px;
        min-height: 44px;
    }

    @media (orientation: portrait) {
        .cg4wp-launcher {
            --cg4wp-launcher-bottom: calc(14px + var(--cg4wp-mobile-portrait-launcher-offset, 0px));
        }
    }

    /* Fullscreen modal – NO viewport units */
    .cg4wp-modal {
        position: fixed !important;
        inset: 0 !important;
        width: 100% !important;
        height: var(--cg4wp-visual-viewport-height, 100%) !important;
        max-width: 100% !important;
        max-height: var(--cg4wp-visual-viewport-height, 100%) !important;
        margin: 0 !important;
        transform: none !important;
        display: flex;
    }

    /* Modal behaves like an app shell */
    .cg4wp-modal-inner {
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    /* Header always visible */
    .cg4wp-header {
        flex-shrink: 0;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
    }

    /* Body flex container */
    .cg4wp-body {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    /* ONLY this area scrolls */
    .cg4wp-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    /* Input stays docked */
    .cg4wp-input-row {
        flex-shrink: 0;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    /* Larger close button for touch */
    .cg4wp-close {
        font-size: 24px;
        padding: 6px 8px;
    }
}
