.mp-chat-root {
    --mp-chat-primary: #7f1d1d;
    --mp-chat-primary-deep: #5c1010;
    --mp-chat-rose: #9f2d2d;
    --mp-chat-cream: #f7f3ef;
    --mp-chat-ink: #2c2424;
    --mp-chat-muted: #6d6161;
    font-family: Poppins, "Segoe UI", sans-serif;
    color: var(--mp-chat-ink);
    letter-spacing: 0;
}

.mp-chat-root,
.mp-chat-root * {
    box-sizing: border-box;
}

.mp-chat-launcher,
.mp-chat-teaser,
.mp-chat-panel {
    position: fixed;
    z-index: 12050;
    right: 22px;
}

.mp-chat-launcher {
    bottom: 50px;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    overflow: visible;
}

.mp-chat-launcher img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.mp-chat-launcher-dot {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: mp-chat-pulse 1.8s ease-out infinite;
}

.mp-chat-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--mp-chat-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(127, 29, 29, 0.35);
}

@keyframes mp-chat-pulse {
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.mp-chat-teaser {
    display: none;
    bottom: 122px;
    width: 248px;
    padding: 16px 18px 14px;
    border: 0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 40px rgba(44, 24, 24, 0.18);
    text-align: left;
    cursor: pointer;
}

.mp-chat-teaser::after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(44, 24, 24, 0.04);
}

.mp-chat-teaser-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #8a7c7c;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.mp-chat-teaser p {
    margin: 0 0 12px;
    padding-right: 16px;
    text-align: left;
    font-size: 15px;
    line-height: 1.45;
    color: #3d3333;
}

.mp-chat-teaser strong {
    color: var(--mp-chat-primary);
}

.mp-chat-teaser-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--mp-chat-rose), var(--mp-chat-primary-deep));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.mp-chat-panel {
    bottom: 50px;
    display: none;
    flex-direction: column;
    width: min(386px, calc(100vw - 32px));
    height: min(640px, calc(100vh - 48px));
    border-radius: 18px;
    overflow: hidden;
    background: var(--mp-chat-cream);
    box-shadow: 0 22px 60px rgba(44, 24, 24, 0.28);
}

.mp-chat-panel.is-open {
    display: flex;
}

.mp-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 12px 12px 12px 14px;
    background: linear-gradient(120deg, #9a3030 0%, #7f1d1d 48%, #5c1010 100%);
    color: #fff;
}

.mp-chat-header-photo {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    overflow: visible;
    background: transparent;
}

.mp-chat-header-photo img,
.mp-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mp-chat-header-photo img {
    border-radius: 50%;
}

.mp-chat-header-photo span {
    position: absolute;
    right: -2px;
    bottom: -2px;
    z-index: 1;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
}

.mp-chat-header-copy {
    min-width: 0;
    flex: 1;
}

.mp-chat-header-copy strong,
.mp-chat-header-copy small {
    display: block;
}

.mp-chat-header-copy strong {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.mp-chat-header-copy small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 12px;
}

.mp-chat-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.mp-chat-close:hover,
.mp-chat-launcher:hover,
.mp-chat-teaser:hover .mp-chat-teaser-cta {
    filter: brightness(1.05);
}

.mp-chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    scroll-behavior: smooth;
}

.mp-chat-day {
    margin: 0 0 14px;
    text-align: center;
    color: var(--mp-chat-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mp-chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 0 12px;
}

.mp-chat-msg.is-user {
    justify-content: flex-end;
}

.mp-chat-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(92, 16, 16, 0.15);
}

.mp-chat-bubble {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 14px 14px 14px 4px;
    background: #fff;
    color: #3a3030;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-line;
    box-shadow: 0 4px 14px rgba(92, 16, 16, 0.06);
}

