.sp-chat-toggle {
        position: fixed; bottom: 24px; right: 24px; z-index: 9999;
        width: 56px; height: 56px; border-radius: 50%; border: none;
        cursor: pointer; box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        background: var(--color-primary, #C4623B); color: var(--on-accent, #fff); font-size: 22px;
    }
    .sp-chat-panel {
        position: fixed; bottom: 92px; right: 24px; z-index: 9999;
        width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: 70vh;
        background: #fff; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.18);
        display: none; flex-direction: column; overflow: hidden; border: 1px solid #EDE9E1;
    }
    .sp-chat-header {
        padding: 16px 18px; background: var(--color-secondary, #2A2320); color: #fff;
        display: flex; justify-content: space-between; align-items: center;
    }
    .sp-chat-header-title { font-size: 14px; font-weight: 600; margin: 0; }
    .sp-chat-header-subtitle { font-size: 11px; opacity: 0.7; margin: 2px 0 0; }
    .sp-chat-header-actions { display: flex; align-items: center; gap: 10px; }
    .sp-chat-human {
        background: rgba(255,255,255,0.14); border: none; color: #fff;
        font-size: 11px; font-weight: 600; cursor: pointer; padding: 5px 10px; border-radius: 20px;
    }
    .sp-chat-close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
    .sp-chat-messages {
        flex: 1; overflow-y: auto; padding: 16px; background: #FAFAF8;
        font-size: 14px; line-height: 1.5;
    }
    .sp-chat-form {
        display: flex; gap: 8px; padding: 12px; border-top: 1px solid #EDE9E1; background: #fff;
    }
    .sp-chat-input {
        flex: 1; border: 1px solid #EDE9E1; border-radius: 8px;
        padding: 10px 12px; font-size: 14px; outline: none;
    }
    .sp-chat-submit {
        background: var(--color-primary, #C4623B); color: var(--on-accent, #fff); border: none;
        border-radius: 8px; padding: 0 16px; font-weight: 600; cursor: pointer;
    }

.sp-chat-msg {
    margin-bottom: 12px;
    max-width: 88%;
    padding: 10px 12px;
    border-radius: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}
.sp-chat-msg--user {
    margin-left: auto;
    background: var(--color-secondary, #2A2320);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.sp-chat-msg--assistant {
    background: #fff;
    border: 1px solid #EDE9E1;
    color: #2A2320;
    border-bottom-left-radius: 4px;
}
.sp-chat-panel.is-open { display: flex; }


/* Booking confirmation card (book-by-chat) */
.sp-chat-booking { background: #fff; border: 1px solid #EDE9E1; border-radius: 14px; padding: 14px; margin-bottom: 12px; max-width: 94%; box-shadow: 0 10px 26px -16px rgba(0,0,0,.25); }
.sp-chat-booking__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.sp-chat-booking__badge { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink, #C4623B); background: color-mix(in srgb, var(--accent, #C4623B) 12%, #ffffff); padding: 3px 9px; border-radius: 100px; }
.sp-chat-booking__badge.is-hold { color: #B0703B; background: rgba(196,130,42,.13); }
.sp-chat-booking__ref { font-size: 11.5px; color: #a5a5a5; font-family: ui-monospace, monospace; }
.sp-chat-booking__room { font-size: 15px; font-weight: 700; color: var(--color-secondary, #2A2320); margin-bottom: 3px; }
.sp-chat-booking__meta { font-size: 12.5px; color: #6b6b6b; margin-bottom: 10px; }
.sp-chat-booking__total { font-size: 18px; font-weight: 800; color: var(--color-secondary, #2A2320); margin-bottom: 12px; }
.sp-chat-booking__cta { display: block; text-align: center; background: var(--color-primary, #C4623B); color: var(--on-accent, #fff); font-weight: 600; font-size: 14px; padding: 11px 14px; border-radius: 10px; text-decoration: none; transition: filter .15s ease; }
.sp-chat-booking__cta:hover { filter: brightness(1.07); }

/* A person is involved: staff messages, status lines, the connecting indicator, the contact step */
.sp-chat-msg--staff {
    background: color-mix(in srgb, var(--color-primary, #C4623B) 10%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--color-primary, #C4623B) 28%, #ffffff);
    color: #2A2320;
    border-bottom-left-radius: 4px;
}
.sp-chat-msg__name { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 700; color: #6b6b6b; }
.sp-chat-system {
    margin: 0 auto 12px; width: fit-content; max-width: 92%;
    padding: 3px 12px; border-radius: 12px; background: #EDE9E1; color: #6b6b6b;
    font-size: 12px; text-align: center;
}
.sp-chat-wait {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 12px;
    border: 1px dashed #D9A45C; border-radius: 10px; background: #fff; color: #9C5F16; font-size: 13px;
}
.sp-chat-wait__spin {
    flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid #E8D3AE; border-top-color: #9C5F16; animation: sp-chat-spin 1s linear infinite;
}
@keyframes sp-chat-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sp-chat-wait__spin { animation: none; } }
.sp-chat-contact {
    display: grid; gap: 8px; margin-bottom: 12px; padding: 12px;
    border: 1px solid #EDE9E1; border-radius: 12px; background: #fff; font-size: 13px;
}
.sp-chat-contact__hint { color: #6b6b6b; font-size: 12px; }
.sp-chat-contact__row { display: flex; justify-content: flex-end; gap: 8px; }
.sp-chat-contact__skip, .sp-chat-contact__go, .sp-chat-new {
    border-radius: 8px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sp-chat-contact__skip { border: 1px solid #D9D2C6; background: #fff; color: #2A2320; }
.sp-chat-contact__go, .sp-chat-new { border: none; background: var(--color-primary, #C4623B); color: var(--on-accent, #fff); }
.sp-chat-new { display: block; margin: 4px auto 12px; }
.sp-chat-form.is-closed { opacity: .5; }
.sp-chat-toggle[data-unread]::after {
    content: attr(data-unread); position: absolute; top: -2px; right: -2px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; box-sizing: border-box;
    background: #2D7A4F; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}