/*!
 * Privly — proprietary WordPress live chat plugin.
 * Copyright (c) 2026 Privly. All rights reserved.
 * Unauthorized copying, distribution, modification, sublicensing or resale is prohibited.
 */
/* ==========================================================================
   Modern Contact Hours — widget
   ========================================================================== */

.mch-widget {
    --mch-accent: #0b7d66;
    --mch-bg: #ffffff;
    --mch-surface: #f7f7f5;
    --mch-text: #17181a;
    --mch-muted: #6b7280;
    --mch-border: rgba(23, 24, 26, 0.08);
    --mch-shadow: 0 24px 60px -20px rgba(17, 24, 39, 0.25), 0 2px 6px rgba(17, 24, 39, 0.06);
    --mch-accent-text: #ffffff; /* v5.7.8: auto-set by widget JS to black on light accents */
    --mch-radius: 20px;
    --mch-ease: cubic-bezier(.22,.8,.22,1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
    color: var(--mch-text);
    line-height: 1.5;
    font-size: 14px;
}
.mch-widget.mch-theme-dark {
    --mch-bg: #111214;
    --mch-surface: #1a1b1e;
    --mch-text: #f3f4f6;
    --mch-muted: #9ca3af;
    --mch-border: rgba(255,255,255,0.08);
    --mch-shadow: 0 24px 60px -20px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
}

/* --- Floating position --- */
.mch-widget.mch-floating { position: fixed; z-index: 99998; }
.mch-widget.mch-pos-bottom-right { right: var(--mch-offset-x, 22px); bottom: var(--mch-offset-y, 22px); }
.mch-widget.mch-pos-bottom-left  { left: var(--mch-offset-x, 22px); bottom: var(--mch-offset-y, 22px); }

/* --- Launcher button --- */
/* The button itself is the animation host — transforms and box-shadow live
 * here so they can extend outside any clip-path the inner shape uses. */
.mch-launcher {
    position: relative;
    width: var(--mch-launcher-size, 60px); height: var(--mch-launcher-size, 60px);
    background: transparent;
    color: #fff;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 30px -8px color-mix(in srgb, var(--mch-accent) 60%, transparent),
                0 2px 6px rgba(0,0,0,0.1);
    transition: transform .35s var(--mch-ease), box-shadow .3s var(--mch-ease);
    border-radius: 50%; /* default; overridden per shape */
}
.mch-launcher:hover { transform: translateY(-2px) scale(1.04); }
.mch-launcher:active { transform: scale(0.96); }

/* The visible "skin" — color, shape, clipping live here. By splitting the
 * shape from the button, animations on the button (translate, rotate, glow)
 * are not clipped by clip-path forms like hexagon. */
.mch-launcher-shape {
    position: absolute;
    inset: 0;
    background: var(--mch-accent);
    border-radius: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    pointer-events: none; /* let clicks fall through to the button */
}

.mch-launcher-icon { display:inline-flex; transition: transform .45s var(--mch-ease); }
.mch-widget.mch-is-panel-open .mch-launcher-icon { transform: rotate(90deg) scale(0.9); }

.mch-widget.mch-is-closed .mch-launcher { filter: saturate(0.75) brightness(0.95); }

/* --- Panel --- */
.mch-panel {
    position: absolute;
    bottom: calc(100% + 14px);
    width: 360px;
    max-width: calc(100vw - 40px);
    background: var(--mch-bg);
    border-radius: var(--mch-radius);
    box-shadow: var(--mch-shadow);
    border: 1px solid var(--mch-border);
    overflow: hidden;
    transform: translateY(12px) scale(.98);
    opacity: 0;
    pointer-events: none;
    transition: transform .35s var(--mch-ease), opacity .25s var(--mch-ease);
    display: flex;
    flex-direction: column;
    /* v3.1.1: lower the panel ceiling so the composer can never escape the
       viewport when the user zooms in. min() picks the smallest of:
         - 640px absolute cap
         - 100vh minus our top/bottom margins (60px each side)
       Using a ceiling instead of fixed prevents double scrollbars. */
    max-height: min(640px, calc(100dvh - 120px));
}
.mch-widget.mch-pos-bottom-right .mch-panel { right: 0; transform-origin: bottom right; }
.mch-widget.mch-pos-bottom-left  .mch-panel { left: 0;  transform-origin: bottom left; }
.mch-widget.mch-is-panel-open .mch-panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.mch-widget.mch-inline {
    position: relative;
    display: block;
    max-width: 440px;
    margin: 20px auto;
}
.mch-widget.mch-inline .mch-panel {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    width: 100%;
    max-width: 100%;
}

/* Header */
.mch-panel-header {
    position: relative;
    padding: 22px 22px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    background:
        radial-gradient(140% 120% at 0% 0%, color-mix(in srgb, var(--mch-accent) 18%, transparent) 0%, transparent 60%),
        var(--mch-bg);
    border-bottom: 1px solid var(--mch-border);
    /* v3.1.1: never shrink */
    flex-shrink: 0;
}
.mch-avatar {
    width: 42px; height: 42px;
    border-radius: 14px;
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    display:flex; align-items:center; justify-content:center;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--mch-accent) 60%, transparent);
    overflow: hidden;
}
.mch-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mch-header-text { flex: 1; min-width: 0; }
.mch-brand {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.mch-tag {
    font-size: 12.5px;
    color: var(--mch-muted);
    margin-top: 2px;
}
.mch-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--mch-muted);
    width: 32px; height: 32px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.mch-close:hover { background: var(--mch-surface); color: var(--mch-text); }

