/* Web Developer Kashi — Kashi Guide (dark theme) */
.wdk-chat-root {
    --wdk-chat-primary: #9b58ff;
    --wdk-chat-primary-dark: #7a20ff;
    --wdk-chat-primary-mid: #8837ff;
    --wdk-chat-bg: #1a1625;
    --wdk-chat-bg-elevated: #231f30;
    --wdk-chat-bg-input: #2a2438;
    --wdk-chat-border: rgba(255, 255, 255, 0.08);
    --wdk-chat-border-light: rgba(255, 255, 255, 0.12);
    --wdk-chat-text: #eceaf2;
    --wdk-chat-text-muted: #a09aad;
    --wdk-chat-bot: #2d2840;
    --wdk-chat-user: linear-gradient(135deg, #8837ff 0%, #7a20ff 100%);
    --wdk-chat-wa: #25d366;
    font-family: inherit;
    z-index: 1055;
}

@media (max-width: 576px) {
    body.wdk-chat-open {
        overflow: hidden;
    }
}

.wdk-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--wdk-chat-primary) 0%, var(--wdk-chat-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 8px 28px rgba(139, 61, 255, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    z-index: 1058;
}

.wdk-chat-toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 12px 32px rgba(139, 61, 255, 0.55);
}

body.wdk-chat-open .wdk-chat-toggle {
    opacity: 0;
    pointer-events: none;
}

.wdk-chat-toggle svg {
    width: 26px;
    height: 26px;
}

.wdk-chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: min(400px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 48px));
    background: var(--wdk-chat-bg);
    border: 1px solid var(--wdk-chat-border-light);
    border-radius: 20px 20px 16px 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(100% + 40px));
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, visibility 0.3s;
    z-index: 1057;
}

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

.wdk-chat-header {
    background: linear-gradient(135deg, #3d2066 0%, #2a1548 50%, #1f1038 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--wdk-chat-border);
}

.wdk-chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.wdk-chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.wdk-chat-header-text h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: -0.02em;
}

.wdk-chat-header-text p {
    font-size: 11px;
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.65);
}

.wdk-chat-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.wdk-chat-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

.wdk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--wdk-chat-bg);
    min-height: 0;
}

.wdk-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.wdk-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.wdk-chat-msg {
    max-width: 88%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.55;
    word-wrap: break-word;
}

.wdk-chat-msg a {
    color: var(--wdk-chat-primary);
    text-decoration: underline;
    font-weight: 500;
}

.wdk-chat-msg--bot {
    align-self: flex-start;
    background: var(--wdk-chat-bot);
    color: var(--wdk-chat-text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--wdk-chat-border);
}

.wdk-chat-msg--bot strong {
    color: #fff;
}

.wdk-chat-msg--user {
    align-self: flex-end;
    background: var(--wdk-chat-user);
    color: #fff;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.wdk-chat-msg--typing {
    font-style: italic;
    color: var(--wdk-chat-text-muted);
    background: var(--wdk-chat-bot);
    border: 1px solid var(--wdk-chat-border);
}

.wdk-chat-inline-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--wdk-chat-border);
}

.wdk-chat-chip {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 14px;
    border: 1px solid var(--wdk-chat-border-light);
    background: var(--wdk-chat-bg-elevated);
    color: var(--wdk-chat-text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    line-height: 1.3;
}

.wdk-chat-chip:hover {
    background: #352f48;
    border-color: rgba(139, 61, 255, 0.45);
    transform: translateY(-1px);
}

.wdk-chat-chip--wa {
    border-color: rgba(37, 211, 102, 0.35);
    color: #4ade80;
}

.wdk-chat-chip--wa:hover {
    background: rgba(37, 211, 102, 0.12);
    border-color: var(--wdk-chat-wa);
}

.wdk-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--wdk-chat-border);
    background: var(--wdk-chat-bg-elevated);
    flex-shrink: 0;
}

.wdk-chat-input {
    flex: 1;
    border: 1px solid var(--wdk-chat-border-light);
    border-radius: 24px;
    padding: 12px 18px;
    font-size: 16px;
    outline: none;
    background: var(--wdk-chat-bg-input);
    color: var(--wdk-chat-text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wdk-chat-input::placeholder {
    color: var(--wdk-chat-text-muted);
}

.wdk-chat-input:focus {
    border-color: rgba(139, 61, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(139, 61, 255, 0.2);
}

.wdk-chat-send {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--wdk-chat-primary), var(--wdk-chat-primary-dark));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(139, 61, 255, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.wdk-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 18px rgba(139, 61, 255, 0.45);
}

.wdk-chat-send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Mobile: full-screen dark chat */
@media (max-width: 576px) {
    .wdk-chat-panel {
        inset: 0;
        bottom: auto;
        right: auto;
        width: 100%;
        max-height: none;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
        border: none;
        background: var(--wdk-chat-bg);
        transform: translateY(100%);
    }

    .wdk-chat-panel.is-open {
        transform: translateY(0);
    }

    .wdk-chat-toggle {
        right: 20px;
        bottom: 88px;
    }

    .wdk-chat-header {
        padding-top: max(14px, env(safe-area-inset-top));
    }

    .wdk-chat-form {
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }
}
