:root {
    --cw-orange: #f97316;
    --cw-gold: #f59e0b;
    --cw-gold2: #fbbf24;
    --cw-navy: #0f1117;
    --cw-navy2: #16191f;
    --cw-card: #1a1d24;
    --cw-txt: #f1f5f9;
    --cw-sub: #94a3b8;
    --cw-mute: #475569;
    --cw-border: rgba(255, 255, 255, .08);
    --cw-glass: rgba(255, 255, 255, .04);
    --cw-green: #22c55e;
}

/* ── Float Button ── */
.chatbot-float-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--cw-orange), var(--cw-gold));
    color: white;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(249, 115, 22, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s;
    position: fixed;
}

.chatbot-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 36px rgba(249, 115, 22, .6);
}

.chatbot-float-btn:active {
    transform: scale(.95);
}

.chatbot-btn-icon {
    font-size: 26px;
}

.chatbot-btn-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ── Widget Container ── */
.chatbot-widget-container {
    position: fixed;
    bottom: 100px;
    right: 28px;
    z-index: 999999;
    animation: cwSlideUp .3s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes cwSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chatbot-widget {
    width: 400px;
    height: 500px;
    background: var(--cw-navy);
    border: 1px solid rgba(249, 115, 22, .18);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.chatbot-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(15, 17, 23, .95);
    border-bottom: 1px solid rgba(249, 115, 22, .15);
    flex-shrink: 0;
}

.chatbot-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chatbot-widget-logo-ring {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--cw-orange), var(--cw-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
}

.chatbot-logo-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cw-green);
    border: 2px solid var(--cw-navy);
    animation: cwBlink 1.8s ease-in-out infinite;
}

@keyframes cwBlink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .3
    }
}

.chatbot-widget-name {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 15px;
    background: linear-gradient(90deg, var(--cw-orange), var(--cw-gold2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chatbot-widget-status {
    font-size: 10px;
    color: var(--cw-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chatbot-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cw-green);
    animation: cwBlink 1.5s infinite;
}

.chatbot-model-badge {
    font-size: 9px;
    padding: 3px 8px;
    background: rgba(249, 115, 22, .08);
    border: 1px solid rgba(249, 115, 22, .18);
    border-radius: 6px;
    color: var(--cw-orange);
    font-family: 'JetBrains Mono', monospace;
}

.chatbot-widget-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--cw-border);
    background: var(--cw-glass);
    color: var(--cw-sub);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.chatbot-widget-close:hover {
    background: rgba(249, 115, 22, .12);
    border-color: rgba(249, 115, 22, .35);
    color: var(--cw-orange);
}

/* ── Quick Bar ── */
.chatbot-quick-bar {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(249, 115, 22, .10);
}

.chatbot-quick-bar::-webkit-scrollbar {
    display: none;
}

.chatbot-quick-chip {
    padding: 5px 10px;
    border-radius: 18px;
    white-space: nowrap;
    border: 1px solid var(--cw-border);
    background: var(--cw-glass);
    font-size: 10px;
    font-weight: 700;
    color: var(--cw-sub);
    cursor: pointer;
    transition: all .2s;
    font-family: 'Syne', sans-serif;
}

.chatbot-quick-chip:hover {
    background: rgba(249, 115, 22, .1);
    border-color: rgba(249, 115, 22, .35);
    color: var(--cw-orange);
}

.chatbot-quick-chip.active {
    background: rgba(249, 115, 22, .18);
    border-color: var(--cw-orange);
    color: var(--cw-gold2);
}

/* ── Chat Wrap ── */
.chatbot-chat-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--cw-mute) transparent;
}

.chatbot-chat-wrap::-webkit-scrollbar {
    width: 3px;
}

.chatbot-chat-wrap::-webkit-scrollbar-thumb {
    background: var(--cw-mute);
    border-radius: 3px;
}

/* ── Welcome ── */
.chatbot-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 8px;
    animation: cwFadeUp .4s ease;
}

@keyframes cwFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.chatbot-welcome-icon {
    font-size: 44px;
    margin-bottom: 10px;
}

.chatbot-welcome h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--cw-txt);
    margin-bottom: 6px;
    text-align: center;
}

.chatbot-welcome p {
    font-size: 11px;
    color: var(--cw-sub);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 12px;
}

.chatbot-welcome-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    width: 100%;
}

.chatbot-welcome-card {
    background: var(--cw-card);
    border: 1px solid var(--cw-border);
    border-radius: 10px;
    padding: 9px;
    cursor: pointer;
    transition: all .2s;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.chatbot-welcome-card:hover {
    background: rgba(249, 115, 22, .07);
    border-color: rgba(249, 115, 22, .3);
    transform: translateY(-1px);
}

.cwc-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.cwc-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--cw-txt);
    margin-bottom: 2px;
}

.cwc-sub {
    font-size: 9px;
    color: var(--cw-sub);
    line-height: 1.4;
}

/* ── Messages ── */
.chatbot-msg {
    display: flex;
    gap: 7px;
    animation: cwMsgIn .3s ease;
}

@keyframes cwMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.chatbot-msg.user {
    flex-direction: row-reverse;
}