.mp-chat-msg.is-user .mp-chat-bubble {
    border-radius: 14px 14px 4px 14px;
    background: linear-gradient(135deg, #9a3030, #7f1d1d);
    color: #fff;
}

.mp-chat-time {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 0.02em;
    opacity: 0.62;
    text-align: right;
}

.mp-chat-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: min(100%, 250px);
    margin: 4px 0 12px auto;
}

.mp-chat-option {
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--mp-chat-primary);
    border-radius: 12px;
    background: #fff;
    color: var(--mp-chat-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 3px 0 rgba(127, 29, 29, 0.12);
}

.mp-chat-option:hover,
.mp-chat-option:focus-visible {
    background: var(--mp-chat-primary);
    color: #fff;
    outline: none;
}

.mp-chat-option:active {
    transform: translateY(2px);
    box-shadow: none;
}

.mp-chat-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-width: 52px;
    min-height: 18px;
}

.mp-chat-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7f1d1d;
    animation: mp-chat-dot 1s infinite ease-in-out;
}

.mp-chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.mp-chat-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes mp-chat-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
    40% { transform: translateY(-3px); opacity: 1; }
}

.mp-chat-footer {
    padding: 10px 12px 12px;
    background: #fff;
    border-top: 1px solid rgba(127, 29, 29, 0.08);
}

.mp-chat-note {
    margin: 0 0 8px;
    text-align: left;
    color: var(--mp-chat-muted);
    font-size: 11px;
    line-height: 1.4;
}

.mp-chat-compose {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mp-chat-compose input,
.mp-chat-compose select {
    height: 44px;
    border: 1px solid #eadfdf;
    border-radius: 12px;
    background: #fbf8f6;
    color: var(--mp-chat-ink);
    font-family: inherit;
    font-size: 14px;
}

.mp-chat-compose input {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
}

.mp-chat-compose select {
    width: 96px;
    flex: 0 0 96px;
    padding: 0 28px 0 12px;
    line-height: 42px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fbf8f6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%237f1d1d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px 8px;
}

.mp-chat-compose input:focus,
.mp-chat-compose select:focus {
    outline: 2px solid rgba(127, 29, 29, 0.25);
    border-color: var(--mp-chat-primary);
}

.mp-chat-send {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #9a3030, #5c1010);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mp-chat-send:disabled {
    opacity: 0.55;
    cursor: default;
}

.mp-chat-send svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mp-form-error {
    margin: 8px 0 0;
    color: #9f1239;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.mp-chat-error {
    margin: 8px 0 0;
    text-align: left;
    color: #9f1239;
    font-size: 12px;
    line-height: 1.4;
}

.mp-chat-done {
    text-align: center;
}

.mp-chat-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 8px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #128c7e;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.mp-chat-link:hover {
    color: #fff;
    text-decoration: none;
}

.mp-chat-restart {
    margin-top: 8px;
    border: 0;
    background: transparent;
    color: var(--mp-chat-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.mp-chat-root.is-teaser-visible .mp-chat-teaser {
    display: block;
}

.mp-chat-root.is-hidden-launcher .mp-chat-launcher,
.mp-chat-root.is-panel-open .mp-chat-teaser {
    display: none;
}

@media (min-width: 992px) {
    .mp-chat-launcher,
    .mp-chat-teaser,
    .mp-chat-panel {
        right: calc(22% + -300px);
    }
}

@media (min-width: 1600px) {
    .mp-chat-launcher,
    .mp-chat-teaser,
    .mp-chat-panel {
        right: calc(20% + 16px);
    }
}

@media (max-width: 991.98px) {
    .mp-chat-launcher,
    .mp-chat-teaser,
    .mp-chat-panel {
        right: 14px;
    }

    .mp-chat-launcher {
        bottom: 96px;
        width: 60px;
        height: 60px;
    }

    .mp-chat-teaser {
        bottom: 170px;
        width: min(248px, calc(100vw - 28px));
    }

    .mp-chat-panel.is-open {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
    }

    .mp-chat-options {
        width: min(100%, 280px);
    }
}
