.noryx-chat-launcher {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: calc(24px + env(safe-area-inset-right));
    z-index: 1500;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(0, 212, 255, 0.45);
    background: linear-gradient(135deg, #7b2cbf 0%, #240046 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(123, 44, 191, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.noryx-chat-launcher:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.25);
}

.noryx-chat-launcher.hidden { display: none; }

/* Orbe IA dentro del launcher */
.noryx-orb-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: none;
    background: transparent;
}

.noryx-chat-launcher.noryx-orb-on {
    background: radial-gradient(circle at 50% 42%, #0d0a18 0%, #05050a 78%);
    border-color: rgba(212, 160, 23, 0.35);
}

.noryx-chat-launcher.noryx-orb-on .noryx-orb-canvas { display: block; }
.noryx-chat-launcher.noryx-orb-on .noryx-orb-fallback { display: none; }

.noryx-chat-panel {
    position: fixed;
    bottom: calc(94px + env(safe-area-inset-bottom));
    right: calc(24px + env(safe-area-inset-right));
    z-index: 1500;
    width: min(380px, calc(100vw - 32px));
    height: min(520px, calc(100dvh - 120px));
    background: rgba(26, 11, 46, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.noryx-chat-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.noryx-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
}

.noryx-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.noryx-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #7b2cbf);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.noryx-chat-header h3 {
    font-size: 0.92rem;
    margin: 0;
    color: #fff;
    font-weight: 700;
}

.noryx-chat-header p {
    font-size: 0.72rem;
    margin: 2px 0 0;
    color: #00d4ff;
}

.noryx-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.noryx-chat-voice {
    background: none;
    border: none;
    color: #00d4ff;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 6px 8px;
    border-radius: 8px;
}

.noryx-chat-voice:hover,
.noryx-chat-voice.muted {
    color: #ccc;
    background: rgba(255, 255, 255, 0.08);
}

.noryx-chat-voice.muted:hover {
    color: #fff;
}

.noryx-chat-close {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 8px;
}

.noryx-chat-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.noryx-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.noryx-chat-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.84rem;
    line-height: 1.5;
    word-break: break-word;
}

.noryx-chat-msg.bot {
    align-self: flex-start;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: #eee;
    border-bottom-left-radius: 4px;
}

.noryx-chat-msg.user {
    align-self: flex-end;
    background: rgba(123, 44, 191, 0.35);
    border: 1px solid rgba(123, 44, 191, 0.5);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.noryx-chat-msg a {
    color: #00d4ff;
    text-decoration: underline;
}

.noryx-chat-cta {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.45);
    color: #00d4ff !important;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s;
}

.noryx-chat-cta:hover {
    background: rgba(0, 212, 255, 0.28);
}

.noryx-chat-source {
    display: block;
    margin-top: 8px;
    color: #888;
    font-size: 0.72rem;
    line-height: 1.4;
}

.noryx-chat-listen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.45);
    background: rgba(0, 212, 255, 0.12);
    color: #00d4ff;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.noryx-chat-listen:disabled {
    opacity: 0.55;
}

.noryx-chat-listen-failed {
    border-color: rgba(255, 120, 120, 0.55);
    color: #ffb4b4;
}

.noryx-chat-typing {
    align-self: flex-start;
    padding: 8px 14px;
    font-size: 0.78rem;
    color: #888;
    font-style: italic;
}

.noryx-chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 10px;
}

.noryx-chat-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.25);
    color: #00d4ff;
    font-size: 0.72rem;
    padding: 6px 10px;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.noryx-chat-chip:hover {
    background: rgba(0, 212, 255, 0.15);
}

.noryx-chat-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.noryx-chat-input-row input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
}

.noryx-chat-input-row input:focus {
    border-color: rgba(0, 212, 255, 0.5);
}

.noryx-chat-input-row input::placeholder {
    color: #777;
}

.noryx-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: var(--accent, #00d4ff);
    color: #000;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.noryx-chat-send:hover { opacity: 0.9; }

@media (max-width: 480px) {
    .noryx-chat-panel {
        bottom: 0;
        right: 0;
        width: 100%;
        height: min(85vh, 100%);
        height: min(85dvh, 100%);
        border-radius: 20px 20px 0 0;
    }

    .noryx-chat-input-row {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .noryx-chat-launcher {
        bottom: calc(16px + env(safe-area-inset-bottom));
        right: calc(16px + env(safe-area-inset-right));
    }
}
