/* MisLinksPR Chatbot */
.mlpr-chat,
.mlpr-chat * {
    box-sizing: border-box;
}

.mlpr-chat {
    --mlpr-purple: #7642f4;
    --mlpr-purple-dark: #5f2fd9;
    --mlpr-lime: #c7ff4b;
    --mlpr-black: #070707;
    --mlpr-white: #ffffff;
    --mlpr-body-bg: #f6f4ff;
    --mlpr-muted: #5c5c5c;
    --mlpr-border: #070707;
    --mlpr-send-bg: #c7ff4b;
    --mlpr-send-text: #070707;
    --mlpr-send-hover-bg: #070707;
    --mlpr-send-hover-text: #c7ff4b;
    --mlpr-font-heading: "Bricolage Grotesque", "DM Sans", Arial, sans-serif;
    --mlpr-font-body: "DM Sans", Arial, sans-serif;
    font-family: var(--mlpr-font-body);
    font-weight: 500;
    color: var(--mlpr-black);
}

/* Keep theme/Divi fonts from leaking into the widget */
.mlpr-chat button,
.mlpr-chat input {
    font-family: var(--mlpr-font-body);
    letter-spacing: normal;
    text-transform: none;
}

.mlpr-chat a {
    color: var(--mlpr-purple);
}

.mlpr-floating {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
}

/* Launcher */
.mlpr-launcher {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 1px solid var(--mlpr-black);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mlpr-purple);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 1px 1px 0 var(--mlpr-black);
    transition: transform .2s ease, box-shadow .2s ease;
}

.mlpr-launcher:hover,
.mlpr-launcher:focus-visible {
    transform: translate(-2px, -2px);
    box-shadow: 1px 1px 0 var(--mlpr-black);
    outline: none;
}

.mlpr-launcher:focus-visible {
    outline: 1px solid var(--mlpr-lime);
    outline-offset: 3px;
}

.mlpr-launcher-icon,
.mlpr-launcher-icon img,
.mlpr-launcher-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.mlpr-launcher-icon svg {
    fill: var(--mlpr-white);
    padding: 14px;
}

/* Panel */
.mlpr-panel {
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 120px));
    background: var(--mlpr-body-bg);
    border: 1px solid var(--mlpr-black);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 6px 0 var(--mlpr-black);
}

.mlpr-floating .mlpr-panel {
    position: absolute;
    right: 0;
    bottom: 82px;
}

.mlpr-panel[hidden] {
    display: none !important;
}

/* Header */
.mlpr-header {
    min-height: 76px;
    padding: 12px 14px 12px 16px;
    background: var(--mlpr-black);
    color: var(--mlpr-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 3px solid var(--mlpr-lime);
}

.mlpr-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    min-width: 0;
}

.mlpr-brand-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    border: 1px solid var(--mlpr-lime);
    display: block;
}

.mlpr-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 50px;
}

.mlpr-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.mlpr-title-text {
    font-family: var(--mlpr-font-heading);
    font-size: 22px;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--mlpr-white);
}

.mlpr-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--mlpr-white);
    opacity: .92;
}

.mlpr-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mlpr-lime);
}

.mlpr-close {
    width: 40px;
    height: 40px;
    flex: none;
    border: 1px solid var(--mlpr-lime);
    border-radius: 50%;
    background: var(--mlpr-lime);
    color: var(--mlpr-black);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 2px;
}

.mlpr-close:hover,
.mlpr-close:focus-visible {
    background: var(--mlpr-white);
    color: var(--mlpr-black);
    border-color: var(--mlpr-white);
    outline: none;
}

.mlpr-close:focus-visible {
    outline: 2px solid var(--mlpr-lime);
    outline-offset: 2px;
}

/* Messages */
.mlpr-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    background: var(--mlpr-body-bg);
}

.mlpr-message {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.mlpr-intro-message {
    max-width: 100%;
}

.mlpr-bot-message {
    background: var(--mlpr-white);
    border: 1px solid var(--mlpr-black);
    border-bottom-left-radius: 4px;
    color: var(--mlpr-black);
}

.mlpr-user-message {
    margin-left: auto;
    background: var(--mlpr-purple);
    color: var(--mlpr-white);
    border: 1px solid var(--mlpr-black);
    border-bottom-right-radius: 4px;
}

.mlpr-message a {
    color: var(--mlpr-purple);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--mlpr-purple);
    text-underline-offset: 3px;
}

.mlpr-message a:hover,
.mlpr-message a:focus-visible {
    color: var(--mlpr-black);
    background: var(--mlpr-lime);
    text-decoration-thickness: 2px;
    outline: none;
}

.mlpr-user-message a {
    color: var(--mlpr-white);
    text-decoration-color: var(--mlpr-lime);
}

/* Quick replies */
.mlpr-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 8px;
}

.mlpr-quick {
    border: 1px solid var(--mlpr-black);
    border-radius: 999px;
    background: var(--mlpr-white);
    color: var(--mlpr-black);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.mlpr-quick:hover,
.mlpr-quick:focus-visible {
    background: var(--mlpr-lime);
    transform: translateY(-1px);
    outline: none;
}

.mlpr-quick:focus-visible {
    outline: 2px solid var(--mlpr-purple);
    outline-offset: 2px;
}

/* Input row */
.mlpr-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
    border-top: 3px solid var(--mlpr-black);
    background: var(--mlpr-white);
}

.mlpr-input {
    width: 100%;
    min-width: 0;
    height: 50px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid var(--mlpr-black);
    border-radius: 14px;
    color: var(--mlpr-black);
    background: var(--mlpr-white);
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
}

.mlpr-input::placeholder {
    color: var(--mlpr-muted);
}

.mlpr-input:focus {
    border-color: var(--mlpr-purple);
    outline: 1px solid rgba(118, 66, 244, .25);
    outline-offset: 0;
}

.mlpr-send {
    height: 50px;
    min-width: 92px;
    padding: 0 18px;
    border: 1px solid var(--mlpr-black);
    border-radius: 14px;
    background: var(--mlpr-send-bg);
    color: var(--mlpr-send-text);
    font-family: var(--mlpr-font-heading) !important;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.mlpr-send:hover,
.mlpr-send:focus-visible {
    background: var(--mlpr-send-hover-bg);
    color: var(--mlpr-send-hover-text);
    outline: 2px solid var(--mlpr-purple);
    outline-offset: 2px;
}

/* Inline (shortcode) mode */
.mlpr-inline {
    max-width: 720px;
    margin: 0 auto;
}

.mlpr-inline .mlpr-panel {
    width: 100%;
    height: 520px;
}

/* Typing indicator */
.mlpr-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.mlpr-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mlpr-purple);
    opacity: .7;
    animation: mlprBounce 1s infinite ease-in-out;
}

.mlpr-typing span:nth-child(2) { animation-delay: .12s; }
.mlpr-typing span:nth-child(3) { animation-delay: .24s; }

@keyframes mlprBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
    .mlpr-typing span { animation: none; }
    .mlpr-launcher, .mlpr-quick { transition: none; }
}

@media (max-width: 600px) {
    .mlpr-floating {
        right: 16px;
        bottom: 16px;
    }

    .mlpr-floating .mlpr-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 92px;
        width: auto;
        height: min(620px, calc(100vh - 116px));
    }

    .mlpr-logo {
        max-width: 150px;
    }
}

/* Visually hidden label (works even if the theme lacks .screen-reader-text) */
.mlpr-chat .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
