.tut-chatbot-wrap {
    --tut-bg: #050816;
    --tut-bg-soft: #0b1020;
    --tut-card: #111827;
    --tut-white: #ffffff;
    --tut-text: #d9e2f1;
    --tut-muted: #8b96aa;
    --tut-gradient: linear-gradient(135deg, var(--tut-primary) 0%, var(--tut-secondary) 100%);
    --tut-border: rgba(255, 255, 255, 0.1);
    --tut-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

.tut-chatbot-wrap,
.tut-chatbot-wrap * {
    box-sizing: border-box;
    font-family: inherit;
}

/* Launcher */
.tut-chatbot-launcher {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: var(--tut-gradient);
    color: var(--tut-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 14px 34px rgba(124, 60, 255, 0.26),
        0 8px 22px rgba(45, 212, 255, 0.14);
    z-index: 99998;
    transition: all 0.25s ease;
    overflow: visible;
    animation: tut-bubble-float 3s ease-in-out infinite;
    padding: 0;
}

.tut-chatbot-launcher::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 60, 255, 0.24), rgba(45, 212, 255, 0.16));
    filter: blur(12px);
    z-index: -1;
}

.tut-chatbot-launcher::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(45, 212, 255, 0.38);
    animation: tut-wave-pulse 1.8s ease-out infinite;
    z-index: -2;
}

.tut-chatbot-launcher img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.tut-chatbot-launcher:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 16px 38px rgba(124, 60, 255, 0.3),
        0 10px 26px rgba(45, 212, 255, 0.18);
    animation-play-state: paused;
}

@keyframes tut-wave-pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.65;
    }

    70%,
    100% {
        transform: scale(1.32);
        opacity: 0;
    }
}

@keyframes tut-bubble-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* Tooltip */
.tut-chatbot-launcher-wrap {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 62px;
    height: 62px;
    z-index: 99998;
}

.tut-tooltip-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tut-chatbot-tooltip {
    position: absolute;
    bottom: calc(100% + 16px);
    right: 0;
    max-width: 250px;
    min-width: 250px;
    width: max-content;
    background: linear-gradient(135deg, #0b1020 0%, #050816 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 12px 16px;
    color: #d9e2f1;
    font-size: 13px;
    line-height: 1.45;
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    z-index: 99999;
    word-break: break-word;
    animation: tut-slide-down 0.60s ease;
}

.tut-tooltip-toggle:checked ~ .tut-chatbot-tooltip {
    display: none;
}

.tut-chatbot-tooltip-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.tut-chatbot-tooltip-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 30px;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-top: -2px;
}
.tut-chatbot-tooltip-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.tut-chatbot-tooltip-arrow {
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 14px;
    height: 14px;
    background: inherit;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    backdrop-filter: blur(10px);
    z-index: 1;
}

/* Popup */
.tut-chatbot-popup {
    position: fixed;
    bottom: 96px;
    right: 22px;
    width: 380px;
    max-width: calc(100% - 32px);
    height: 520px;
    max-height: 76vh;
    background:
        radial-gradient(circle at top right, rgba(124, 60, 255, 0.18), transparent 34%),
        linear-gradient(180deg, #080d1d 0%, #050816 100%);
    border-radius: 24px;
    box-shadow:
        0 24px 52px rgba(0, 0, 0, 0.34),
        0 10px 26px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    z-index: 99999;
}

.tut-chatbot-popup.tut-open {
    display: flex;
    animation: tut-slide-down 0.28s ease;
}

@keyframes tut-slide-down {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.tut-chatbot-header {
    background: rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--tut-white);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--tut-border);
    flex-shrink: 0;
}

.tut-chatbot-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--tut-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    box-shadow: 0 10px 24px rgba(124, 60, 255, 0.22);
}

.tut-chatbot-header-avatar img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tut-chatbot-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tut-chatbot-header-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tut-white);
    letter-spacing: -0.01em;
}

.tut-chatbot-header-subtitle {
    font-size: 11px;
    color: var(--tut-muted);
}

.tut-chatbot-header-close {
    margin-left: auto;
    border: 1px solid var(--tut-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--tut-white);
    font-size: 20px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    line-height: 1;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tut-chatbot-header-close:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: rotate(90deg);
}

/* Messages */
.tut-chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.tut-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.tut-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tut-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.tut-chatbot-message-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 13px;
}

.tut-chatbot-message-group.tut-user-group {
    align-items: flex-end;
}

.tut-chatbot-message-meta {
    font-size: 10px;
    color: var(--tut-muted);
    margin: 0 5px;
}

.tut-chatbot-message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.tut-chatbot-message.tut-bot {
    background: rgba(255, 255, 255, 0.055);
    color: var(--tut-text);
    border: 1px solid var(--tut-border);
    align-self: flex-start;
    border-top-left-radius: 6px;
}

.tut-chatbot-message.tut-bot ul {
    margin-left: 15px;
}

