/* ==========================================================================
   Chat Widget — frontend styles
   Prefix: cw-
   All selectors use #cw-widget for specificity over Elementor styles.
   ========================================================================== */

:root {
    --cw-accent: #467FF7;
    --cw-accent-dark: #2f66e2;
    --cw-bg: #ffffff;
    --cw-panel-bg: #f7f8fa;
    --cw-border: rgba(0, 0, 0, 0.08);
    --cw-muted: rgba(0, 0, 0, 0.5);
    --cw-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 0, 0, 0.16);
    --cw-launcher-size: 60px;
    --cw-panel-width: 380px;
    --cw-panel-height: 580px;
    --cw-radius: 16px;
    --cw-z: 99999;
}

/* ---- Launcher button ---- */

#cw-widget .cw-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: var(--cw-launcher-size);
    height: var(--cw-launcher-size);
    min-width: 0;
    min-height: 0;
    border-radius: 50%;
    background: var(--cw-accent);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: var(--cw-z);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
    margin: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1;
}

#cw-widget .cw-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: var(--cw-accent);
}

#cw-widget .cw-launcher:active {
    transform: scale(0.95);
}

#cw-widget .cw-launcher:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#cw-widget .cw-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#cw-widget .cw-launcher-icon svg {
    display: block;
    fill: white;
}

/* Online dot */
#cw-widget .cw-online-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid #fff;
    animation: cw-pulse 2s ease-in-out infinite;
}

@keyframes cw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Unread message badge on launcher */
#cw-widget .cw-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    padding: 0 6px;
    border: 2px solid #fff;
    box-sizing: border-box;
    pointer-events: none;
    animation: cw-badge-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cw-badge-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Initial entrance animation */
#cw-widget .cw-launcher.cw-entrance {
    animation: cw-launcher-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cw-launcher-enter {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}


/* ---- Widget panel ---- */

#cw-widget .cw-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: var(--cw-panel-width);
    height: var(--cw-panel-height);
    background: var(--cw-bg);
    border-radius: var(--cw-radius);
    box-shadow: var(--cw-shadow);
    z-index: var(--cw-z);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

#cw-widget .cw-panel.cw-panel-enter {
    animation: cw-panel-in 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#cw-widget .cw-panel.cw-panel-exit {
    animation: cw-panel-out 0.18s ease-in forwards;
}

@keyframes cw-panel-in {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes cw-panel-out {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.85); opacity: 0; }
}


/* ---- Header ---- */

#cw-widget .cw-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--cw-accent);
    color: #fff;
    position: relative;
    flex-shrink: 0;
}

#cw-widget .cw-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    min-width: 0;
    min-height: 0;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    padding: 0;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

#cw-widget .cw-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

#cw-widget .cw-close-btn:focus {
    outline: none;
}

#cw-widget .cw-agent-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

#cw-widget .cw-header-text {
    min-width: 0;
    line-height: 1;
}

#cw-widget .cw-agent-name {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    margin: 0 0 2px 0;
    padding: 0;
}

#cw-widget .cw-status-text {
    font-size: 13px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    color: #fff;
}

#cw-widget .cw-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

#cw-widget .cw-status-online {
    background: #86efac;
}

/* New message notification banner (inside panel) */
#cw-widget .cw-new-msg-banner {
    background: var(--cw-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

#cw-widget .cw-new-msg-banner:hover {
    filter: brightness(1.1);
}


/* ---- Views ---- */

#cw-widget .cw-view {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}


/* ---- Callback Form ---- */

#cw-widget .cw-view-form {
    padding: 20px 16px 16px;
}

#cw-widget .cw-greeting {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 16px;
    line-height: 1.4;
}

#cw-widget .cw-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#cw-widget .cw-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--cw-border);
    border-radius: 10px;
    background: var(--cw-panel-bg);
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    color: #111;
    margin: 0;
    min-height: 0;
    height: auto;
    line-height: 1.4;
    text-transform: none;
    letter-spacing: normal;
}

#cw-widget .cw-input:focus {
    border-color: var(--cw-accent);
    box-shadow: 0 0 0 2px rgba(70, 127, 247, 0.12);
}

#cw-widget .cw-textarea {
    resize: vertical;
    min-height: 60px;
}

/* Honeypot — hidden from humans */
#cw-widget .cw-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

#cw-widget .cw-privacy {
    font-size: 12px;
    color: var(--cw-muted);
    margin: 2px 0 0;
    line-height: 1.4;
}

#cw-widget .cw-privacy a {
    color: var(--cw-muted);
    text-decoration: underline;
}

#cw-widget .cw-form-error {
    font-size: 13px;
    color: #d00;
    margin: 0;
    line-height: 1.4;
}

