/* Chat soporte web */
.kurama-chat-fab {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    z-index: 460;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 56px;
    height: 56px;
    padding: 0 1rem 0 0.9rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #e50914, #b20710);
    box-shadow: 0 8px 28px rgba(229, 9, 20, 0.45);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.kurama-chat-fab i {
    font-size: 1.35rem;
}

.kurama-chat-fab.is-open {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.kurama-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #22c55e;
    color: #fff;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kurama-chat-badge.hidden {
    display: none !important;
}

.kurama-chat-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 470;
    width: min(380px, calc(100vw - 1.5rem));
    max-height: min(560px, calc(100vh - 2rem));
    display: flex;
    flex-direction: column;
    background: #14141c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.kurama-chat-panel.hidden {
    display: none !important;
}

.kurama-chat-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    background: rgba(229, 9, 20, 0.12);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kurama-chat-head strong {
    display: block;
    font-size: 0.95rem;
}

.kurama-chat-head small {
    color: var(--text-muted, #a1a1aa);
    font-size: 0.78rem;
}

.kurama-chat-close {
    background: none;
    border: none;
    color: var(--text-muted, #a1a1aa);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.kurama-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem 0;
    max-height: 88px;
    overflow-y: auto;
    scrollbar-width: none;
}

.kurama-chat-suggestions::-webkit-scrollbar {
    display: none;
}

.kurama-chat-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #d4d4d8);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.kurama-chat-chip:hover {
    border-color: rgba(229, 9, 20, 0.5);
    background: rgba(229, 9, 20, 0.1);
    color: #fff;
}

.kurama-chat-messages {
    flex: 1;
    min-height: 180px;
    max-height: 320px;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.kurama-chat-empty {
    margin: auto;
    text-align: center;
    color: var(--text-muted, #a1a1aa);
    font-size: 0.85rem;
    line-height: 1.45;
}

.kurama-chat-bubble {
    max-width: 88%;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
}

.kurama-chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.kurama-chat-bubble time {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.68rem;
    opacity: 0.65;
}

.kurama-chat-bubble--user {
    align-self: flex-end;
    background: rgba(229, 9, 20, 0.2);
    border: 1px solid rgba(229, 9, 20, 0.35);
    border-bottom-right-radius: 4px;
}

.kurama-chat-bubble--admin {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 4px;
}

.kurama-chat-form {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.kurama-chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    padding: 0.55rem 0.9rem;
    font-family: inherit;
    font-size: 0.88rem;
}

.kurama-chat-form input:focus {
    outline: none;
    border-color: rgba(229, 9, 20, 0.55);
}

.kurama-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--accent, #e50914);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

.kurama-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 520px) {
    .kurama-chat-panel {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        bottom: 0.5rem;
    }

    .kurama-chat-fab span {
        display: none;
    }

    .kurama-chat-fab {
        padding: 0;
        width: 56px;
        justify-content: center;
    }
}
