/* CloudZexChat widget styles, served by the extension itself (theme-independent).
   Every rule is scoped to the widget root (.czch-root); the widget position comes from
   the extension settings and is appended by the stylesheet route. */

/* Launcher shadow (was public/assets/css/cloudzex-chat.css) */
.cloudzex-chat-launcher {
    box-shadow: 0 10px 25px -3px rgba(12, 57, 52, 0.4), 0 4px 6px -2px rgba(12, 57, 52, 0.2);
}

/* Alpine hides these until it has initialised */
.czch-root [x-cloak] {
    display: none !important;
}

.czch-root {
    position: relative !important;
    z-index: 999999999 !important;
}

.czch-root .czch-launcher {
    background: linear-gradient(135deg, #0c3934 0%, #16534c 100%) !important;
    color: #ffffff !important;
    width: 60px !important;
    height: 60px !important;
    opacity: 1 !important;
    visibility: visible !important;
    border: 2px solid #ffffff !important;
    position: fixed !important;
    z-index: 999999999 !important;
    border-radius: 50% !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.czch-root .czch-window {
    position: fixed !important;
    width: 425px;
    max-width: calc(100vw - 2rem);
    z-index: 999999999 !important;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
    background-color: #ffffff !important;
    /* A column: header and tabs on top, the messages grow, the input bar and the hand-off buttons stay at the
       bottom. No !important: Alpine x-show hides the window with an inline display:none. */
    display: flex;
    flex-direction: column;
    overflow: hidden auto;
}

/* Online agent avatars: stacked, the first one on top */
.czch-root .czch-agent {
    border-radius: 50% !important;
    overflow: hidden !important;
    width: 34px !important;
    height: 34px !important;
    border: 2px solid #ffffff !important;
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}
.czch-root .czch-agent:nth-child(1) { z-index: 10 !important; }
.czch-root .czch-agent:nth-child(2) { z-index: 9 !important; }
.czch-root .czch-agent:nth-child(3) { z-index: 8 !important; }
.czch-root .czch-agent:nth-child(4) { z-index: 7 !important; }
.czch-root .czch-agent:nth-child(n+2) { margin-left: -8px !important; }

/* WhatsApp / call buttons: two columns when both are enabled */
.czch-root .czch-grid { display: grid; gap: 10px; }
.czch-root .czch-grid--2 { grid-template-columns: 1fr 1fr; }
.czch-root .czch-grid--1 { grid-template-columns: 1fr; }

/* Chat / ticket tabs */
.czch-root .czch-tab {
    flex: 1;
    padding: 12px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    color: #64748b;
    background: transparent;
}
.czch-root .czch-tab.czch-tab--active {
    border-bottom-color: #0c3934;
    color: #0c3934;
}

/* ---- element styles (formerly inline) ---- */
/* span (x-show: Alpine removes the inline display on start, so no display here either) */
.czch-root .czch-2 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
/* svg */
.czch-root .czch-3 {
    width: 30px !important;
    height: 30px !important;
    color: #ffffff !important;
}
/* span */
.czch-root .czch-4 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
/* svg */
.czch-root .czch-5 {
    width: 28px !important;
    height: 28px !important;
    color: #ffffff !important;
}
/* div */
.czch-root .czch-6 {
    background: linear-gradient(135deg, #0c3934 0%, #16534c 100%) !important;
    padding: 18px 20px !important;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(12, 57, 52, 0.25) !important;
}
/* div */
.czch-root .czch-7 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}
/* h3 */
.czch-root .czch-8 {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: -0.01em !important;
}
/* button */
.czch-root .czch-9 {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.2s !important;
}
/* div */
.czch-root .czch-10 {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 4px !important;
}
/* span */
.czch-root .czch-11 {
    width: 7px !important;
    height: 7px !important;
    background-color: #22c55e !important;
    border-radius: 50% !important;
    display: inline-block !important;
}
/* span */
.czch-root .czch-12 {
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500 !important;
}
/* div */
.czch-root .czch-13 {
    display: flex !important;
    align-items: center !important;
    margin-top: 10px !important;
}
/* div */
.czch-root .czch-14 {
    display: flex !important;
    align-items: center !important;
}
/* img */
.czch-root .czch-15 {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
/* div */
.czch-root .czch-16 {
    border-radius: 50% !important;
    width: 34px !important;
    height: 34px !important;
    border: 2px solid #ffffff !important;
    z-index: 5 !important;
    margin-left: -8px !important;
    background-color: rgba(255,255,255,0.3) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
    backdrop-filter: blur(4px) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}
/* div */
.czch-root .czch-17 {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    background-color: #ffffff;
}
/* div */
.czch-root .czch-18 {
    width: 64px;
    height: 64px;
    background-color: #fee2e2;
    color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 28px;
}
/* h4 */
.czch-root .czch-19 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}
/* p */
.czch-root .czch-20 {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px 0;
}
/* div */
.czch-root .czch-21 {
    font-size: 12px;
    color: #94a3b8;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    width: 100%;
}
/* div */
.czch-root .czch-22 {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff;
}
/* div */
.czch-root .czch-23 {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* p */
.czch-root .czch-24 {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    margin: 0 0 18px 0;
    font-weight: 500;
}
/* div */
.czch-root .czch-25 {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
/* input */
.czch-root .czch-26 {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    outline: none;
    background-color: #f8fafc !important; /* beats the theme's high-specificity input rule, as the inline style did */
    color: #0f172a;
    transition: all 0.2s;
}
/* span */
.czch-root .czch-27 {
    font-size: 11px;
    color: #ef4444;
    margin-top: 4px;
    display: block;
}
/* button */
.czch-root .czch-28 {
    width: 100%;
    margin-top: 4px;
    padding: 12px;
    background: linear-gradient(135deg, #0c3934 0%, #16534c 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(12, 57, 52, 0.25);
    transition: all 0.2s;
}
/* div */
.czch-root .czch-29 {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 18px 0 14px 0;
    text-align: center;
}
/* span */
.czch-root .czch-30 {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
/* a */
.czch-root .czch-31 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #25D366;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(37, 211, 102, 0.2);
    transition: all 0.2s;
}
/* a */
.czch-root .czch-32 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #475569;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(71, 85, 105, 0.2);
    transition: all 0.2s;
}
/* div */
.czch-root .czch-33 {
    text-align: center;
    margin-top: 16px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
/* span */
.czch-root .czch-34 {
    color: #0c3934;
    font-weight: 600;
}
/* div */
.czch-root .czch-35 {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
}
/* div */
.czch-root .czch-36 {
    background-color: #f8fafc !important;
}
/* span */
.czch-root .czch-37 {
    background-color: #e2e8f0 !important;
    border-radius: 9999px !important;
}
/* div */
.czch-root .czch-38 {
    background-color: #e2e8f0 !important;
    border-radius: 50% !important;
}
/* div */
.czch-root .czch-39 {
    background-color: #ffffff !important;
    border-radius: 16px !important;
    border-top-left-radius: 0px !important;
}
/* div */
.czch-root .czch-40 {
    background: linear-gradient(135deg, #0c3934 0%, #16534c 100%) !important;
    color: #ffffff !important;
    border-radius: 16px !important;
    border-top-right-radius: 0px !important;
}
/* p */
.czch-root .czch-41 {
    margin: 0;
}
/* div */
.czch-root .czch-42 {
    margin-top: 8px;
}
/* img */
.czch-root .czch-43 {
    max-height: 180px;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
/* a */
.czch-root .czch-44 {
    text-decoration: none;
}
/* div */
.czch-root .czch-45 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid #0c3934;
}
/* img */
.czch-root .czch-46 {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
/* div */
.czch-root .czch-47 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #0c3934;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
/* div */
.czch-root .czch-48 {
    display: flex !important;
    gap: 12px !important;
    max-width: 85% !important;
    margin-top: 10px !important;
}
/* div */
.czch-root .czch-49 {
    background-color: #e2e8f0 !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    font-size: 14px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}
/* div */
.czch-root .czch-50 {
    background-color: #ffffff !important;
    border-radius: 16px !important;
    border-top-left-radius: 0px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    border: 1px solid #e2e8f0 !important;
    padding: 12px 16px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}
/* span */
.czch-root .czch-51 {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background-color: #94a3b8 !important;
    display: inline-block !important;
    animation-delay: 0ms !important;
}
/* span */
.czch-root .czch-52 {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background-color: #94a3b8 !important;
    display: inline-block !important;
    animation-delay: 150ms !important;
}
/* span */
.czch-root .czch-53 {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background-color: #94a3b8 !important;
    display: inline-block !important;
    animation-delay: 300ms !important;
}
/* div */
.czch-root .czch-54 {
    display: flex !important;
    gap: 10px !important;
    margin-top: 10px !important;
    max-width: 85% !important;
    align-items: center !important;
    background-color: #f0fdf4 !important;
    border: 1px solid #bbf7d0 !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
}
/* div */
.czch-root .czch-55 {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background-color: #0c3934 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    shrink: 0 !important;
}
/* div */
.czch-root .czch-56 {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
/* span */
.czch-root .czch-57 {
    font-size: 12px !important;
    color: #166534 !important;
    font-weight: 700 !important;
}
/* span */
.czch-root .czch-58 {
    display: inline-flex !important;
    gap: 3px !important;
}
/* span */
.czch-root .czch-59 {
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background-color: #166534 !important;
}
/* span */
.czch-root .czch-60 {
    animation-delay: 150ms;
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background-color: #166534 !important;
}
/* span */
.czch-root .czch-61 {
    animation-delay: 300ms;
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background-color: #166534 !important;
}
/* div */
.czch-root .czch-62 {
    background-color: #f1f5f9 !important;
}
/* div */
.czch-root .czch-63 {
    background-color: #fef2f2 !important;
}
/* div */
.czch-root .czch-64 {
    background-color: #ffffff !important;
}
/* input */
.czch-root .czch-65 {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
}
/* button */
.czch-root .czch-66 {
    background: linear-gradient(135deg, #0c3934 0%, #16534c 100%) !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer !important;
    shrink: 0 !important;
    box-shadow: 0 4px 10px rgba(12, 57, 52, 0.25) !important;
}
/* svg */
.czch-root .czch-67 {
    width: 18px;
    height: 18px;
}
/* div */
.czch-root .czch-68 {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}
/* div */
.czch-root .czch-69 {
    text-align: center;
    margin-bottom: 20px;
}
/* div */
.czch-root .czch-70 {
    width: 48px;
    height: 48px;
    background-color: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px auto;
    font-size: 20px;
}
/* h4 */
.czch-root .czch-71 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}
/* p */
.czch-root .czch-72 {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}
/* div */
.czch-root .czch-73 {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    margin-top: 10px;
}
/* span */
.czch-root .czch-74 {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}
/* h5 */
.czch-root .czch-75 {
    font-size: 14px;
    font-weight: 700;
    color: #166534;
    margin: 0 0 4px 0;
}
/* p */
.czch-root .czch-76 {
    font-size: 12px;
    color: #15803d;
    margin: 0;
}
/* div */
.czch-root .czch-77 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* label */
.czch-root .czch-78 {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}
/* input,select */
.czch-root .czch-79 {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    background-color: #ffffff;
    color: #1e293b;
}
/* textarea */
.czch-root .czch-80 {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
    resize: none;
    background-color: #ffffff;
    color: #1e293b;
    line-height: 1.4;
}
/* button */
.czch-root .czch-81 {
    width: 100%;
    margin-top: 8px;
    padding: 11px;
    background: linear-gradient(135deg, #0c3934 0%, #16534c 100%) !important;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(12, 57, 52, 0.3);
}

/* ---- hover / focus (formerly onmouseover / onfocus handlers) ---- */
.czch-root .czch-9:hover {
    background: rgba(255,255,255,0.3) !important;
}
.czch-root .czch-26:focus {
    border-color: #0c3934 !important;
    background-color: #ffffff !important;
}
.czch-root .czch-28:hover {
    background-color: #16534c;
}
.czch-root .czch-31:hover,
.czch-root .czch-32:hover {
    opacity: 0.9;
}

/* ---- Feature C: One-Click Human Hand-off Bar ---- */
.czch-root .czch-handoff-bar {
    padding: 8px 16px 18px;
    background-color: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.czch-root .czch-handoff-bar--highlight {
    background: linear-gradient(to bottom, #fef2f2, #fff7ed);
    border-top: 1px solid #fecaca;
    box-shadow: inset 0 2px 4px 0 rgba(239, 68, 68, 0.06);
}

.czch-root .czch-human-notice {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #0c3934;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 6px 10px;
    line-height: 1.3;
    font-weight: 500;
}

.czch-root .czch-human-notice-icon {
    flex-shrink: 0;
    font-size: 12px;
}

.czch-root .czch-handoff-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.czch-root .czch-btn-handoff {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    outline: none;
}

.czch-root .czch-btn-handoff:focus-visible {
    outline: 2px solid #0c3934;
    outline-offset: 1px;
}

.czch-root .czch-handoff-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.czch-root .czch-btn-whatsapp {
    background-color: #25d366;
    color: #ffffff !important;
    border-color: #20ba5a;
}

.czch-root .czch-btn-whatsapp:hover {
    background-color: #1ebc59;
    color: #ffffff !important;
}

/* Three buttons: WhatsApp + Call on the first row, "Talk to our team" full width below (no squeezed text) */
.czch-root .czch-handoff-actions {
    flex-wrap: wrap;
}
.czch-root .czch-handoff-actions:has(> :nth-child(3)) > .czch-btn-team {
    flex-basis: 100%;
}

.czch-root .czch-btn-call {
    background-color: #475569;
    color: #ffffff !important;
    border-color: #334155;
}

.czch-root .czch-btn-call:hover {
    background-color: #334155;
    color: #ffffff !important;
}

.czch-root .czch-btn-team {
    background-color: #ffffff;
    color: #0c3934;
    border-color: #cbd5e1;
}

.czch-root .czch-btn-team:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

.czch-root .czch-btn-team:disabled,
.czch-root .czch-btn-team--notified {
    background-color: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
    cursor: default;
}
.start-live-chat, a[href*="#live-chat"] {
    cursor: pointer;
}

/* ==========================================================================
   Theme-Independent Widget Scoped Classes (Batch F - Part C)
   Zero external Tailwind dependency. Scoped strictly under .czch-root.
   ========================================================================== */

.czch-root {
    --czch-primary: #0c3934;
    --czch-primary-dark: #16534c;
    --czch-bg-window: #ffffff;
    --czch-bg-body: #f8fafc;
    --czch-border: #f3f4f6;
    --czch-text-primary: #1f2937;
    --czch-text-secondary: #64748b;
    --czch-text-muted: #9ca3af;
    --czch-bg-incoming: #ffffff;
    --czch-border-incoming: #f3f4f6;
    --czch-bg-badge: #e2e8f0;
}

.dark .czch-root,
[data-theme="dark"] .czch-root {
    --czch-bg-window: #1e293b;
    --czch-bg-body: #0f172a;
    --czch-border: #334155;
    --czch-text-primary: #f8fafc;
    --czch-text-secondary: #94a3b8;
    --czch-text-muted: #64748b;
    --czch-bg-incoming: #1e293b;
    --czch-border-incoming: #334155;
    --czch-bg-badge: #334155;
}

.czch-root .czch-poll-anchor {
    position: fixed !important;
    top: 8px !important;
    right: 8px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.czch-root .czch-messages-body {
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    padding: 1.25rem !important;
}
.czch-root .czch-messages-body > * + * {
    margin-top: 1rem !important;
}

.czch-root .czch-date-separator {
    text-align: center !important;
    margin-top: 0.375rem !important;
    margin-bottom: 0.375rem !important;
}

.czch-root .czch-date-badge {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    color: var(--czch-text-secondary, #64748b) !important;
    background-color: var(--czch-bg-badge, #e2e8f0) !important;
    border-radius: 9999px !important;
    font-size: 10px !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
}

.czch-root .czch-msg-row-incoming {
    display: flex !important;
    gap: 0.75rem !important;
    max-width: 85% !important;
}

.czch-root .czch-avatar {
    width: 2rem !important;
    height: 2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.czch-root .czch-bubble-incoming {
    border: 1px solid var(--czch-border-incoming, #f3f4f6) !important;
    background-color: var(--czch-bg-incoming, #ffffff) !important;
    padding: 1rem !important;
    font-size: 0.875rem !important;
    line-height: 1.625 !important;
    color: var(--czch-text-primary, #1f2937) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.czch-root .czch-msg-row-outgoing {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
}
.czch-root .czch-msg-row-outgoing > * + * {
    margin-top: 0.25rem !important;
}

.czch-root .czch-bubble-outgoing {
    max-width: 85% !important;
    padding: 1rem !important;
    font-size: 0.875rem !important;
    line-height: 1.625 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.czch-root .czch-attachment-img {
    border-radius: 0.5rem !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.czch-root .czch-attachment-file {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    font-size: 0.75rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.75rem !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    text-decoration: none !important;
}
.czch-root .czch-attachment-file:hover {
    text-decoration: underline !important;
}

.czch-root .czch-msg-time-outgoing {
    font-size: 9px !important;
    color: var(--czch-text-muted, #9ca3af) !important;
    padding-right: 0.25rem !important;
}

.czch-root .czch-msg-col {
    display: flex !important;
    flex-direction: column !important;
}
.czch-root .czch-msg-col > * + * {
    margin-top: 0.25rem !important;
}

.czch-root .czch-msg-time-incoming {
    font-size: 9px !important;
    color: var(--czch-text-muted, #9ca3af) !important;
    padding-left: 0.25rem !important;
}

@keyframes czch-bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: none;
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}
.czch-root .czch-typing-dot {
    animation: czch-bounce 1s infinite !important;
}

.czch-root .czch-attachment-preview {
    padding: 0.625rem 1.25rem !important;
    border-top: 1px solid var(--czch-border, #f3f4f6) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 0.75rem !important;
    color: var(--czch-text-secondary, #64748b) !important;
}

.czch-root .czch-attachment-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 280px !important;
}

.czch-root .czch-attachment-remove {
    color: #ef4444 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    padding: 0 !important;
    font-size: 0.75rem !important;
}
.czch-root .czch-attachment-remove:hover {
    text-decoration: underline !important;
}

.czch-root .czch-upload-error {
    padding: 0.5rem 1.25rem !important;
    border-top: 1px solid #fee2e2 !important;
    font-size: 0.75rem !important;
    color: #ef4444 !important;
}

.czch-root .czch-input-bar {
    padding: 1rem !important;
    border-top: 1px solid var(--czch-border, #f3f4f6) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.625rem !important;
}

.czch-root .czch-input-file-hidden {
    display: none !important;
}

.czch-root .czch-upload-btn {
    padding: 0.625rem !important;
    color: var(--czch-text-muted, #9ca3af) !important;
    border-radius: 0.75rem !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    background: transparent !important;
}
.czch-root .czch-upload-btn:hover {
    color: var(--czch-text-primary, #4b5563) !important;
    background-color: var(--czch-border, #f3f4f6) !important;
}

.czch-root .czch-upload-icon {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

.czch-root .czch-chat-input {
    flex: 1 1 0% !important;
    background-color: transparent !important;
    border: 0 !important;
    font-size: 0.875rem !important;
    color: var(--czch-text-primary, #1f2937) !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}
.czch-root .czch-chat-input:focus {
    outline: none !important;
    box-shadow: none !important;
    border: 0 !important;
}
.czch-root .czch-chat-input::placeholder {
    color: var(--czch-text-muted, #9ca3af) !important;
}

/* === Alpine transition classes (theme-independent) === */
.czch-t-enter,
.czch-root .czch-t-enter {
    transition: opacity 300ms ease-out, transform 300ms ease-out !important;
}
.czch-t-enter-start,
.czch-root .czch-t-enter-start {
    opacity: 0 !important;
    transform: scale(0.95) translateY(2.5rem) !important;
}
.czch-t-enter-end,
.czch-root .czch-t-enter-end {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
}
.czch-t-leave,
.czch-root .czch-t-leave {
    transition: opacity 200ms ease-in, transform 200ms ease-in !important;
}
.czch-t-leave-start,
.czch-root .czch-t-leave-start {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
}
.czch-t-leave-end,
.czch-root .czch-t-leave-end {
    opacity: 0 !important;
    transform: scale(0.95) translateY(2.5rem) !important;
}



/* Links and bold text inside chat bubbles (ChatMessage::formattedHtml) */
.czch-root .czch-msg-link {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}
.czch-root .czch-39 strong {
    font-weight: 700;
}

/* AI avatar: white sparkle on the brand colour (welcome, AI replies, typing) */
.czch-root .czch-avatar.czch-38,
.czch-root .czch-49 {
    background-color: var(--czch-primary, #0c3934) !important;
    color: #ffffff !important;
}
.czch-root .czch-ai-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.czch-root .czch-launcher-pos {
    bottom: 40px !important;
    right: 24px !important;
}
.czch-root .czch-window-pos {
    bottom: 40px !important;
    right: 24px !important;
    height: min(680px, calc(100vh - 40px - 24px));
    max-height: calc(100vh - 40px - 24px);
}
@media (max-height: 800px) and (min-width: 768px) {
    .czch-root .czch-window-pos {
        height: min(640px, calc(100vh - 40px - 24px)) !important;
        max-height: calc(100vh - 40px - 24px) !important;
    }
}
@media (max-width: 767px) {
    .czch-root .czch-window-pos {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
    }
}