/* Status strip */
.mch-status-bar {
    padding: 10px 22px;
    font-size: 12.5px;
    color: var(--mch-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--mch-surface);
    border-bottom: 1px solid var(--mch-border);
}
.mch-status-bar strong { color: var(--mch-text); font-weight: 600; }
.mch-status-bar .mch-sep { opacity: 0.4; }
.mch-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #d1d5db;
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
}
.mch-is-open .mch-dot {
    background: #10b981;
    animation: mchBlink 2s ease-in-out infinite;
}
.mch-is-closed .mch-dot { background: #f59e0b; }
@keyframes mchBlink {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    50%      { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

/* Agent presence row removed in v2.5.5 — agent presence didn't add value
 * and confused customers when shown alongside opening hours. */

/* Hide the status bar entirely once the customer is inside an active chat —
 * opening hours are irrelevant when a conversation is already running, and
 * removing the bar gives the chat thread more visual space. */
.mch-widget.mch-is-chat-active .mch-status-bar { display: none; }

/* Body */
.mch-body {
    padding: 18px 22px 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* v3.2.1: when an active chat is rendered inside .mch-body, it takes over
   the entire body — disable the body's scroll so we don't get nested
   scrollbars, and remove the body's padding (chat-container has its own). */
.mch-body:has(.mch-chat-container) {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.mch-body:has(.mch-chat-container) .mch-step { display: none !important; }

/* Channels */
.mch-channels {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.mch-channel {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--mch-surface);
    border: 1px solid var(--mch-border);
    color: var(--mch-text);
    text-decoration: none;
    transition: transform .2s var(--mch-ease), background .2s, border-color .2s;
}
.mch-channel:hover {
    transform: translateX(2px);
    border-color: color-mix(in srgb, var(--mch-accent) 40%, var(--mch-border));
    background: color-mix(in srgb, var(--mch-accent) 6%, var(--mch-surface));
}
.mch-channel-icon {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--mch-bg);
    color: var(--mch-accent);
    display:flex; align-items:center; justify-content:center;
    border: 1px solid var(--mch-border);
    flex-shrink: 0;
}
.mch-channel-text { display:flex; flex-direction:column; min-width:0; }
.mch-channel-text strong { font-size: 13.5px; font-weight: 600; }
.mch-channel-text small {
    color: var(--mch-muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Divider */
.mch-divider {
    display:flex; align-items: center; gap: 10px;
    margin: 14px 0 12px;
    color: var(--mch-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.mch-divider::before, .mch-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--mch-border);
}

/* Form inputs with floating labels */
.mch-contact-form { display: flex; flex-direction: column; gap: 10px; }

/* Two-step flow */
.mch-step { display: none; flex-direction: column; gap: 10px; }
.mch-step.is-active { display: flex; animation: mchStepIn .35s var(--mch-ease); }
@keyframes mchStepIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mch-greeting {
    font-size: 15.5px; font-weight: 600;
    letter-spacing: -0.01em; margin: 0 0 2px;
}
.mch-greeting-sub {
    font-size: 13px; color: var(--mch-muted); margin: 0 0 6px;
}

.mch-back {
    align-self: flex-start;
    background: transparent; border: none; cursor: pointer;
    padding: 4px 0;
    color: var(--mch-muted); font-size: 12.5px; font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
    transition: color .2s;
}
.mch-back:hover { color: var(--mch-text); }

.mch-primary-btn {
    margin-top: 4px;
    background: var(--mch-accent); color: var(--mch-accent-text, #fff); border: none;
    border-radius: 12px; padding: 13px 16px;
    font-size: 14px; font-weight: 600; font-family: inherit;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: transform .2s var(--mch-ease), filter .2s;
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--mch-accent) 60%, transparent);
}
.mch-primary-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.mch-primary-btn:active { transform: translateY(0); }
.mch-primary-btn[disabled] { opacity: 0.7; cursor: progress; }
.mch-primary-btn svg { transition: transform .3s var(--mch-ease); }
.mch-primary-btn:hover svg { transform: translate(2px, 0); }
.mch-input { position: relative; }
.mch-input input, .mch-input textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--mch-surface);
    border: 1px solid var(--mch-border);
    border-radius: 12px;
    padding: 18px 14px 8px;
    color: var(--mch-text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.mch-input textarea { min-height: 80px; padding-top: 22px; }
.mch-input input:focus, .mch-input textarea:focus {
    outline: none;
    border-color: var(--mch-accent);
    background: var(--mch-bg);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mch-accent) 15%, transparent);
}
.mch-input label {
    position: absolute;
    top: 14px;
    left: 14px;
    font-size: 13px;
    color: var(--mch-muted);
    pointer-events: none;
    transition: transform .2s var(--mch-ease), color .2s, font-size .2s;
    background: transparent;
}
.mch-input input:focus + label,
.mch-input input:not(:placeholder-shown) + label,
.mch-input textarea:focus + label,
.mch-input textarea:not(:placeholder-shown) + label {
    transform: translateY(-7px);
    font-size: 11px;
    color: var(--mch-accent);
    font-weight: 500;
}

.mch-hp { position: absolute; left: -9999px; opacity: 0; }

/* Legacy .mch-send class kept as alias — inherits from .mch-primary-btn */
.mch-send { /* styled by .mch-primary-btn */ }

.mch-feedback {
    font-size: 13px;
    min-height: 0;
    color: var(--mch-muted);
    text-align: center;
    transition: color .2s;
    padding: 0 4px;
}
.mch-feedback.is-success { color: #10b981; font-weight: 500; }
.mch-feedback.is-error { color: #ef4444; }

/* Footer */
.mch-footer {
    padding: 10px 22px 14px;
    font-size: 11px;
    color: var(--mch-muted);
    text-align: center;
    border-top: 1px solid var(--mch-border);
    background: var(--mch-surface);
    /* v3.1.1: never shrink */
    flex-shrink: 0;
}

/* Mobile */
@media (max-width: 480px) {
    .mch-widget.mch-floating .mch-panel {
        width: calc(100vw - 24px);
        bottom: calc(100% + 10px);
    }
    .mch-widget.mch-pos-bottom-right { right: 14px; bottom: 14px; }
    .mch-widget.mch-pos-bottom-left  { left: 14px;  bottom: 14px; }
}
.mch-widget.mch-hide-mobile.mch-floating {
    @media (max-width: 640px) { display: none; }
}
@media (max-width: 640px) {
    .mch-widget.mch-hide-mobile.mch-floating { display: none; }
}

/* ==========================================================================
   Live chat - customer side
   ========================================================================== */
.mch-chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    /* v3.2.1: no negative margins — body padding is removed via :has selector
       so we can fill its parent natively. */
    min-height: 0;
    overflow: hidden;
}

.mch-chat-thread {
    flex: 1;
    /* v3.1.1: min-height:0 is required for flex children that scroll —
       without it Chrome/Safari refuse to shrink and the content overflows
       its parent, causing double scrollbars. */
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mch-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}
.mch-msg-customer { align-self: flex-end; align-items: flex-end; }
.mch-msg-agent { align-self: flex-start; align-items: flex-start; }

.mch-msg-agent{gap:4px;}
.mch-msg-agent-wrap{display:flex;align-items:flex-end;gap:8px;max-width:100%;}
.mch-msg-agent-avatar{width:28px;height:28px;border-radius:999px;background:var(--mch-accent);color:var(--mch-accent-text,#fff);display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;overflow:hidden;flex-shrink:0;box-shadow:0 4px 12px -8px color-mix(in srgb, var(--mch-accent) 45%, transparent);}
.mch-msg-agent-avatar img{width:100%;height:100%;object-fit:cover;display:block;}
.mch-msg-agent-stack{display:flex;flex-direction:column;align-items:flex-start;max-width:calc(100% - 36px);}


.mch-msg-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-wrap: break-word;
}
.mch-msg-customer .mch-msg-bubble {
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    border-bottom-right-radius: 4px;
}
.mch-msg-agent .mch-msg-bubble {
    background: var(--mch-surface);
    color: var(--mch-text);
    border: 1px solid var(--mch-border);
    border-bottom-left-radius: 4px;
}
.mch-msg-meta {
    font-size: 10.5px;
    color: var(--mch-muted);
    margin-top: 2px;
    padding: 0 4px;
}

.mch-chat-composer {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--mch-border);
    background: var(--mch-bg);
    /* v3.1.1: never let the composer shrink — it must always be visible */
    flex-shrink: 0;
}
.mch-chat-composer input {
    flex: 1;
    background: var(--mch-surface);
    border: 1px solid var(--mch-border);
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--mch-text);
    font-size: 13.5px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.mch-chat-composer input:focus {
    outline: none;
    border-color: var(--mch-accent);
    background: var(--mch-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mch-accent) 15%, transparent);
}
.mch-chat-composer button {
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    border: none;
    border-radius: 10px;
    width: 38px; height: 38px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: filter .15s, transform .15s;
}
.mch-chat-composer button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.mch-chat-end {
    background: transparent;
    border: none;
    color: var(--mch-muted);
    font-size: 11.5px;
    padding: 6px;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    border-top: 1px solid var(--mch-border);
    /* v3.1.1: never shrink */
    flex-shrink: 0;
}
.mch-chat-end:hover { color: #ef4444; }

/* Customer-side: system note when chat ends */
.mch-msg-system-end {
    align-self: center;
    background: rgba(245,158,11,0.1);
    color: #b45309;
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(245,158,11,0.25);
    margin: 6px 0;
    text-align: center;
}
.mch-widget.mch-theme-dark .mch-msg-system-end {
    background: rgba(245,158,11,0.12);
    color: #fbbf24;
}

/* ==========================================================================
   Launcher SHAPES (driven by [data-launcher] on .mch-widget)
   ========================================================================== */

/* CHAT — perfectly round circle (default) */
.mch-widget[data-launcher="chat"] .mch-launcher,
.mch-widget[data-launcher="chat"] .mch-launcher-shape {
    border-radius: 50%;
}

/* BUBBLE — speech bubble with one pointed corner toward the page */
.mch-widget[data-launcher="bubble"] .mch-launcher {
    border-radius: 22px 22px 22px 6px;
    width: calc(var(--mch-launcher-size, 60px) * 1.05);
    height: calc(var(--mch-launcher-size, 60px) * 0.92);
}
.mch-widget[data-launcher="bubble"] .mch-launcher-shape { border-radius: inherit; }
.mch-widget[data-launcher="bubble"].mch-pos-bottom-left .mch-launcher {
    border-radius: 22px 22px 6px 22px;
}

/* SQUARE — rounded square */
.mch-widget[data-launcher="square"] .mch-launcher,
.mch-widget[data-launcher="square"] .mch-launcher-shape {
    border-radius: 14px;
}

/* PILL — wide pill shape, ideal with a label inside */
.mch-widget[data-launcher="pill"] .mch-launcher {
    border-radius: 999px;
    width: calc(var(--mch-launcher-size, 60px) * 1.5);
}
.mch-widget[data-launcher="pill"] .mch-launcher-shape { border-radius: inherit; }

/* HEXAGON — clip-path lives on the SHAPE, not the button. This lets
 * box-shadow, transforms, and other animations extend beyond the hex
 * boundary instead of being clipped. */
.mch-widget[data-launcher="hexagon"] .mch-launcher {
    border-radius: 0;
    /* Box-shadow looks weird around a hexagon; use a drop-shadow filter on
     * the shape inside instead. */
    box-shadow: none;
}
.mch-widget[data-launcher="hexagon"] .mch-launcher-shape {
    border-radius: 0;
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
    -webkit-clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%);
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.18));
}

/* OUTLINE — circle with a transparent center and an accent ring */
.mch-widget[data-launcher="outline"] .mch-launcher,
.mch-widget[data-launcher="outline"] .mch-launcher-shape {
    border-radius: 50%;
}
.mch-widget[data-launcher="outline"] .mch-launcher-shape {
    background: transparent;
    border: 3px solid var(--mch-accent);
    color: var(--mch-accent);
}
.mch-widget[data-launcher="outline"] .mch-launcher {
    box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.15);
}
.mch-widget[data-launcher="outline"] .mch-launcher svg { color: var(--mch-accent); }

