/* ZEBRONET AI Support Widget */
.zeb-ai {
    --zeb-ai-primary: #086ad8;
    --zeb-ai-primary-dark: #0455b1;
    --zeb-ai-ink: #172033;
    --zeb-ai-muted: #6b7280;
    --zeb-ai-border: #e7ebf0;
    --zeb-ai-bg: #ffffff;
    --zeb-ai-soft: #f5f8fc;
    position: relative;
    z-index: 10050;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.zeb-ai__launcher {
    position: fixed;
    right: 20px;
    bottom: 104px;
    min-height: 56px;
    padding: 8px 17px 8px 9px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    background: linear-gradient(135deg, var(--zeb-ai-primary), #003b91);
    box-shadow: 0 16px 38px rgba(8, 106, 216, .28);
    cursor: pointer;
    z-index: 10051;
    transition: transform .2s ease, box-shadow .2s ease;
}

.zeb-ai__launcher:hover,
.zeb-ai__launcher:focus-visible {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 20px 46px rgba(8, 106, 216, .36);
}

.zeb-ai__launcher-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    font-size: 18px;
}

.zeb-ai__launcher-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
}

.zeb-ai__launcher-glow {
    position: absolute;
    inset: -5px;
    border: 2px solid rgba(8, 106, 216, .22);
    border-radius: inherit;
    pointer-events: none;
    animation: zebAiPulse 2.4s ease-out infinite;
}

@keyframes zebAiPulse {
    0% { opacity: .75; transform: scale(.96); }
    70%, 100% { opacity: 0; transform: scale(1.12); }
}

.zeb-ai__panel {
    position: fixed;
    right: 20px;
    bottom: 174px;
    width: min(390px, calc(100vw - 32px));
    height: min(610px, calc(100vh - 205px));
    min-height: 450px;
    border: 1px solid rgba(8, 106, 216, .12);
    border-radius: 22px;
    overflow: hidden;
    background: var(--zeb-ai-bg);
    box-shadow: 0 28px 80px rgba(16, 31, 55, .24);
    z-index: 10052;
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    animation: zebAiOpen .18s ease-out;
}

.zeb-ai__panel[hidden] {
    display: none !important;
}

@keyframes zebAiOpen {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.zeb-ai__header {
    flex: 0 0 auto;
    min-height: 76px;
    padding: 14px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background:
        radial-gradient(circle at 90% 20%, rgba(255,255,255,.18), transparent 150px),
        linear-gradient(135deg, #086ad8, #003b91);
}

.zeb-ai__brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.zeb-ai__brand-icon {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.17);
    font-size: 19px;
}

.zeb-ai__title {
    font-size: 16px;
    line-height: 1.25;
    font-weight: 800;
}

.zeb-ai__status {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,.88);
}

.zeb-ai__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #59e391;
    box-shadow: 0 0 0 3px rgba(89, 227, 145, .16);
}

.zeb-ai__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.zeb-ai__close:hover { background: rgba(255,255,255,.2); }

.zeb-ai__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 15px 12px;
    background:
        radial-gradient(circle at top right, rgba(8,106,216,.05), transparent 220px),
        #f8fafc;
    scroll-behavior: smooth;
}

.zeb-ai__message {
    display: flex;
    margin: 0 0 12px;
}

.zeb-ai__message--assistant { justify-content: flex-start; }
.zeb-ai__message--user { justify-content: flex-end; }

