.chatbot-trigger {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-purple));
    color: white;
    border: none;
    border-radius: 100px;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.4);
    transition: var(--transition);
}

.chatbot-trigger:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 36px rgba(59, 130, 246, 0.55);
}

.trigger-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    position: relative;
    flex-shrink: 0;
}

.trigger-pulse::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    animation: wf-trigger-pulse 1.8s ease-out infinite;
}

@keyframes wf-trigger-pulse {
    0% { transform: scale(0.7); opacity: 0.9; }
    100% { transform: scale(1.8); opacity: 0; }
}

.chatbot-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 1000;
    width: 380px;
    height: 530px;
    background: rgba(8, 8, 14, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--c-border-light);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.chatbot-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.02);
}

.chatbot-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--c-accent), var(--c-purple));
    display: grid;
    place-items: center;
    font-weight: 800;
    color: white;
}

.chatbot-agent-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.chatbot-agent-status {
    color: var(--c-green);
    font-size: 0.8rem;
    font-weight: 500;
}

.chatbot-close {
    background: none;
    border: none;
    color: var(--c-text-2);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 6px;
    transition: var(--transition);
}

.chatbot-close:hover {
    color: white;
    transform: rotate(90deg);
}

.chatbot-consent {
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid var(--c-border);
}

.chatbot-consent.hidden {
    display: none;
}

.consent-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--c-text);
}

.consent-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.84rem;
    color: var(--c-text-2);
    line-height: 1.55;
}

.consent-block strong {
    color: var(--c-text);
    font-size: 0.86rem;
}

.consent-block.warn {
    border-color: rgba(251, 191, 36, 0.28);
    background: rgba(251, 191, 36, 0.08);
}

.consent-block.warn strong {
    color: #fbbf24;
}

.consent-block a,
.consent-checkbox-row label a,
.chat-bubble a {
    color: #60a5fa;
    text-decoration: none;
}

.consent-block a:hover,
.consent-checkbox-row label a:hover,
.chat-bubble a:hover {
    text-decoration: underline;
}

.consent-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 4px;
}

.consent-checkbox-row input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    accent-color: var(--c-accent);
    flex-shrink: 0;
}

.consent-checkbox-row label {
    font-size: 0.82rem;
    color: var(--c-text-2);
    line-height: 1.5;
    cursor: pointer;
}

.consent-accept-btn {
    margin-top: 4px;
    padding: 12px 14px;
    border: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: var(--transition);
    opacity: 0.45;
}

.consent-accept-btn.active {
    background: linear-gradient(135deg, var(--c-accent), var(--c-purple));
    opacity: 1;
}

.consent-accept-btn.active:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(59, 130, 246, 0.3);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 3px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--c-border-light);
    border-radius: 2px;
}

.chat-msg {
    display: flex;
}

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

.chat-msg.bot {
    justify-content: flex-start;
}

.chat-bubble {
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}

.chat-msg.user .chat-bubble {
    background: linear-gradient(135deg, var(--c-accent), var(--c-purple));
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-msg.bot .chat-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--c-border);
    color: var(--c-text);
    border-bottom-left-radius: 6px;
}

.chat-bubble code {
    font-family: var(--mono);
    font-size: 0.82em;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
}

.chat-bubble ul {
    margin: 8px 0 0 18px;
}

.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    width: fit-content;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--c-border);
    border-radius: 16px;
    border-bottom-left-radius: 6px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-text-2);
    animation: wf-typing 1.1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes wf-typing {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-2px); }
}

.chatbot-input-area {
    border-top: 1px solid var(--c-border);
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
}

.chatbot-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chatbot-text-input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    color: var(--c-text);
    padding: 12px 14px;
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
}

.chatbot-text-input::placeholder {
    color: var(--c-text-3);
}

.chatbot-text-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.chatbot-mic-btn,
.chatbot-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid var(--c-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--c-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.chatbot-send-btn {
    background: linear-gradient(135deg, var(--c-accent), var(--c-purple));
    border-color: transparent;
    color: white;
}

.chatbot-mic-btn:hover,
.chatbot-send-btn:hover {
    transform: translateY(-1px);
}

.chatbot-mic-btn.recording {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: 0 0 0 6px rgba(248, 113, 113, 0.08);
}

.chatbot-mic-btn:disabled,
.chatbot-send-btn:disabled,
.chatbot-text-input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.rec-hint {
    display: none;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #fca5a5;
}

.rec-hint.active {
    display: block;
}

@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100vw - 32px);
        right: 16px;
        bottom: 80px;
        height: 72vh;
    }

    .chatbot-trigger {
        right: 16px;
        bottom: 16px;
        padding: 13px 18px;
        font-size: 0.9rem;
    }
}