/* MINIMAL — small rounded square */
.mch-widget[data-launcher="minimal"] .mch-launcher {
    border-radius: 12px;
    width: calc(var(--mch-launcher-size, 60px) * 0.78);
    height: calc(var(--mch-launcher-size, 60px) * 0.78);
}
.mch-widget[data-launcher="minimal"] .mch-launcher-shape { border-radius: inherit; }
.mch-widget[data-launcher="minimal"] .mch-launcher-icon svg {
    width: 60%; height: 60%;
}

/* ==========================================================================
   Launcher ATTENTION EFFECTS (driven by [data-effect])
   ========================================================================== */

/* Default: hide the pulse ring (only the "pulse" effect uses it) */
.mch-widget .mch-launcher-pulse { display: none; }

/* PULSE — concentric ring radiating outward.
 * The ring is always circular, sized to circumscribe the launcher.
 * This looks consistent across all shapes (including hexagon, pill, etc). */
.mch-widget[data-effect="pulse"] .mch-launcher-pulse {
    display: block;
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid var(--mch-accent);
    opacity: 0.55;
    pointer-events: none;
    animation: mchAttnPulse 2s ease-out infinite;
}
@keyframes mchAttnPulse {
    0%   { transform: translate(-50%, -50%) scale(0.95); opacity: 0.55; }
    70%  { transform: translate(-50%, -50%) scale(1.55); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1.55); opacity: 0; }
}

/* VIBRATE — fast nervous jiggle every 4s */
.mch-widget[data-effect="vibrate"] .mch-launcher {
    animation: mchAttnVibrate 4s linear infinite;
}
@keyframes mchAttnVibrate {
    0%, 88%, 100% { transform: translate(0, 0); }
    89% { transform: translate(-1px, 1px); }
    90% { transform: translate(1px, -1px); }
    91% { transform: translate(-2px, 1px); }
    92% { transform: translate(2px, -1px); }
    93% { transform: translate(-1px, -1px); }
    94% { transform: translate(1px, 1px); }
    95% { transform: translate(-2px, 0); }
    96% { transform: translate(2px, 0); }
    97% { transform: translate(-1px, 1px); }
    98% { transform: translate(1px, -1px); }
}

/* BOUNCE — gentle vertical hop every 3s */
.mch-widget[data-effect="bounce"] .mch-launcher {
    animation: mchAttnBounce 3s ease-in-out infinite;
}
@keyframes mchAttnBounce {
    0%, 100% { transform: translateY(0); }
    8%       { transform: translateY(-12px); }
    16%      { transform: translateY(0); }
    24%      { transform: translateY(-6px); }
    32%      { transform: translateY(0); }
}

/* WIGGLE — playful left/right rotation every 5s */
.mch-widget[data-effect="wiggle"] .mch-launcher {
    animation: mchAttnWiggle 5s ease-in-out infinite;
    transform-origin: 50% 80%;
}
@keyframes mchAttnWiggle {
    0%, 88%, 100% { transform: rotate(0); }
    90%  { transform: rotate(-12deg); }
    92%  { transform: rotate(10deg); }
    94%  { transform: rotate(-8deg); }
    96%  { transform: rotate(6deg); }
    98%  { transform: rotate(-3deg); }
}

/* GLOW — accent-color halo softly breathes */
.mch-widget[data-effect="glow"] .mch-launcher {
    animation: mchAttnGlow 2.4s ease-in-out infinite;
}
@keyframes mchAttnGlow {
    0%, 100% { box-shadow: 0 8px 24px -10px var(--mch-accent), 0 0 0 0 var(--mch-accent); }
    50%      { box-shadow: 0 8px 32px -8px var(--mch-accent), 0 0 0 8px color-mix(in srgb, var(--mch-accent) 25%, transparent); }
}

/* SPARKLE — tiny twinkling dot in the corner. Positioned relative to the
 * outer button (not the clipped shape), so it shows up correctly for hexagon
 * and other clipped forms too. */
.mch-widget[data-effect="sparkle"] .mch-launcher::after {
    content: "";
    position: absolute;
    top: -2px; right: -2px;
    width: 10px; height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px 2px var(--mch-accent), 0 0 4px 1px #fff;
    animation: mchAttnSparkle 1.6s ease-in-out infinite;
    z-index: 2;
}
@keyframes mchAttnSparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.6); }
    50%      { opacity: 1;   transform: scale(1.15); }
}
/* On outline shape, give the dot more contrast */
.mch-widget[data-effect="sparkle"][data-launcher="outline"] .mch-launcher::after {
    background: var(--mch-accent);
    box-shadow: 0 0 8px 2px var(--mch-accent);
}

/* Pause all animations once the panel is open or on hover. We pause the
 * button-level animations (vibrate/bounce/wiggle/glow) AND the pulse ring
 * + sparkle pseudo-element. */
.mch-widget.mch-is-panel-open .mch-launcher,
.mch-widget .mch-launcher:hover,
.mch-widget.mch-is-panel-open .mch-launcher::after,
.mch-widget .mch-launcher:hover::after {
    animation-play-state: paused !important;
}
.mch-widget.mch-is-panel-open .mch-launcher-pulse,
.mch-widget .mch-launcher:hover ~ .mch-launcher-pulse,
.mch-widget .mch-launcher:hover .mch-launcher-pulse {
    animation-play-state: paused;
}

/* Locked chat state (after agent closes or customer ends) */
.mch-chat-container.mch-is-locked .mch-chat-composer {
    padding: 14px 16px;
    border-top: 1px solid var(--mch-border);
}
.mch-chat-composer .mch-restart-chat {
    flex: 1;
    width: auto;
    height: auto;
    min-height: 40px;
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    border: none;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: filter .15s, transform .15s;
}
.mch-chat-composer .mch-restart-chat:hover { filter: brightness(1.08); }
.mch-chat-composer .mch-restart-chat:active { transform: translateY(1px); }

