/* MuCOHAS — floating WhatsApp + library chatbot (bottom-right) */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.mucohas-support-fab-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.mucohas-support-fab-stack > * {
    pointer-events: auto;
}

.mucohas-support-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 22px rgba(13, 13, 13, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
}

.mucohas-support-fab:hover,
.mucohas-support-fab:focus {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 28px rgba(13, 13, 13, 0.32);
    color: #fff;
    outline: none;
}

.mucohas-support-fab--whatsapp {
    background: #25d366;
}

.mucohas-support-fab--whatsapp svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.mucohas-support-fab--chat {
    background: linear-gradient(135deg, var(--mucohas-blue, #1454a8), var(--mucohas-blue-light, #1e6fd4));
}

.mucohas-support-fab--chat svg {
    width: 26px;
    height: 26px;
}

.mucohas-support-fab-label {
    position: absolute;
    right: calc(100% + 10px);
    white-space: nowrap;
    background: rgba(13, 13, 13, 0.88);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.mucohas-support-fab-wrap {
    position: relative;
}

.mucohas-support-fab-wrap:hover .mucohas-support-fab-label,
.mucohas-support-fab-wrap:focus-within .mucohas-support-fab-label {
    opacity: 1;
    transform: translateX(0);
}

.mucohas-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 150px;
    width: min(360px, calc(100vw - 36px));
    max-height: min(520px, calc(100vh - 120px));
    z-index: 99989;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(13, 13, 13, 0.22);
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.mucohas-chat-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mucohas-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--mucohas-blue-dark, #0d3d7a), var(--mucohas-blue, #1454a8));
    color: #fff;
}

.mucohas-chat-panel__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.mucohas-chat-panel__subtitle {
    margin: 2px 0 0;
    font-size: 0.72rem;
    opacity: 0.9;
}

.mucohas-chat-panel__close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mucohas-chat-panel__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.mucohas-chat-panel__messages {
    flex: 1;
    min-height: 200px;
    max-height: 320px;
    overflow-y: auto;
    padding: 14px 14px 8px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mucohas-chat-bubble {
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.84rem;
    line-height: 1.45;
    word-break: break-word;
}

.mucohas-chat-bubble--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-bottom-left-radius: 4px;
}

.mucohas-chat-bubble--user {
    align-self: flex-end;
    background: var(--mucohas-blue, #1454a8);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.mucohas-chat-bubble a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.mucohas-chat-bubble--bot a {
    color: var(--mucohas-blue, #1454a8);
}

.mucohas-chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    background: #f8fafc;
}

.mucohas-chat-quick button {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--mucohas-blue-dark, #0d3d7a);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.mucohas-chat-quick button:hover {
    background: rgba(20, 84, 168, 0.08);
    border-color: var(--mucohas-blue, #1454a8);
}

.mucohas-chat-panel__form {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.mucohas-chat-panel__form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.85rem;
}

.mucohas-chat-panel__form input:focus {
    outline: none;
    border-color: var(--mucohas-blue, #1454a8);
    box-shadow: 0 0 0 3px rgba(20, 84, 168, 0.12);
}

.mucohas-chat-panel__form button[type="submit"] {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 10px;
    background: var(--mucohas-green, #22a047);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mucohas-chat-panel__form button[type="submit"]:hover {
    background: var(--mucohas-green-dark, #1a8038);
}

.mucohas-chat-typing {
    font-size: 0.75rem;
    color: #64748b;
    padding: 0 14px 8px;
    background: #f8fafc;
    display: none;
}

.mucohas-chat-typing.is-visible {
    display: block;
}

@media (max-width: 480px) {
    .mucohas-support-fab-stack {
        right: 14px;
        bottom: 14px;
    }

    .mucohas-chat-panel {
        right: 14px;
        bottom: 140px;
        width: calc(100vw - 28px);
    }

    .mucohas-support-fab-label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mucohas-chat-panel,
    .mucohas-support-fab {
        transition: none;
    }
}

/* =============================================================================
   v2 — a shorter assistant: it never taller than the screen, smaller type, tidy chips and field
   (strong selectors: pages that load larger default type made it overflow the window)
   ============================================================================= */
html body .mucohas-chat-panel {
    width: min(332px, calc(100vw - 28px)); bottom: 140px; right: 16px;
    max-height: min(400px, calc(100vh - 160px)); border-radius: 18px;
    box-shadow: 0 22px 50px -18px rgba(11, 47, 102, .55), 0 6px 16px -8px rgba(15, 23, 42, .25);
    transform-origin: 100% 100%; transition: opacity .22s ease, transform .26s cubic-bezier(.2, .9, .3, 1.15), visibility .22s;
}
html body .mucohas-chat-panel__header { padding: 10px 12px 10px 14px; }
html body .mucohas-chat-panel__title { font-size: .86rem !important; line-height: 1.25 !important; }
html body .mucohas-chat-panel__subtitle { font-size: .68rem !important; margin-top: 1px; }
html body .mucohas-chat-panel__close { width: 28px; height: 28px; border-radius: 9px; }
html body .mucohas-chat-panel__messages { min-height: 96px; max-height: min(210px, calc(100vh - 380px)); padding: 10px 12px 4px; gap: 8px; }
html body .mucohas-chat-bubble { font-size: .79rem !important; line-height: 1.42 !important; padding: 8px 10px; max-width: 92%; border-radius: 12px; }
html body .mucohas-chat-quick { gap: 5px; padding: 2px 12px 8px; }
html body .mucohas-chat-quick button { font-size: .7rem !important; padding: 3px 9px; line-height: 1.5; }
html body .mucohas-chat-typing { font-size: .7rem !important; padding: 0 12px 6px; }
html body .mucohas-chat-panel__form { padding: 8px 10px; gap: 6px; align-items: center; }
html body .mucohas-chat-panel__form input { flex: 1 1 auto !important; width: auto !important; min-width: 0; height: 36px; padding: 0 11px !important; font-size: .8rem !important; border-radius: 11px; }
html body .mucohas-chat-panel__form button[type="submit"] { width: 36px; height: 36px; border-radius: 11px; }
html body .mucohas-chat-panel__form button[type="submit"] svg { width: 18px; height: 18px; }
@media (max-width: 480px) { html body .mucohas-chat-panel { right: 12px; bottom: 132px; width: calc(100vw - 24px); } }
@media (max-height: 560px) { html body .mucohas-chat-panel { bottom: 12px; right: 84px; max-height: calc(100vh - 24px); } html body .mucohas-chat-panel__messages { max-height: calc(100vh - 230px); } }
html body .mucohas-chat-panel__form label.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