.chatbot-msg-av {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}

.chatbot-msg-av.bot {
    background: linear-gradient(135deg, var(--cw-orange), var(--cw-gold));
    box-shadow: 0 3px 10px rgba(249, 115, 22, .3);
}

.chatbot-msg-av.user {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
}

.chatbot-msg-body {
    max-width: 78%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chatbot-msg.user .chatbot-msg-body {
    align-items: flex-end;
}

.chatbot-msg-bubble {
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.55;
    border: 1px solid var(--cw-border);
}

.chatbot-msg-bubble.bot {
    background: var(--cw-card);
    border-color: rgba(249, 115, 22, .12);
    border-radius: 3px 8px 8px 8px;
}

.chatbot-msg-bubble.user {
    background: linear-gradient(135deg, #2563eb, #4338ca);
    border-color: transparent;
    color: white;
    border-radius: 8px 3px 8px 8px;
}

/* Bot bubble typography */
.chatbot-msg-bubble.bot strong {
    color: var(--cw-gold2);
    font-weight: 700;
}
.chatbot-msg-bubble.bot p {
    color: #f0ede6;
}

.chatbot-msg-bubble.bot em {
    color: var(--cw-orange);
    font-style: italic;
}

.chatbot-msg-bubble.bot h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--cw-orange);
    margin: 8px 0 4px;
}

.chatbot-msg-bubble.bot code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: rgba(249, 115, 22, .12);
    border: 1px solid rgba(249, 115, 22, .22);
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--cw-orange);
}

.chatbot-msg-bubble.bot ul,
.chatbot-msg-bubble.bot ol {
    padding-left: 16px;
    margin: 4px 0;
}

.chatbot-msg-bubble.bot li {
    margin-bottom: 3px;
    font-size: 11px;
}

.chatbot-msg-bubble.bot table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin: 6px 0;
    border-radius: 6px;
    overflow: hidden;
}

.chatbot-msg-bubble.bot th {
    background: rgba(249, 115, 22, .18);
    padding: 5px 8px;
    font-weight: 700;
    color: var(--cw-gold2);
    text-align: left;
}

.chatbot-msg-bubble.bot td {
    padding: 4px 8px;
    border-top: 1px solid rgba(255, 255, 255, .05);
    color: var(--cw-txt);
}

.chatbot-msg-bubble.bot tr:nth-child(even) td {
    background: rgba(249, 115, 22, .04);
}

/* Typing dots */
.chatbot-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 12px;
}

.chatbot-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cw-orange);
    animation: cwDot .8s ease-in-out infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: .15s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: .30s;
}

@keyframes cwDot {

    0%,
    60%,
    100% {
        transform: scale(.8);
        opacity: .4
    }

    30% {
        transform: scale(1.2);
        opacity: 1
    }
}

.chatbot-msg-time {
    font-size: 9px;
    color: var(--cw-mute);
    padding: 0 2px;
}

/* Suggestions */
.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    padding-left: 35px;
}

.chatbot-sug-chip {
    padding: 4px 9px;
    border-radius: 14px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid rgba(249, 115, 22, .2);
    background: rgba(249, 115, 22, .06);
    color: var(--cw-sub);
    cursor: pointer;
    transition: all .18s;
}

.chatbot-sug-chip:hover {
    background: rgba(249, 115, 22, .16);
    border-color: var(--cw-orange);
    color: var(--cw-gold2);
}

/* ── Input Bar ── */
.chatbot-input-bar {
    padding: 10px 12px 12px;
    background: rgba(15, 17, 23, .9);
    border-top: 1px solid rgba(249, 115, 22, .12);
    flex-shrink: 0;
}

.chatbot-input-row {
    display: flex;
    gap: 7px;
    align-items: flex-end;
    background: var(--cw-card);
    border: 1.5px solid rgba(249, 115, 22, .2);
    border-radius: 10px;
    padding: 8px 10px;
    transition: border .2s;
}

.chatbot-input-row:focus-within {
    border-color: var(--cw-orange);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, .12);
}

.chatbot-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'Syne', sans-serif;
    font-size: 12px;
    color: var(--cw-txt);
    resize: none;
    max-height: 80px;
    min-height: 20px;
    line-height: 1.5;
}

.chatbot-input::placeholder {
    color: var(--cw-mute);
}

.chatbot-send-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--cw-orange), var(--cw-gold));
    color: white;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(249, 115, 22, .35);
}

.chatbot-send-btn:hover {
    transform: scale(1.08);
}

.chatbot-send-btn:disabled {
    opacity: .4;
    transform: none;
    cursor: not-allowed;
}

.chatbot-input-hint {
    font-size: 9px;
    color: var(--cw-mute);
    margin-top: 5px;
    text-align: center;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .chatbot-widget {
        width: calc(100vw - 20px);
        height: 75vh;
    }

    .chatbot-widget-container {
        right: 10px;
        bottom: 90px;
        left: 10px;
    }

    .chatbot-float-btn {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-welcome-cards {
        grid-template-columns: 1fr;
    }

    .chatbot-model-badge {
        display: none;
    }
}