/* Availability indicator inside Step 1 */
.mch-availability {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 14px;
    background: var(--mch-surface);
    border: 1px solid var(--mch-border);
    color: var(--mch-muted);
    transition: background .2s, color .2s, border-color .2s;
}
.mch-availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
}
.mch-availability.is-online {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: #047857;
}
.mch-availability.is-online .mch-availability-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
    animation: mchAvailPulse 2s ease-in-out infinite;
}
.mch-availability.is-offline {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.22);
    color: #b45309;
}
.mch-availability.is-offline .mch-availability-dot {
    background: #f59e0b;
}
.mch-widget.mch-theme-dark .mch-availability.is-online { color: #6ee7b7; }
.mch-widget.mch-theme-dark .mch-availability.is-offline { color: #fbbf24; }

@keyframes mchAvailPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.mch-primary-btn:disabled {
    cursor: not-allowed !important;
    transform: none !important;
}

/* "(optional)" hint inside floating labels */
.mch-field-hint {
    color: var(--mch-muted);
    font-size: 0.85em;
    font-weight: 400;
    margin-left: 4px;
}

/* Field error state */
.mch-input.is-invalid input,
.mch-input.is-invalid textarea {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}
.mch-input-error {
    color: #ef4444;
    font-size: 11.5px;
    margin: 4px 0 0 4px;
    line-height: 1.4;
    display: block;
}

/* ==========================================================================
   Typing indicator (customer side)
   ========================================================================== */
.mch-typing-row {
    padding: 4px 14px 6px;
    display: flex;
    align-items: center;
}
.mch-typing-bubble {
    display: inline-flex;
    gap: 3px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
}
.mch-typing-bubble span {
    width: 6px;
    height: 6px;
    background: var(--mch-muted, #9ca3af);
    border-radius: 50%;
    animation: mchTypingBounce 1.4s infinite ease-in-out;
}
.mch-typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.mch-typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mchTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.55; }
    30%           { transform: translateY(-3px); opacity: 1; }
}

/* System notes inside the chat thread (apology, agent joined, etc).
 * Subtle italics-style note centered between message bubbles. */
.mch-system-note {
    text-align: center;
    font-size: 12px;
    color: var(--mch-muted);
    font-style: italic;
    padding: 8px 16px;
    margin: 8px 0;
    line-height: 1.4;
}

/* Typing indicator: name beside dots ("Anna is typing…") */
.mch-typing-name {
    font-size: 11.5px;
    color: var(--mch-muted);
    font-style: italic;
    margin-left: 4px;
}


/* ==========================================================================
   v2.7.0: Image attachments (customer side)
   ========================================================================== */

.mch-attach-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px;
    color: var(--mch-muted, #9ca3af);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.mch-attach-btn:hover {
    color: var(--mch-text);
    background: rgba(255, 255, 255, 0.04);
}

.mch-attach-preview {
    padding: 8px 14px;
    border-top: 1px solid var(--mch-border);
    background: rgba(0, 0, 0, 0.02);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mch-attach-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 4px 4px;
    background: var(--mch-surface);
    border: 1px solid var(--mch-border);
    border-radius: 6px;
    font-size: 12px;
    max-width: 200px;
}
.mch-attach-chip img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.mch-attach-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mch-text);
}
.mch-attach-chip-x {
    background: transparent;
    border: 0;
    color: var(--mch-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 4px;
    flex-shrink: 0;
}
.mch-attach-chip-x:hover { color: #ef4444; }

.mch-attach-error {
    padding: 6px 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border-radius: 6px;
    font-size: 12px;
    width: 100%;
    margin-top: 4px;
}

.mch-msg-attachments {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.mch-msg-img-link {
    display: block;
    max-width: 240px;
}
.mch-msg-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    cursor: zoom-in;
    display: block;
}
.mch-msg-file {
    display: inline-block;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--mch-text);
    text-decoration: none;
    font-size: 13px;
}
.mch-msg-file:hover { background: rgba(255, 255, 255, 0.12); }

/* v3.2.0 — emoji picker (customer side) */
.mch-emoji-btn {
    /* v3.2.1: match .mch-attach-btn so they look uniform */
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px;
    color: var(--mch-muted, #9ca3af);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}
.mch-emoji-btn:hover {
    color: var(--mch-text);
    background: var(--mch-surface);
}
.mch-chat-container { position: relative; }
.mch-emoji-picker {
    position: absolute;
    bottom: 56px;
    left: 12px;
    right: 12px;
    background: var(--mch-bg);
    border: 1px solid var(--mch-border);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 12px 32px -8px rgba(0,0,0,0.25);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 6px;
    max-height: 240px;
    overflow: auto;
    z-index: 10;
}
.mch-emoji-cell {
    background: var(--mch-surface) !important;
    border: 1px solid var(--mch-border) !important;
    cursor: pointer;
    min-width: 42px;
    min-height: 42px;
    padding: 0 !important;
    font-size: 25px;
    line-height: 1;
    border-radius: 10px;
    transition: background .12s, transform .12s, border-color .12s;
    display: grid;
    place-items: center;
    color: var(--mch-text);
}
.mch-emoji-cell:hover {
    background: color-mix(in srgb, var(--mch-accent) 16%, var(--mch-surface)) !important;
    border-color: color-mix(in srgb, var(--mch-accent) 50%, var(--mch-border)) !important;
    transform: translateY(-1px);
}

/* v3.3.0 — message edit (customer side) */
.mch-msg-edited {
    color: var(--mch-muted);
    font-size: 10.5px;
    font-style: italic;
}
.mch-msg-edit-btn {
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    color: var(--mch-muted);
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity .12s, color .12s, background .12s;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}
.mch-msg-edit-btn:hover {
    opacity: 1;
    color: var(--mch-text);
    background: var(--mch-surface);
}
.mch-msg.is-editing .mch-msg-meta { opacity: 0.5; }
.mch-msg-edit-input {
    width: 100%;
    background: var(--mch-surface);
    border: 1px solid var(--mch-border);
    color: var(--mch-text);
    padding: 8px 10px;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 13.5px;
    line-height: 1.45;
    min-height: 40px;
    box-sizing: border-box;
}
.mch-msg-edit-input:focus {
    outline: none;
    border-color: var(--mch-accent);
}
.mch-msg-edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}
.mch-msg-edit-actions button {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--mch-border);
    background: var(--mch-bg);
    color: var(--mch-text);
}
.mch-msg-edit-save {
    background: var(--mch-accent) !important;
    color: var(--mch-accent-text, #fff) !important;
    border-color: var(--mch-accent) !important;
}


/* ==========================================================================
   Privly 5.4.0 — Customer widget UX polish
   Scope: visual/customer-side widget only. Accent color still comes from settings.
   ========================================================================== */

.mch-widget {
    --mch-panel-width: 388px;
    --mch-panel-max-height: min(680px, calc(100dvh - 104px));
}

.mch-widget.mch-floating {
    isolation: isolate;
}

.mch-launcher {
    box-shadow:
        0 18px 42px -18px color-mix(in srgb, var(--mch-accent) 78%, transparent),
        0 10px 22px -14px rgba(15, 23, 42, .42);
}

.mch-launcher-shape {
    background:
        radial-gradient(120% 120% at 25% 15%, rgba(255,255,255,.22), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--mch-accent) 92%, #ffffff 8%), var(--mch-accent));
}

.mch-launcher::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: color-mix(in srgb, var(--mch-accent) 18%, transparent);
    opacity: .9;
    z-index: -1;
    filter: blur(8px);
}

.mch-widget.mch-is-panel-open .mch-launcher::before {
    opacity: 0;
}

.mch-panel {
    width: var(--mch-panel-width);
    max-height: var(--mch-panel-max-height);
    border-radius: min(24px, var(--mch-radius));
    border-color: color-mix(in srgb, var(--mch-border) 80%, var(--mch-accent) 20%);
    box-shadow:
        0 30px 80px -28px rgba(15, 23, 42, .42),
        0 16px 34px -28px color-mix(in srgb, var(--mch-accent) 65%, transparent);
    backdrop-filter: blur(14px);
}

.mch-widget.mch-inline .mch-panel {
    border-radius: min(24px, var(--mch-radius));
}

.mch-panel-header {
    padding: 20px 20px 16px;
    gap: 13px;
    background:
        radial-gradient(140% 140% at 0% 0%, color-mix(in srgb, var(--mch-accent) 22%, transparent) 0%, transparent 56%),
        linear-gradient(180deg, color-mix(in srgb, var(--mch-bg) 92%, var(--mch-accent) 8%), var(--mch-bg));
}

.mch-avatar {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background:
        radial-gradient(120% 120% at 22% 14%, rgba(255,255,255,.22), transparent 38%),
        var(--mch-accent);
}

.mch-avatar img {
    object-fit: contain;
    padding: 4px;
    box-sizing: border-box;
}

.mch-brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mch-brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: -.025em;
}

.mch-header-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    line-height: 1;
    font-weight: 800;
    border: 1px solid transparent;
}

.mch-header-status span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

.mch-header-status.is-online {
    color: #059669;
    background: rgba(16,185,129,.11);
    border-color: rgba(16,185,129,.18);
}

.mch-header-status.is-offline {
    color: #b45309;
    background: rgba(245,158,11,.12);
    border-color: rgba(245,158,11,.18);
}

.mch-widget.mch-theme-dark .mch-header-status.is-online {
    color: #6ee7b7;
    background: rgba(16,185,129,.14);
}
.mch-widget.mch-theme-dark .mch-header-status.is-offline {
    color: #fbbf24;
    background: rgba(245,158,11,.14);
}

.mch-tag {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mch-close {
    background: color-mix(in srgb, var(--mch-surface) 72%, transparent);
    border: 1px solid var(--mch-border);
}

.mch-status-bar {
    padding: 11px 20px;
    background: color-mix(in srgb, var(--mch-surface) 82%, var(--mch-bg) 18%);
}

.mch-body {
    padding: 18px 20px 10px;
}

.mch-availability {
    border-radius: 15px !important;
    padding: 12px 13px !important;
    margin-bottom: 13px !important;
    line-height: 1.35;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.mch-greeting {
    font-size: 16.5px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -.025em;
}

.mch-greeting-sub {
    font-size: 13px;
    line-height: 1.45;
}

.mch-channels {
    gap: 9px;
}

.mch-channel {
    padding: 12px;
    border-radius: 15px;
    background: color-mix(in srgb, var(--mch-surface) 82%, var(--mch-bg) 18%);
}

.mch-channel-icon {
    border-radius: 13px;
    color: var(--mch-accent);
    background: color-mix(in srgb, var(--mch-accent) 9%, var(--mch-bg));
}

.mch-divider {
    margin: 15px 0 13px;
}

.mch-contact-form,
.mch-step {
    gap: 11px;
}

.mch-input input,
.mch-input textarea {
    border-radius: 15px;
    padding-left: 15px;
    padding-right: 15px;
    background: color-mix(in srgb, var(--mch-surface) 84%, var(--mch-bg) 16%);
}

.mch-input textarea {
    min-height: 92px;
}

.mch-primary-btn {
    border-radius: 15px;
    min-height: 46px;
    font-weight: 800;
    box-shadow:
        0 14px 28px -16px color-mix(in srgb, var(--mch-accent) 80%, transparent),
        inset 0 1px 0 rgba(255,255,255,.18);
}

.mch-back {
    border: 1px solid var(--mch-border);
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--mch-surface);
}

/* Active chat */
.mch-chat-thread {
    padding: 18px 18px 14px;
    gap: 9px;
    background:
        radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--mch-accent) 6%, transparent), transparent 44%),
        var(--mch-bg);
}