#cw-widget .cw-submit-btn {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--cw-accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    font-family: inherit;
    margin: 0;
    min-height: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
}

#cw-widget .cw-submit-btn:hover {
    background: var(--cw-accent-dark);
    color: #fff;
}

#cw-widget .cw-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}


/* ---- Confirmation view ---- */

#cw-widget .cw-view-confirm {
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#cw-widget .cw-confirm-icon {
    color: #22c55e;
    margin-bottom: 16px;
}

#cw-widget .cw-confirm-circle {
    stroke-dasharray: 188;
    stroke-dashoffset: 188;
    animation: cw-draw-circle 0.5s ease forwards;
}

#cw-widget .cw-confirm-check {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: cw-draw-check 0.3s ease 0.35s forwards;
}

@keyframes cw-draw-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes cw-draw-check {
    to { stroke-dashoffset: 0; }
}

#cw-widget .cw-confirm-title {
    font-size: 20px;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

#cw-widget .cw-confirm-text {
    font-size: 14px;
    color: var(--cw-muted);
    line-height: 1.5;
}

#cw-widget .cw-confirm-hours {
    font-size: 13px;
    color: var(--cw-muted);
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--cw-panel-bg);
    border-radius: 8px;
}


/* ---- Live Chat view ---- */

#cw-widget .cw-view-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#cw-widget .cw-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 200px;
}

#cw-widget .cw-msg {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

#cw-widget .cw-msg-visitor {
    align-self: flex-end;
    background: var(--cw-accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

#cw-widget .cw-msg-admin {
    align-self: flex-start;
    background: #f0f0f0;
    color: #111;
    border-bottom-left-radius: 4px;
}

#cw-widget .cw-msg-time {
    font-size: 11px;
    color: var(--cw-muted);
    margin-top: 2px;
    text-align: right;
}

#cw-widget .cw-msg-admin + .cw-msg-time {
    text-align: left;
}

/* Links in chat messages — scoped to resist Elementor overrides */
#cw-widget .cw-msg a {
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: underline !important;
    word-break: break-all;
}

#cw-widget .cw-msg a:hover {
    opacity: 0.8;
}

/* Conversation starters */
#cw-widget .cw-chat-starters {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    padding: 8px 0;
}

#cw-widget .cw-chat-starter {
    display: inline-block;
    padding: 8px 14px;
    border: 1.5px solid var(--cw-accent);
    border-radius: 18px;
    background: #fff;
    color: var(--cw-accent);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.35;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    max-width: 85%;
    text-align: left;
    min-width: 0;
    min-height: 0;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}

#cw-widget .cw-chat-starter:hover {
    background: var(--cw-accent);
    color: #fff;
}

/* Read receipts */
#cw-widget .cw-read-receipt {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1;
}

#cw-widget .cw-read-receipt img {
    width: 14px;
    height: 14px;
    display: block;
}

#cw-widget .cw-read-receipt.is-delivered img {
    opacity: 0.55;
}

#cw-widget .cw-read-receipt.is-read img {
    opacity: 1;
}

/* Typing indicator */
#cw-widget .cw-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
}

#cw-widget .cw-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aaa;
    animation: cw-typing 1.2s ease-in-out infinite;
}

#cw-widget .cw-typing-dot:nth-child(2) { animation-delay: 0.2s; }
#cw-widget .cw-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes cw-typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Composer */
#cw-widget .cw-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid var(--cw-border);
    background: #fff;
    flex-shrink: 0;
}

#cw-widget .cw-composer-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.45;
    box-sizing: border-box;
    color: #111;
    background: #f5f6f8;
    margin: 0;
    min-height: 0;
    height: auto;
    text-transform: none;
    letter-spacing: normal;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

#cw-widget .cw-composer-input::placeholder {
    color: #999;
}

#cw-widget .cw-composer-input:focus {
    border-color: var(--cw-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(70, 127, 247, 0.1);
}

#cw-widget .cw-send-btn {
    width: 38px;
    height: 38px;
    min-width: 0;
    min-height: 0;
    border-radius: 50%;
    border: none;
    background: var(--cw-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.15s, opacity 0.15s;
    padding: 0;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1;
}

#cw-widget .cw-send-btn:hover {
    background: var(--cw-accent-dark);
    color: #fff;
    transform: scale(1.06);
}

#cw-widget .cw-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

#cw-widget .cw-send-btn:focus {
    outline: none;
}


/* ---- Menu view ---- */

#cw-widget .cw-view-menu {
    padding: 20px 16px 16px;
}

#cw-widget .cw-menu-greeting {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 16px;
    line-height: 1.4;
}