.zeb-ai__bubble {
    max-width: 84%;
    padding: 11px 13px;
    border-radius: 17px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.zeb-ai__message--assistant .zeb-ai__bubble {
    color: var(--zeb-ai-ink);
    background: #fff;
    border: 1px solid var(--zeb-ai-border);
    border-bottom-left-radius: 6px;
    box-shadow: 0 5px 16px rgba(24, 39, 75, .05);
}

.zeb-ai__message--user .zeb-ai__bubble {
    color: #fff;
    background: linear-gradient(135deg, var(--zeb-ai-primary), var(--zeb-ai-primary-dark));
    border-bottom-right-radius: 6px;
    box-shadow: 0 6px 18px rgba(8, 106, 216, .18);
}

.zeb-ai__typing {
    flex: 0 0 auto;
    padding: 7px 17px 3px;
    background: #f8fafc;
}

.zeb-ai__typing span {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 3px;
    border-radius: 50%;
    background: #9aa5b5;
    animation: zebAiTyping 1s infinite ease-in-out;
}

.zeb-ai__typing span:nth-child(2) { animation-delay: .14s; }
.zeb-ai__typing span:nth-child(3) { animation-delay: .28s; }

@keyframes zebAiTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: .45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.zeb-ai__error {
    flex: 0 0 auto;
    margin: 8px 12px 0;
    padding: 8px 10px;
    border-radius: 10px;
    color: #a51d26;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    font-size: 12px;
}

.zeb-ai__composer {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 11px 11px 9px;
    border-top: 1px solid var(--zeb-ai-border);
    background: #fff;
}

.zeb-ai__input {
    flex: 1 1 auto;
    width: 100%;
    min-height: 44px;
    max-height: 110px;
    padding: 11px 12px;
    border: 1px solid #dde3ea;
    border-radius: 14px;
    resize: none;
    outline: none;
    color: var(--zeb-ai-ink);
    background: #f9fafb;
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.zeb-ai__input:focus {
    border-color: rgba(8, 106, 216, .52);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(8, 106, 216, .08);
    color: var(--zeb-ai-ink);
}

.zeb-ai__send {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--zeb-ai-primary);
    cursor: pointer;
}

.zeb-ai__send:hover { background: var(--zeb-ai-primary-dark); color: #fff; }
.zeb-ai__send:disabled { opacity: .55; cursor: not-allowed; }

.zeb-ai__footer-note {
    flex: 0 0 auto;
    padding: 0 11px 9px;
    color: #8a94a3;
    background: #fff;
    text-align: center;
    font-size: 10px;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .zeb-ai__launcher {
        right: 14px;
        bottom: 92px;
        min-height: 52px;
        padding-right: 14px;
    }

    .zeb-ai__launcher-icon {
        width: 36px;
        height: 36px;
    }

    .zeb-ai__panel {
        right: 10px;
        bottom: 154px;
        width: calc(100vw - 20px);
        height: min(620px, calc(100dvh - 174px));
        min-height: 390px;
        border-radius: 19px;
    }
}

@media (max-width: 430px) {
    .zeb-ai__launcher-label { display: none; }
    .zeb-ai__launcher { padding: 8px; border-radius: 50%; }
    .zeb-ai__launcher-icon { width: 38px; height: 38px; }
    .zeb-ai__panel { bottom: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    .zeb-ai__launcher-glow,
    .zeb-ai__typing span,
    .zeb-ai__panel {
        animation: none !important;
    }
}

/* STEP 5 - Support workflow actions */
.zeb-ai__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
    max-width: 88%;
}

.zeb-ai__message--assistant .zeb-ai__actions {
    align-self: flex-start;
}

.zeb-ai__action {
    appearance: none;
    border: 0;
    border-radius: 999px;
    background: #0b73dc;
    color: #fff !important;
    padding: 9px 14px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 5px 16px rgba(0, 91, 190, 0.18);
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.zeb-ai__action:hover,
.zeb-ai__action:focus {
    color: #fff !important;
    text-decoration: none !important;
    transform: translateY(-1px);
    box-shadow: 0 7px 20px rgba(0, 91, 190, 0.25);
}

.zeb-ai__action:focus-visible {
    outline: 3px solid rgba(20, 138, 255, 0.28);
    outline-offset: 2px;
}

.zeb-ai__send:disabled,
.zeb-ai__input:disabled {
    opacity: .65;
    cursor: wait;
}