.mch-msg {
    max-width: 84%;
}

.mch-msg-bubble {
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13.5px;
    box-shadow: 0 1px 0 rgba(15,23,42,.03);
}

.mch-msg-customer .mch-msg-bubble {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--mch-accent) 90%, #ffffff 10%), var(--mch-accent));
    border-bottom-right-radius: 5px;
}

.mch-msg-agent .mch-msg-bubble {
    background: color-mix(in srgb, var(--mch-surface) 86%, var(--mch-bg) 14%);
    border-bottom-left-radius: 5px;
}

.mch-msg-meta {
    margin-top: 3px;
}

.mch-chat-composer {
    padding: 12px 14px;
    gap: 8px;
    background: color-mix(in srgb, var(--mch-bg) 94%, var(--mch-accent) 6%);
}

.mch-chat-composer input {
    border-radius: 999px;
    min-height: 42px;
    padding: 9px 14px;
    background: var(--mch-surface);
}

.mch-chat-composer button,
.mch-attach-btn,
.mch-emoji-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    padding: 0;
}

.mch-attach-btn,
.mch-emoji-btn {
    border: 1px solid var(--mch-border);
    background: var(--mch-surface);
}

.mch-attach-btn:hover,
.mch-emoji-btn:hover {
    color: var(--mch-accent);
    border-color: color-mix(in srgb, var(--mch-accent) 34%, var(--mch-border));
    background: color-mix(in srgb, var(--mch-accent) 8%, var(--mch-surface));
}

.mch-chat-composer button[type="submit"] {
    box-shadow: 0 10px 20px -12px color-mix(in srgb, var(--mch-accent) 75%, transparent);
}

.mch-attach-preview {
    padding: 10px 14px;
    background: color-mix(in srgb, var(--mch-surface) 72%, var(--mch-bg) 28%);
}

.mch-attach-chip {
    border-radius: 999px;
    padding: 5px 9px 5px 5px;
    max-width: 230px;
}

.mch-attach-chip img {
    border-radius: 999px;
}

.mch-emoji-picker {
    border-radius: 18px;
    box-shadow: 0 18px 44px -18px rgba(0,0,0,.34);
}

.mch-chat-end {
    padding: 8px;
    font-weight: 650;
}

.mch-footer {
    padding: 10px 20px 14px;
    background: color-mix(in srgb, var(--mch-surface) 82%, var(--mch-bg) 18%);
}

.mch-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.mch-footer span::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--mch-accent);
    opacity: .7;
}

/* Mobile widget should feel like a compact bottom sheet, not a cramped desktop card. */
@media (max-width: 480px) {
    .mch-widget.mch-floating .mch-panel {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        max-height: min(680px, calc(100dvh - 92px));
        bottom: calc(100% + 10px);
        border-radius: 22px;
    }

    .mch-widget.mch-pos-bottom-right {
        right: 10px;
        bottom: 10px;
    }

    .mch-widget.mch-pos-bottom-left {
        left: 10px;
        bottom: 10px;
    }

    .mch-panel-header {
        padding: 17px 16px 14px;
    }

    .mch-body {
        padding: 16px 16px 8px;
    }

    .mch-chat-thread {
        padding: 15px 14px 12px;
    }

    .mch-msg {
        max-width: 88%;
    }

    .mch-chat-composer {
        padding: 10px;
    }

    .mch-chat-composer input {
        min-width: 0;
    }
}


/* ==========================================================================
   Privly 5.4.1 — Widget uploaded logo hotfix
   Scope: visual-only. Uploaded logos no longer get an accent-colored plate.
   ========================================================================== */

.mch-avatar.mch-avatar-has-logo {
    background: #ffffff !important;
    color: var(--mch-text);
    border: 1px solid var(--mch-border);
    box-shadow:
        0 10px 24px -18px rgba(15, 23, 42, .45),
        inset 0 1px 0 rgba(255,255,255,.7);
}

.mch-widget.mch-theme-dark .mch-avatar.mch-avatar-has-logo {
    background: rgba(255,255,255,.96) !important;
    border-color: rgba(255,255,255,.16);
}

.mch-avatar.mch-avatar-has-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    padding: 5px;
    box-sizing: border-box;
    border-radius: 12px;
    background: transparent !important;
}

.mch-avatar.mch-avatar-initial {
    background:
        radial-gradient(120% 120% at 22% 14%, rgba(255,255,255,.22), transparent 38%),
        var(--mch-accent);
    color: var(--mch-accent-text, #fff);
}

/* The launcher icon remains accent-colored; this fix only targets uploaded logo avatars. */


/* ==========================================================================
   Privly 5.4.6 — Better launcher shapes + more fun effects
   Scope: launcher visuals only. Accent color still comes from widget settings.
   ========================================================================== */

/* BLOB — organic rounded shape */
.mch-widget[data-launcher="blob"] .mch-launcher,
.mch-widget[data-launcher="blob"] .mch-launcher-shape {
    border-radius: 57% 43% 46% 54% / 46% 56% 44% 54%;
}

/* DIAMOND — tilted premium-style launcher */
.mch-widget[data-launcher="diamond"] .mch-launcher {
    border-radius: 16px;
    transform: rotate(45deg);
}
.mch-widget[data-launcher="diamond"] .mch-launcher:hover {
    transform: rotate(45deg) translateY(-2px) scale(1.04);
}
.mch-widget[data-launcher="diamond"] .mch-launcher:active {
    transform: rotate(45deg) scale(.96);
}
.mch-widget[data-launcher="diamond"] .mch-launcher-shape {
    border-radius: 16px;
}
.mch-widget[data-launcher="diamond"] .mch-launcher-icon {
    transform: rotate(-45deg);
}
.mch-widget[data-launcher="diamond"].mch-is-panel-open .mch-launcher-icon {
    transform: rotate(45deg) scale(.9);
}

/* BADGE — friendly chat badge with a subtle corner */
.mch-widget[data-launcher="badge"] .mch-launcher,
.mch-widget[data-launcher="badge"] .mch-launcher-shape {
    border-radius: 22px 22px 8px 22px;
}
.mch-widget[data-launcher="badge"].mch-pos-bottom-left .mch-launcher,
.mch-widget[data-launcher="badge"].mch-pos-bottom-left .mch-launcher-shape {
    border-radius: 22px 22px 22px 8px;
}

/* New attention effects */
.mch-widget[data-effect="float"] .mch-launcher {
    animation: mchAttnFloat 2.6s ease-in-out infinite;
}
@keyframes mchAttnFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mch-widget[data-effect="heartbeat"] .mch-launcher {
    animation: mchAttnHeartbeat 1.7s ease-in-out infinite;
}
@keyframes mchAttnHeartbeat {
    0%, 100% { transform: scale(1); }
    16% { transform: scale(1.12); }
    30% { transform: scale(.97); }
    45% { transform: scale(1.09); }
    62% { transform: scale(1); }
}

.mch-widget[data-effect="swing"] .mch-launcher {
    transform-origin: 50% 0%;
    animation: mchAttnSwing 2.1s ease-in-out infinite;
}
@keyframes mchAttnSwing {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(8deg); }
    40% { transform: rotate(-7deg); }
    60% { transform: rotate(4deg); }
}

.mch-widget[data-effect="tada"] .mch-launcher {
    animation: mchAttnTada 2.3s ease-in-out infinite;
}
@keyframes mchAttnTada {
    0%, 100% { transform: scale(1) rotate(0); }
    10% { transform: scale(.92) rotate(-5deg); }
    22% { transform: scale(1.08) rotate(6deg); }
    34% { transform: scale(1.08) rotate(-5deg); }
    46% { transform: scale(1.04) rotate(4deg); }
    58% { transform: scale(1) rotate(0); }
}

/* Hover should pause the new effects too. */
.mch-widget.mch-is-panel-open .mch-launcher,
.mch-widget .mch-launcher:hover {
    animation-play-state: paused !important;
}

@media (prefers-reduced-motion: reduce) {
    .mch-widget[data-effect="float"] .mch-launcher,
    .mch-widget[data-effect="heartbeat"] .mch-launcher,
    .mch-widget[data-effect="swing"] .mch-launcher,
    .mch-widget[data-effect="tada"] .mch-launcher {
        animation: none !important;
    }
}