.tut-chatbot-message.tut-user {
    background: var(--tut-gradient);
    color: var(--tut-white);
    align-self: flex-end;
    border-top-right-radius: 6px;
    box-shadow: 0 10px 24px rgba(124, 60, 255, 0.22);
}

/* Question Chips */
.tut-chatbot-quick-questions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.035);
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    box-shadow: none !important;
}

.tut-chatbot-quick-questions::before,
.tut-chatbot-quick-questions::after {
    display: none !important;
    content: none !important;
}

.tut-chatbot-quick-questions::-webkit-scrollbar {
    display: none;
}

.tut-chatbot-quick-question {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.075) !important;
    color: rgba(255, 255, 255, 0.86) !important;
    border-radius: 999px !important;
    padding: 8px 12px !important;
    margin: 0 !important;
    font-size: 11px !important;
    font-family: inherit;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: all 0.18s ease !important;
}

.tut-chatbot-quick-question::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tut-secondary);
    margin-right: 7px;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(45, 212, 255, 0.55);
}

.tut-chatbot-quick-question:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border-color: rgba(45, 212, 255, 0.45) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16) !important;
}

.tut-chatbot-quick-question:active {
    transform: translateY(0) scale(0.98) !important;
}

.tut-chatbot-quick-question:disabled {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Inline question list inside bot message */
.tut-inline-question-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tut-inline-question-list h4 {
    color: #fff;
    font-size: medium;
    margin-bottom: 0;
}

.tut-inline-question-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: tut-fadeInUp 0.25s ease forwards;
    border-radius:10px;
}

.tut-inline-question-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(45, 212, 255, 0.5);
    transform: translateX(4px);
}

.tut-question-bullet {
    width: 8px;
    height: 8px;
    background: var(--tut-secondary, #2dd4ff);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(45, 212, 255, 0.6);
}

.tut-question-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--tut-text, #d9e2f1);
}

@keyframes tut-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Area */
.tut-chatbot-input-bar {
    border-top: 1px solid var(--tut-border);
    padding: 12px;
    background: rgba(255, 255, 255, 0.035);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input,
.tut-chatbot-wrap input.tut-chatbot-input,
input#tutChatbotInput.tut-chatbot-input {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    min-height: auto !important;
    border-radius: 999px !important;
    border: 1px solid var(--tut-border) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--tut-white) !important;
    font-size: 13px !important;
    font-family: inherit;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    padding: 11px 14px !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    transition: all 0.2s ease !important;
}

.tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input::placeholder,
.tut-chatbot-wrap input.tut-chatbot-input::placeholder,
input#tutChatbotInput.tut-chatbot-input::placeholder {
    color: rgba(217, 226, 241, 0.5) !important;
    opacity: 1 !important;
}

.tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input::-webkit-input-placeholder,
.tut-chatbot-wrap input.tut-chatbot-input::-webkit-input-placeholder,
input#tutChatbotInput.tut-chatbot-input::-webkit-input-placeholder {
    color: rgba(217, 226, 241, 0.5) !important;
    opacity: 1 !important;
}

.tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input::-moz-placeholder,
.tut-chatbot-wrap input.tut-chatbot-input::-moz-placeholder,
input#tutChatbotInput.tut-chatbot-input::-moz-placeholder {
    color: rgba(217, 226, 241, 0.5) !important;
    opacity: 1 !important;
}

.tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input:focus,
.tut-chatbot-wrap input.tut-chatbot-input:focus,
input#tutChatbotInput.tut-chatbot-input:focus {
    border-color: rgba(45, 212, 255, 0.75) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--tut-white) !important;
    outline: none !important;
}

.tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input:disabled,
.tut-chatbot-wrap input.tut-chatbot-input:disabled,
input#tutChatbotInput.tut-chatbot-input:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
}

/* Send Button */
.tut-chatbot-send-btn {
    border-radius: 999px;
    border: none;
    padding: 11px 17px;
    background: var(--tut-gradient);
    color: var(--tut-white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 10px 24px rgba(124, 60, 255, 0.25);
    margin: 0;
    line-height: 1.4;
}

.tut-chatbot-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(45, 212, 255, 0.2);
}

.tut-chatbot-send-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Typing */
.tut-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tut-typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--tut-secondary);
    animation: tut-bounce 1.2s infinite ease-in-out;
}

.tut-typing-dot:nth-child(2) {
    animation-delay: 0.1s;
}

.tut-typing-dot:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes tut-bounce {
    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.45;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Lead Capture Form */
.tut-chatbot-lead-form {
    padding: 12px;
    border-top: 1px solid var(--tut-border);
    background: rgba(255, 255, 255, 0.025);
    flex-shrink: 0;
}

.tut-chatbot-lead-form-inner {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.045);
    border-radius: 18px;
    padding: 12px;
}

.tut-chatbot-lead-form-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--tut-white);
    margin-bottom: 3px;
}

.tut-chatbot-lead-form-text {
    font-size: 11px;
    color: var(--tut-muted);
    margin-bottom: 10px;
}