#cw-widget .cw-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#cw-widget .cw-menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: var(--cw-panel-bg);
    border: 1px solid var(--cw-border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    font-family: inherit;
    font-size: 15px;
    color: #111;
    text-align: left;
    line-height: 1.3;
    margin: 0;
    min-height: 0;
    text-transform: none;
    letter-spacing: normal;
    position: relative;
}

#cw-widget .cw-menu-btn:hover {
    background: #fff;
    border-color: var(--cw-accent);
    color: #111;
}

#cw-widget .cw-menu-btn:active {
    transform: scale(0.98);
}

#cw-widget .cw-menu-btn:focus {
    outline: none;
    border-color: var(--cw-accent);
}

#cw-widget .cw-menu-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: var(--cw-accent);
    color: #fff;
    flex-shrink: 0;
}

#cw-widget .cw-menu-btn-icon svg {
    display: block;
    fill: #fff;
}

#cw-widget .cw-menu-btn-label {
    flex: 1;
    font-weight: 500;
}

#cw-widget .cw-menu-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: cw-pulse 2s ease-in-out infinite;
}


/* ---- Back button ---- */

/* Back button — inside header, left of agent photo */
#cw-widget .cw-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    margin: 0 -4px 0 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    line-height: 1;
    text-transform: none;
    letter-spacing: normal;
}

#cw-widget .cw-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#cw-widget .cw-back-btn:focus {
    outline: none;
}

#cw-widget .cw-back-btn svg {
    display: block;
    fill: currentColor;
    flex-shrink: 0;
}


/* ---- Callback flow / info flow views ---- */

#cw-widget .cw-view-callback-flow,
#cw-widget .cw-view-quote-info,
#cw-widget .cw-view-how-it-works {
    display: flex;
    flex-direction: column;
}

#cw-widget .cw-flow-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 12px 12px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
}

/* System message bubble (left-aligned, muted style) */
#cw-widget .cw-msg-system {
    align-self: flex-start;
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    font-size: 14px;
    line-height: 1.45;
    background: #f0f0f0;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* CTA button inside a flow message */
#cw-widget .cw-msg-cta {
    align-self: flex-start;
    max-width: 85%;
    padding: 0;
    background: none;
}

#cw-widget .cw-msg-cta a,
#cw-widget .cw-msg-cta button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--cw-accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background 0.15s;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    margin: 0;
    min-height: 0;
}

#cw-widget .cw-msg-cta a:hover,
#cw-widget .cw-msg-cta button:hover {
    background: var(--cw-accent-dark);
    color: #fff;
}

/* Links inside a system message */
#cw-widget .cw-msg-system a {
    color: var(--cw-accent);
    text-decoration: underline;
    font-size: inherit;
    display: block;
    margin-top: 6px;
}

#cw-widget .cw-msg-system a:first-child {
    margin-top: 0;
}

#cw-widget .cw-away-notice {
    text-align: center;
    font-size: 12px;
    color: #888;
    padding: 6px 12px;
    font-style: italic;
}

#cw-widget .cw-inline-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 14px 12px;
    margin-top: 4px;
}

#cw-widget .cw-inline-contact .cw-flow-input {
    width: 100%;
    box-sizing: border-box;
}

#cw-widget .cw-inline-contact .cw-flow-submit {
    align-self: flex-end;
    margin-top: 2px;
}


/* ---- Flow input area (inline inputs inside callback flow) ---- */

#cw-widget .cw-flow-input-area {
    padding: 8px 12px 12px;
    border-top: 1px solid var(--cw-border);
    background: #fff;
    flex-shrink: 0;
}

#cw-widget .cw-flow-input-area .cw-flow-input-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 6px;
}

#cw-widget .cw-flow-input-area .cw-flow-input-row:last-child {
    margin-bottom: 0;
}

#cw-widget .cw-flow-input {
    flex: 1;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid var(--cw-border);
    border-radius: 18px;
    background: var(--cw-panel-bg);
    outline: none;
    font-family: inherit;
    color: #111;
    box-sizing: border-box;
    margin: 0;
    min-height: 0;
    height: auto;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
}

#cw-widget .cw-flow-input:focus {
    border-color: var(--cw-accent);
    box-shadow: 0 0 0 2px rgba(70, 127, 247, 0.12);
}

#cw-widget .cw-flow-input-area textarea.cw-flow-input {
    resize: none;
    min-height: 50px;
    border-radius: 12px;
}

#cw-widget .cw-flow-submit {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 0;
    border-radius: 50%;
    border: none;
    background: var(--cw-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    transition: background 0.15s;
    padding: 0;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1;
}

#cw-widget .cw-flow-submit:hover {
    background: var(--cw-accent-dark);
    color: #fff;
}

#cw-widget .cw-flow-submit:focus {
    outline: none;
}