/* ==========================================================================
   Privly 5.6.4 — Customer widget header polish
   The duplicate status strip was removed from the template. Header now carries
   the brand/accent state more clearly.
   ========================================================================== */

.mch-panel-header {
    background:
        radial-gradient(120% 150% at 0% 0%, color-mix(in srgb, var(--mch-accent) 28%, transparent) 0%, transparent 58%),
        linear-gradient(135deg,
            color-mix(in srgb, var(--mch-accent) 12%, var(--mch-bg)) 0%,
            var(--mch-bg) 70%) !important;
    border-bottom-color: color-mix(in srgb, var(--mch-accent) 28%, var(--mch-border)) !important;
}

.mch-widget.mch-theme-dark .mch-panel-header {
    background:
        radial-gradient(120% 150% at 0% 0%, color-mix(in srgb, var(--mch-accent) 34%, transparent) 0%, transparent 58%),
        linear-gradient(135deg,
            color-mix(in srgb, var(--mch-accent) 18%, var(--mch-bg)) 0%,
            var(--mch-bg) 74%) !important;
}

.mch-header-status.is-online {
    color: color-mix(in srgb, var(--mch-accent) 72%, #059669) !important;
    background: color-mix(in srgb, var(--mch-accent) 13%, rgba(16,185,129,.10)) !important;
    border-color: color-mix(in srgb, var(--mch-accent) 24%, rgba(16,185,129,.18)) !important;
}

.mch-header-status.is-online span {
    background: currentColor !important;
}

/* Belt-and-braces: the old strip is gone in PHP, but keep hidden if cached markup appears. */
.mch-status-bar {
    display: none !important;
}


/* ==========================================================================
   Privly 5.6.8 — Widget footer branding
   ========================================================================== */
.mch-powered,
.mch-footer,
.mch-widget-powered,
.mch-branding,
.mch-powered-by {
    color: var(--mch-muted) !important;
    opacity: 1 !important;
    font-size: 12px;
}

.mch-powered strong,
.mch-footer strong,
.mch-widget-powered strong,
.mch-branding strong,
.mch-powered-by strong {
    color: var(--mch-text) !important;
    font-weight: 800;
}


/* ==========================================================================
   Privly 6.0.0 — Customer review screen
   ========================================================================== */
.mch-review-screen {
    width: 100%;
    padding: 18px;
}
.mch-review-card {
    display: grid;
    gap: 14px;
    text-align: center;
    padding: 22px 16px;
    border-radius: 18px;
    background: var(--mch-card, rgba(255,255,255,.06));
    border: 1px solid var(--mch-border, rgba(148,163,184,.22));
}
.mch-review-kicker {
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--mch-accent);
    color: var(--mch-accent-text,#fff);
    font-weight: 900;
}
.mch-review-card h3 {
    margin: 0;
    color: var(--mch-text);
    font-size: 20px;
    line-height: 1.2;
}
.mch-review-card p {
    margin: -6px 0 2px;
    color: var(--mch-muted);
    font-size: 13px;
}
.mch-review-resolved {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.mch-review-resolved button,
.mch-review-submit,
.mch-review-skip {
    border: 1px solid var(--mch-border, rgba(148,163,184,.22));
    border-radius: 12px;
    background: var(--mch-panel, rgba(255,255,255,.06));
    color: var(--mch-text);
    padding: 10px 12px;
    font-weight: 800;
    cursor: pointer;
}
.mch-review-resolved button.is-selected,
.mch-review-submit {
    background: var(--mch-accent);
    color: var(--mch-accent-text,#fff);
    border-color: var(--mch-accent);
}
.mch-review-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}
.mch-review-rating-label {
    color: var(--mch-muted);
    font-size: 13px;
    font-weight: 800;
}
.mch-review-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
}
.mch-review-stars button {
    border: 0;
    background: transparent;
    color: color-mix(in srgb, var(--mch-muted) 55%, transparent);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.mch-review-stars button.is-selected {
    color: #f59e0b;
}
.mch-review-comment {
    width: 100%;
    min-height: 84px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid var(--mch-border, rgba(148,163,184,.22));
    background: var(--mch-panel, rgba(255,255,255,.06));
    color: var(--mch-text);
    padding: 10px 12px;
    font: inherit;
}
.mch-review-skip {
    background: transparent;
    color: var(--mch-muted);
}


/* ==========================================================================
   Privly 6.0.1 — Polished standalone customer review screen
   Review UI is appended outside the chat composer so buttons do not inherit
   composer circular/send-button styles.
   ========================================================================== */
.mch-chat-container > .mch-review-screen {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 4vw, 22px);
    overflow-y: auto;
}

.mch-chat-container > .mch-review-screen .mch-review-card {
    width: min(100%, 360px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    text-align: center;
    padding: 22px 18px;
    border-radius: calc(var(--mch-radius, 20px) + 2px);
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--mch-accent) 7%, var(--mch-panel, #ffffff)),
            var(--mch-panel, #ffffff)
        );
    border: 1px solid color-mix(in srgb, var(--mch-accent) 18%, var(--mch-border, rgba(148,163,184,.22)));
    box-shadow: 0 18px 48px rgba(15, 23, 42, .10);
}

.mch-chat-container > .mch-review-screen .mch-review-kicker {
    width: 46px;
    height: 46px;
    margin: 0 auto 2px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--mch-accent) 28%, transparent);
    font-size: 20px;
    font-weight: 900;
}

.mch-chat-container > .mch-review-screen .mch-review-card h3 {
    margin: 0;
    color: var(--mch-text);
    font-size: 22px;
    line-height: 1.16;
    letter-spacing: -.025em;
    font-weight: 900;
}

