.tour-chat-trigger {
    white-space: nowrap;
}

.tour-chat-widget[hidden] {
    display: none !important;
}

.tour-chat-widget {
    position: fixed;
    inset: 0;
    z-index: 2200;
    pointer-events: none;
}

.tour-chat-widget.is-open {
    pointer-events: auto;
}

.tour-chat-widget__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.22);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tour-chat-widget.is-open .tour-chat-widget__backdrop {
    opacity: 1;
}

.tour-chat-widget__panel {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: min(408px, calc(100vw - 32px));
    max-height: min(72vh, 720px);
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tour-chat-widget.is-open .tour-chat-widget__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tour-chat-widget__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.tour-chat-widget__eyebrow {
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2563eb;
}

.tour-chat-widget__title {
    margin: 6px 0 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: #111827;
}

.tour-chat-widget__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.tour-chat-widget__messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px;
    min-height: 220px;
    max-height: 420px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.tour-chat-widget__empty {
    margin: auto 0;
    padding: 16px;
    border-radius: 18px;
    background: #eef2ff;
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}

.tour-chat-widget__bubble {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.tour-chat-widget__bubble--assistant {
    align-self: flex-start;
    background: #e2e8f0;
    color: #0f172a;
    border-top-left-radius: 8px;
}

.tour-chat-widget__bubble--user {
    align-self: flex-end;
    background: #111827;
    color: #ffffff;
    border-top-right-radius: 8px;
}

.tour-chat-widget__bubble--typing {
    opacity: 0.7;
    font-style: italic;
}

.tour-chat-widget__status {
    margin: 0;
    padding: 0 20px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #b45309;
}

.tour-chat-widget__composer {
    display: grid;
    gap: 10px;
    padding: 16px 20px 20px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.tour-chat-widget__composerlabel {
    display: none;
}

.tour-chat-widget__input {
    width: 100%;
    min-height: 92px;
    resize: vertical;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #111827;
    background: #ffffff;
}

.tour-chat-widget__input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.tour-chat-widget__send {
    justify-self: end;
    min-width: 132px;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    cursor: pointer;
}

.tour-chat-widget__send:disabled {
    opacity: 0.6;
    cursor: wait;
}

.tour__paybox .tour-chat-trigger,
.tour__paybox .tour__paymore--chat {
    margin-top: 10px;
}

@media (max-width: 991.98px) {
    .tour-chat-widget__panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: min(84vh, 760px);
        border-radius: 24px 24px 0 0;
        transform: translateY(22px);
    }

    .tour-chat-widget__messages {
        max-height: none;
        min-height: 260px;
    }
}