/* ---- Teaser bubble (notification-style message from agent) ---- */

#cw-widget .cw-teaser {
    position: fixed;
    bottom: 88px;
    right: 20px;
    z-index: var(--cw-z);
    cursor: pointer;
    max-width: 300px;
    padding-top: 6px;
    padding-right: 6px;
    animation: cw-teaser-in 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}

@keyframes cw-teaser-in {
    0% { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

#cw-widget .cw-teaser.cw-teaser-exit {
    animation: cw-teaser-out 0.2s ease-in forwards;
}

@keyframes cw-teaser-out {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(8px); opacity: 0; }
}

#cw-widget .cw-teaser-close {
    position: absolute;
    top: -4px;
    right: -4px;
    z-index: 1;
    width: 24px;
    height: 24px;
    min-width: 0;
    min-height: 0;
    border: none;
    background: #fff;
    color: var(--cw-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    opacity: 0.5;
    transition: opacity 0.15s ease, color 0.15s ease;
}

#cw-widget .cw-teaser:hover .cw-teaser-close,
#cw-widget .cw-teaser-close:focus {
    opacity: 1;
}

#cw-widget .cw-teaser-close:hover {
    color: #111;
}

#cw-widget .cw-teaser-close:focus {
    outline: none;
    opacity: 1;
}

#cw-widget .cw-teaser-inner {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

#cw-widget .cw-teaser-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#cw-widget .cw-teaser-bubble {
    background: #fff;
    color: #1a1a1a;
    padding: 10px 14px;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    max-width: 240px;
    word-wrap: break-word;
}

#cw-widget .cw-teaser-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--cw-accent);
    margin-bottom: 4px;
    line-height: 1;
}

/* Typing dots animation */
#cw-widget .cw-teaser-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 18px;
}

#cw-widget .cw-teaser-dots .cw-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b0b0b0;
    animation: cw-dot-bounce 1.2s ease-in-out infinite;
}

#cw-widget .cw-teaser-dots .cw-dot:nth-child(2) {
    animation-delay: 0.15s;
}

#cw-widget .cw-teaser-dots .cw-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes cw-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

#cw-widget .cw-teaser-text {
    display: inline;
}

/* Typing indicator inside flow messages (reuse existing dots) */
#cw-widget .cw-flow-messages .cw-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    align-self: flex-start;
    background: #f0f0f0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}


/* ==========================================================================
   Mobile — full-screen takeover
   ========================================================================== */

@media (max-width: 767px) {
    #cw-widget .cw-launcher {
        bottom: 16px;
        right: 16px;
    }

    #cw-widget .cw-panel {
        position: fixed;
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        height: auto;
        border-radius: 12px;
        transform-origin: bottom center;
        box-shadow: var(--cw-shadow);
    }

    #cw-widget .cw-panel.cw-panel-enter {
        animation: cw-panel-in-mobile 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    #cw-widget .cw-panel.cw-panel-exit {
        animation: cw-panel-out-mobile 0.2s ease-in forwards;
    }

    @keyframes cw-panel-in-mobile {
        0% { transform: translateY(100%); opacity: 0.8; }
        100% { transform: translateY(0); opacity: 1; }
    }

    @keyframes cw-panel-out-mobile {
        0% { transform: translateY(0); opacity: 1; }
        100% { transform: translateY(100%); opacity: 0; }
    }

    #cw-widget .cw-close-btn {
        width: 44px;
        height: 44px;
        font-size: 24px;
        top: 8px;
        right: 8px;
    }

    #cw-widget .cw-header {
        padding: 14px 16px;
        padding-right: 56px;
    }

    /* Prevent iOS zoom on inputs */
    #cw-widget .cw-input,
    #cw-widget .cw-composer-input {
        font-size: 16px;
    }

    #cw-widget .cw-submit-btn {
        padding: 14px;
        font-size: 16px;
    }

    #cw-widget .cw-send-btn {
        width: 44px;
        height: 44px;
    }

    #cw-widget .cw-chat-messages {
        min-height: 0;
        flex: 1;
    }

    #cw-widget .cw-view-chat {
        height: calc(100vh - 96px);
        height: calc(100dvh - 96px);
    }

    /* Menu buttons — slightly larger touch targets */
    #cw-widget .cw-menu-btn {
        padding: 16px;
        font-size: 16px;
    }

    /* Flow inputs — prevent iOS zoom */
    #cw-widget .cw-flow-input {
        font-size: 16px;
    }

    #cw-widget .cw-flow-submit {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    /* Teaser bubble — position relative to mobile launcher */
    #cw-widget .cw-teaser {
        bottom: 84px;
        right: 16px;
        max-width: calc(100vw - 80px);
    }
}