.mch-chat-container > .mch-review-screen .mch-review-card p {
    margin: -4px 0 2px;
    color: var(--mch-muted);
    font-size: 13.5px;
    line-height: 1.45;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved button,
.mch-chat-container > .mch-review-screen .mch-review-submit,
.mch-chat-container > .mch-review-screen .mch-review-skip {
    appearance: none;
    width: 100%;
    height: auto;
    min-height: 42px;
    border: 1px solid var(--mch-border, rgba(148,163,184,.22));
    border-radius: 13px;
    background: color-mix(in srgb, var(--mch-panel, #ffffff) 88%, var(--mch-accent) 4%);
    color: var(--mch-text);
    padding: 10px 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.1;
    font-weight: 900;
    cursor: pointer;
    box-shadow: none;
    transform: none;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved button.is-selected {
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    border-color: var(--mch-accent);
}

.mch-chat-container > .mch-review-screen .mch-review-rating-label {
    margin-top: 4px;
    color: var(--mch-muted);
    font-size: 13px;
    font-weight: 900;
}

.mch-chat-container > .mch-review-screen .mch-review-stars {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: -2px 0 2px;
}

.mch-chat-container > .mch-review-screen .mch-review-stars button {
    appearance: none;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    border: 0;
    background: transparent !important;
    color: color-mix(in srgb, var(--mch-muted) 60%, transparent);
    box-shadow: none;
    font-size: 32px;
    line-height: 1;
    padding: 0 1px;
    cursor: pointer;
}

.mch-chat-container > .mch-review-screen .mch-review-stars button.is-selected {
    color: #f59e0b;
}

.mch-chat-container > .mch-review-screen .mch-review-comment {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    border-radius: 13px;
    border: 1px solid var(--mch-border, rgba(148,163,184,.22));
    background: var(--mch-panel, #ffffff);
    color: var(--mch-text);
    padding: 11px 12px;
    font: inherit;
    font-size: 14px;
}

.mch-chat-container > .mch-review-screen .mch-review-submit {
    margin-top: 2px;
    background: var(--mch-accent);
    color: var(--mch-accent-text, #fff);
    border-color: var(--mch-accent);
}

.mch-chat-container > .mch-review-screen .mch-review-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.mch-chat-container > .mch-review-screen .mch-review-skip {
    background: transparent;
    color: var(--mch-muted);
}

@media (max-width: 420px) {
    .mch-chat-container > .mch-review-screen .mch-review-card {
        width: 100%;
        padding: 18px 14px;
    }

    .mch-chat-container > .mch-review-screen .mch-review-stars button {
        font-size: 29px;
    }
}


/* ==========================================================================
   Privly 6.0.2 — review alignment polish
   ========================================================================== */
.mch-chat-container > .mch-review-screen {
    flex: 1 1 auto;
    display: grid;
    place-items: center;
    align-content: center;
    justify-items: center;
    padding: 18px 18px 22px;
}

.mch-chat-container > .mch-review-screen .mch-review-card {
    width: min(100%, 324px);
    max-width: 324px;
    margin: 0 auto;
}

@media (max-width: 420px) {
    .mch-chat-container > .mch-review-screen {
        padding: 14px 14px 18px;
    }

    .mch-chat-container > .mch-review-screen .mch-review-card {
        width: 100%;
        max-width: none;
    }
}


/* ==========================================================================
   Privly 6.0.3 — compact review card polish
   ========================================================================== */
.mch-chat-container > .mch-review-screen {
    padding: 14px 16px 18px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-card {
    width: min(calc(100% - 28px), 292px) !important;
    max-width: 292px !important;
    padding: 18px 14px !important;
    gap: 10px !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 34px rgba(15,23,42,.08) !important;
}

.mch-chat-container > .mch-review-screen .mch-review-kicker {
    width: 38px !important;
    height: 38px !important;
    font-size: 18px !important;
    margin-bottom: 0 !important;
}

.mch-chat-container > .mch-review-screen .mch-review-card h3 {
    font-size: 19px !important;
    line-height: 1.12 !important;
    letter-spacing: -.03em !important;
}

.mch-chat-container > .mch-review-screen .mch-review-card p {
    font-size: 12.5px !important;
    margin: -2px 0 0 !important;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved {
    gap: 7px !important;
    margin-top: 3px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved button,
.mch-chat-container > .mch-review-screen .mch-review-submit,
.mch-chat-container > .mch-review-screen .mch-review-skip {
    min-height: 36px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-rating-label {
    font-size: 12.5px !important;
    margin-top: 2px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-stars {
    gap: 4px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-stars button {
    font-size: 26px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-comment {
    min-height: 68px !important;
    font-size: 13px !important;
}

@media (max-width: 420px) {
    .mch-chat-container > .mch-review-screen .mch-review-card {
        width: min(calc(100% - 12px), 292px) !important;
    }
}


/* ========================================================================== 
   Privly 6.0.4 — review screen fitted to the real widget panel
   This is a widget step, not a landing-page card. Keep it compact enough to
   fit inside the customer widget even when the low-rating comment field opens.
   ========================================================================== */
.mch-chat-container > .mch-review-screen {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 22px 14px !important;
    overflow-y: auto !important;
}

.mch-chat-container > .mch-review-screen .mch-review-card {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 292px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 9px !important;
    text-align: center !important;
}

.mch-chat-container > .mch-review-screen.has-comment .mch-review-card {
    gap: 7px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-kicker {
    width: 38px !important;
    height: 38px !important;
    margin: 0 auto 3px !important;
    border-radius: 999px !important;
    display: grid !important;
    place-items: center !important;
    background: var(--mch-accent) !important;
    color: var(--mch-accent-text, #fff) !important;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--mch-accent) 22%, transparent) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
}

.mch-chat-container > .mch-review-screen .mch-review-card h3 {
    margin: 0 !important;
    color: var(--mch-text) !important;
    font-size: 20px !important;
    line-height: 1.12 !important;
    letter-spacing: -.035em !important;
    font-weight: 900 !important;
}

.mch-chat-container > .mch-review-screen .mch-review-card p {
    margin: -2px 0 3px !important;
    color: var(--mch-muted) !important;
    font-size: 12.5px !important;
    line-height: 1.35 !important;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px !important;
    margin: 2px 0 2px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved button,
.mch-chat-container > .mch-review-screen .mch-review-submit,
.mch-chat-container > .mch-review-screen .mch-review-skip {
    appearance: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    min-height: 34px !important;
    border: 1px solid var(--mch-border, rgba(148,163,184,.22)) !important;
    border-radius: 12px !important;
    background: var(--mch-bg) !important;
    color: var(--mch-text) !important;
    padding: 7px 9px !important;
    font: inherit !important;
    font-size: 13px !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transform: none !important;
}

.mch-chat-container > .mch-review-screen .mch-review-resolved button.is-selected {
    background: var(--mch-accent) !important;
    color: var(--mch-accent-text, #fff) !important;
    border-color: var(--mch-accent) !important;
}

.mch-chat-container > .mch-review-screen .mch-review-rating-label {
    margin: 3px 0 -1px !important;
    color: var(--mch-muted) !important;
    font-size: 12.5px !important;
    line-height: 1.2 !important;
    font-weight: 900 !important;
}

.mch-chat-container > .mch-review-screen .mch-review-stars {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    margin: 0 0 2px !important;
}

.mch-chat-container > .mch-review-screen .mch-review-stars button {
    appearance: none !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: color-mix(in srgb, var(--mch-muted) 62%, transparent) !important;
    box-shadow: none !important;
    font-size: 26px !important;
    line-height: 1 !important;
    padding: 0 1px !important;
    cursor: pointer !important;
}

.mch-chat-container > .mch-review-screen .mch-review-stars button.is-selected {
    color: #f59e0b !important;
}

.mch-chat-container > .mch-review-screen .mch-review-comment {
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 58px !important;
    max-height: 72px !important;
    resize: vertical !important;
    border-radius: 12px !important;
    border: 1px solid var(--mch-border, rgba(148,163,184,.22)) !important;
    background: var(--mch-bg) !important;
    color: var(--mch-text) !important;
    padding: 9px 10px !important;
    font: inherit !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    outline: none !important;
}

.mch-chat-container > .mch-review-screen .mch-review-comment:focus {
    border-color: var(--mch-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mch-accent) 13%, transparent) !important;
}

.mch-chat-container > .mch-review-screen .mch-review-submit {
    min-height: 36px !important;
    margin-top: 3px !important;
    background: var(--mch-accent) !important;
    color: var(--mch-accent-text, #fff) !important;
    border-color: var(--mch-accent) !important;
}

.mch-chat-container > .mch-review-screen .mch-review-submit:disabled {
    opacity: .48 !important;
    cursor: not-allowed !important;
}

.mch-chat-container > .mch-review-screen .mch-review-skip {
    min-height: 30px !important;
    margin-top: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--mch-muted) !important;
    padding: 5px 8px !important;
    font-size: 12.5px !important;
}

@media (max-width: 420px) {
    .mch-chat-container > .mch-review-screen {
        padding: 14px 18px 12px !important;
    }
    .mch-chat-container > .mch-review-screen .mch-review-card {
        max-width: 286px !important;
    }
    .mch-chat-container > .mch-review-screen .mch-review-card h3 {
        font-size: 19px !important;
    }
    .mch-chat-container > .mch-review-screen .mch-review-stars button {
        font-size: 25px !important;
    }
}

/* v6.7.13: customer send-state feedback. Prevent double submits while the
   server confirms delivery, without showing a false sent bubble. */
.mch-is-sending .mch-attach-preview,
.mch-is-sending .mch-emoji-popover {
    pointer-events: none;
    opacity: .68;
}
.mch-is-sending .mch-primary-btn,
.mch-primary-btn:disabled,
.mch-attach-btn:disabled,
.mch-emoji-btn:disabled {
    cursor: wait;
    opacity: .72;
}

/* v6.7.16 — Customer widget composer polish.
   Keeps the existing Privly theme, but gives customers a real multi-line
   composer and moves tools/send into a second row. */
.mch-customer-menu {
    position: relative;
    flex-shrink: 0;
}
.mch-customer-menu-btn {
    background: color-mix(in srgb, var(--mch-surface) 72%, transparent);
    border: 1px solid var(--mch-border);
    cursor: pointer;
    color: var(--mch-muted);
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, color .2s, border-color .2s;
}
.mch-customer-menu-btn:hover,
.mch-customer-menu-btn[aria-expanded="true"] {
    color: var(--mch-text);
    background: var(--mch-surface);
    border-color: color-mix(in srgb, var(--mch-accent) 34%, var(--mch-border));
}
.mch-customer-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--mch-border);
    border-radius: 14px;
    background: var(--mch-bg);
    box-shadow: 0 18px 42px rgba(0,0,0,.20);
    display: none;
}
.mch-customer-menu-popover.is-open {
    display: block;
}
.mch-notify-toggle {
    width: 100%;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--mch-text);
    padding: 10px 9px;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.mch-notify-toggle:hover {
    background: color-mix(in srgb, var(--mch-accent) 9%, var(--mch-surface));
}
.mch-notify-text {
    font-size: 12.5px;
    font-weight: 700;
}
.mch-notify-state {
    font-size: 11px;
    color: var(--mch-accent);
}
.mch-notifications-off .mch-notify-icon {
    filter: grayscale(1);
    opacity: .55;
}
.mch-notifications-off .mch-notify-state {
    color: var(--mch-muted);
}

.mch-chat-composer {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 14px 16px 12px !important;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--mch-bg) 96%, var(--mch-accent) 4%),
            color-mix(in srgb, var(--mch-bg) 91%, var(--mch-accent) 9%)) !important;
    border-top: 1px solid var(--mch-border) !important;
    flex-shrink: 0;
}
.mch-composer-box {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--mch-accent) 22%, var(--mch-border));
    border-radius: 18px;
    background: var(--mch-surface);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.42);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.mch-chat-composer:focus-within .mch-composer-box {
    border-color: var(--mch-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mch-accent) 14%, transparent), inset 0 1px 0 rgba(255,255,255,.55);
    background: var(--mch-bg);
}
.mch-chat-composer .mch-composer-input {
    width: 100% !important;
    min-height: 88px;
    max-height: 160px;
    resize: vertical;
    border: 0 !important;
    outline: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 14px 15px 8px !important;
    color: var(--mch-text) !important;
    font: inherit;
    font-size: 14px;
    line-height: 1.45;
    overflow-y: auto;
    white-space: pre-wrap;
}
.mch-chat-composer .mch-composer-input::placeholder {
    color: var(--mch-muted);
}
.mch-composer-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 15px 11px;
    color: var(--mch-muted);
    font-size: 10.5px;
    line-height: 1.25;
}
.mch-composer-count {
    white-space: nowrap;
}
.mch-composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.mch-composer-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mch-chat-composer .mch-attach-btn,
.mch-chat-composer .mch-emoji-btn {
    width: 42px !important;
    height: 42px !important;
    border-radius: 999px !important;
    padding: 0 !important;
    border: 1px solid color-mix(in srgb, var(--mch-accent) 22%, var(--mch-border)) !important;
    background: var(--mch-surface) !important;
    color: var(--mch-accent) !important;
    box-shadow: none !important;
}
.mch-chat-composer .mch-send {
    width: auto !important;
    min-width: 108px;
    height: 42px !important;
    border-radius: 14px !important;
    padding: 0 16px !important;
    border: 0 !important;
    background: var(--mch-accent) !important;
    color: var(--mch-accent-text, #fff) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-weight: 800;
    box-shadow: 0 12px 26px -16px color-mix(in srgb, var(--mch-accent) 80%, transparent) !important;
}
.mch-chat-composer .mch-send:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}
.mch-feedback {
    min-height: 16px;
    font-size: 11.5px;
    color: var(--mch-muted);
    padding: 0 2px;
}
.mch-feedback.is-error {
    color: #b91c1c;
}
.mch-feedback.is-success {
    color: #047857;
}
.mch-is-sending .mch-composer-box,
.mch-is-sending .mch-composer-actions {
    opacity: .76;
}
.mch-is-sending .mch-send,
.mch-is-sending .mch-attach-btn,
.mch-is-sending .mch-emoji-btn {
    cursor: wait !important;
}
.mch-emoji-picker {
    bottom: 142px;
}

@media (max-width: 420px) {
    .mch-chat-composer {
        padding: 12px 12px 10px !important;
        gap: 9px !important;
    }
    .mch-chat-composer .mch-composer-input {
        min-height: 82px;
        font-size: 14px;
    }
    .mch-composer-meta {
        font-size: 10px;
        gap: 8px;
    }
    .mch-chat-composer .mch-send {
        min-width: 96px;
        padding: 0 13px !important;
    }
    .mch-chat-composer .mch-attach-btn,
    .mch-chat-composer .mch-emoji-btn {
        width: 40px !important;
        height: 40px !important;
    }
}


/* Privly 6.7.17 — Customer widget composer polish
   Scope: visual-only. Keeps send-state, auto-close, delivery and reassign logic unchanged. */
.mch-msg {
    min-width: 0;
}
.mch-msg-bubble {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
}
.mch-msg-customer .mch-msg-bubble,
.mch-msg-agent .mch-msg-bubble {
    width: auto;
}
.mch-chat-composer {
    padding: 13px 16px 12px !important;
}
.mch-composer-box {
    border-radius: 17px;
}
.mch-chat-composer .mch-composer-input {
    min-height: 76px !important;
    height: 76px !important;
    max-height: 76px !important;
    resize: none !important;
    overflow-y: auto !important;
    line-height: 1.42 !important;
    padding: 13px 15px 7px !important;
}
.mch-composer-meta {
    padding: 0 15px 10px !important;
}
.mch-composer-actions {
    align-items: center !important;
}
.mch-chat-composer .mch-send {
    min-width: 142px;
    white-space: nowrap;
}
.mch-chat-composer .mch-send-label {
    white-space: nowrap;
}
@media (max-width: 420px) {
    .mch-chat-composer .mch-composer-input {
        min-height: 72px !important;
        height: 72px !important;
        max-height: 72px !important;
    }
    .mch-chat-composer .mch-send {
        min-width: 128px;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}


/* Privly 6.7.18 — widget composer/review state correction
   Scope: visual/state CSS only. Keeps auto-close, delivery, reassign and license logic unchanged. */
.mch-chat-container.mch-is-locked #mchThread,
.mch-chat-container.mch-is-locked #mchTypingRow,
.mch-chat-container.mch-is-locked #mchAttachPreview,
.mch-chat-container.mch-is-locked #mchComposer,
.mch-chat-container.mch-is-locked #mchEnd {
    display: none !important;
}

.mch-chat-composer,
.mch-chat-composer *,
.mch-composer-box,
.mch-composer-actions,
.mch-composer-tools {
    box-sizing: border-box !important;
    min-width: 0 !important;
}

.mch-composer-box {
    width: 100% !important;
    max-width: 100% !important;
}

.mch-chat-composer .mch-composer-input {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    margin: 0 !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

.mch-composer-meta {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.mch-composer-meta span:first-child {
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
}

@media (max-width: 420px) {
    .mch-chat-composer {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .mch-chat-composer .mch-composer-input {
        padding-left: 13px !important;
        padding-right: 13px !important;
    }
    .mch-chat-composer .mch-send {
        min-width: 132px !important;
    }
}


/* Privly 6.8.2 — Customer widget header title/status fit.
   Prevents the business name from being crushed by the open/closed badge and header buttons. */
.mch-panel-header {
    gap: 10px;
}

.mch-header-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.mch-brand-row {
    min-width: 0;
    max-width: 100%;
}

.mch-brand {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.mch-header-status {
    flex: 0 0 auto;
    white-space: nowrap;
}

.mch-customer-menu,
.mch-close {
    flex: 0 0 auto;
}

@media (max-width: 420px) {
    .mch-panel-header {
        padding: 18px 16px 14px;
        gap: 9px;
    }

    .mch-avatar {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .mch-brand {
        font-size: 14.5px;
    }

    .mch-header-status {
        padding: 3px 6px;
        font-size: 10px;
        gap: 4px;
    }

    .mch-customer-menu-btn,
    .mch-close {
        width: 30px;
        height: 30px;
        border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .mch-brand-row {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .mch-header-status {
        max-width: 100%;
    }
}


/* Privly 6.8.3 — Hard customer widget header fix.
   Status badge is moved below the title so the business name is not crushed. */
.mch-panel-header {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto auto !important;
    align-items: center !important;
    column-gap: 10px !important;
    row-gap: 4px !important;
}

.mch-avatar {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.mch-header-text {
    grid-column: 2 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.mch-brand-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 4px !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.mch-brand {
    display: block !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.mch-header-status {
    justify-self: start !important;
    max-width: 100% !important;
    width: fit-content !important;
    white-space: nowrap !important;
    margin-top: 1px !important;
}

.mch-tag {
    margin-top: 4px !important;
    max-width: 100% !important;
}

.mch-customer-menu {
    grid-column: 3 !important;
    grid-row: 1 !important;
    align-self: center !important;
}

.mch-close {
    grid-column: 4 !important;
    grid-row: 1 !important;
    align-self: center !important;
}

.mch-customer-menu,
.mch-close {
    flex: 0 0 auto !important;
}

@media (max-width: 420px) {
    .mch-panel-header {
        grid-template-columns: auto minmax(0, 1fr) 30px 30px !important;
        padding: 18px 16px 14px !important;
        column-gap: 9px !important;
    }

    .mch-avatar {
        width: 40px !important;
        height: 40px !important;
        border-radius: 14px !important;
    }

    .mch-brand {
        font-size: 14.5px !important;
        line-height: 1.15 !important;
    }

    .mch-header-status {
        padding: 3px 6px !important;
        font-size: 10px !important;
        line-height: 1 !important;
        gap: 4px !important;
    }

    .mch-tag {
        font-size: 12px !important;
    }

    .mch-customer-menu-btn,
    .mch-close {
        width: 30px !important;
        height: 30px !important;
        border-radius: 10px !important;
    }
}

@media (max-width: 360px) {
    .mch-panel-header {
        grid-template-columns: auto minmax(0, 1fr) 28px 28px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        column-gap: 8px !important;
    }

    .mch-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    .mch-customer-menu-btn,
    .mch-close {
        width: 28px !important;
        height: 28px !important;
    }

    .mch-brand {
        font-size: 14px !important;
    }
}