.tut-chatbot-lead-error {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 100, 100, 0.28);
    background: rgba(255, 78, 78, 0.1);
    color: #ffb8b8;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    padding: 9px 10px;
    margin-bottom: 10px;
}

.tut-chatbot-lead-input {
    width: 100% !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.11) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--tut-white) !important;
    font-size: 12px !important;
    font-family: inherit;
    padding: 10px 11px !important;
    margin: 0 0 8px 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

.tut-chatbot-lead-input::placeholder {
    color: rgba(217, 226, 241, 0.48) !important;
}

.tut-chatbot-lead-input:focus {
    border-color: rgba(45, 212, 255, 0.7) !important;
    box-shadow: 0 0 0 3px rgba(45, 212, 255, 0.09) !important;
}

.tut-chatbot-lead-actions {
    display: flex;
    gap: 8px;
}

.tut-chatbot-lead-submit,
.tut-chatbot-lead-cancel,
.tut-chatbot-lead-trigger {
    border: none !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    font-family: inherit;
    padding: 10px 14px !important;
    cursor: pointer !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    transition: all 0.18s ease !important;
}

.tut-chatbot-lead-submit,
.tut-chatbot-lead-trigger {
    background: var(--tut-gradient) !important;
    color: var(--tut-white) !important;
    box-shadow: 0 10px 24px rgba(124, 60, 255, 0.2) !important;
}

.tut-chatbot-lead-cancel {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--tut-text) !important;
}

.tut-chatbot-lead-submit:hover,
.tut-chatbot-lead-trigger:hover {
    transform: translateY(-1px) !important;
}

.tut-chatbot-lead-cancel:hover {
    background: rgba(255, 255, 255, 0.13) !important;
}

.tut-chatbot-lead-trigger-wrap {
    display: flex;
    align-items: center;
}

.tut-chatbot-lead-submit:disabled {
    opacity: 0.65 !important;
    cursor: not-allowed !important;
}

/* Tablet */
@media (max-width: 768px) {
    .tut-chatbot-popup {
        inset: 0;
        width: 100vw;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .tut-chatbot-launcher.tut-open {
        display: none;
    }

    .tut-chatbot-header {
        padding: 18px 20px;
    }

    .tut-chatbot-header-title,
    .tut-chatbot-header-subtitle {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tut-chatbot-messages {
        padding: 18px;
    }

    .tut-chatbot-quick-questions {
        padding: 12px 16px;
        gap: 8px;
        background: rgba(255, 255, 255, 0.035);
        box-shadow: none !important;
    }

    .tut-chatbot-input-bar {
        padding: 14px 16px;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
    }

    .tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input,
    .tut-chatbot-wrap input.tut-chatbot-input,
    input#tutChatbotInput.tut-chatbot-input {
        font-size: 14px !important;
        padding: 13px 16px !important;
        min-height: 46px !important;
    }

    .tut-chatbot-send-btn {
        padding: 13px 20px;
        min-height: 46px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .tut-chatbot-launcher {
        bottom: 16px;
        right: 16px;
        width: 58px;
        height: 58px;
    }

    .tut-chatbot-launcher img {
        width: 37px;
        height: 37px;
    }

    .tut-chatbot-header {
        padding: 16px;
        gap: 10px;
    }

    .tut-chatbot-header-title {
        font-size: 14px;
    }

    .tut-chatbot-header-subtitle {
        font-size: 10px;
    }

    .tut-chatbot-messages {
        padding: 14px;
    }

    .tut-chatbot-message {
        max-width: 92%;
        font-size: 13px;
    }

    .tut-chatbot-quick-questions {
        padding: 10px 12px;
        gap: 7px;
        background: rgba(255, 255, 255, 0.035);
        box-shadow: none !important;
    }

    .tut-chatbot-quick-questions::before,
    .tut-chatbot-quick-questions::after {
        display: none !important;
        content: none !important;
    }

    .tut-chatbot-quick-question {
        font-size: 10px !important;
        padding: 8px 10px !important;
        margin: 0 !important;
    }

    .tut-chatbot-input-bar {
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        gap: 7px;
    }

    .tut-chatbot-wrap .tut-chatbot-popup .tut-chatbot-input,
    .tut-chatbot-wrap input.tut-chatbot-input,
    input#tutChatbotInput.tut-chatbot-input {
        font-size: 13px !important;
        padding: 11px 14px !important;
    }

    .tut-chatbot-send-btn {
        padding: 11px 15px;
        font-size: 10px;
    }
}

/* Extra Small */
@media (max-width: 380px) {
    .tut-chatbot-header-avatar {
        width: 36px;
        height: 36px;
        border-radius: 12px;
    }

    .tut-chatbot-header-avatar img {
        width: 24px;
        height: 24px;
    }

    .tut-chatbot-header-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .tut-chatbot-send-btn {
        padding: 11px 12px;
        font-size: 9px;
        letter-spacing: 0.04em;
    }
}