/* ShahTechX — floating AI Business Assistant (public + vendor portal) */
.ai-ass-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10750;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    color: #fff;
    font-size: 1.45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.45), 0 4px 12px rgba(15, 23, 42, 0.2);
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 42%, #a855f7 100%);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}
.ai-ass-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.5), 0 8px 20px rgba(15, 23, 42, 0.22);
}
.ai-ass-fab:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.55);
    outline-offset: 3px;
}
.ai-ass-fab.ai-ass-hidden {
    display: none;
}

.ai-ass-panel {
    position: fixed;
    right: 18px;
    bottom: 86px;
    z-index: 10750;
    width: min(400px, calc(100vw - 36px));
    height: min(560px, calc(100vh - 130px));
    border-radius: 18px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
    font-family: 'Poppins', system-ui, sans-serif;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 46%);
}

.ai-ass-panel.ai-ass-open {
    display: flex;
}

.ai-ass-panel-hd {
    padding: 14px 16px;
    background: linear-gradient(135deg, #312e81 0%, #4f46e5 38%, #7c3aed 100%);
    color: #fff;
    flex-shrink: 0;
}
.ai-ass-panel-hd-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ai-ass-panel-title {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.2;
}
.ai-ass-panel-tag {
    font-size: 0.72rem;
    opacity: 0.92;
    margin: 4px 0 0;
    font-weight: 400;
}

.ai-ass-close {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.ai-ass-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ai-ass-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 6px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
.ai-ass-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    background: linear-gradient(180deg, #eef2ff, #fafafa);
    color: #3730a3;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.ai-ass-chip:hover {
    border-color: #818cf8;
    transform: translateY(-1px);
}

.ai-ass-msgs {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    gap: 10px;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.ai-ass-msg {
    max-width: 92%;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.42;
    white-space: pre-wrap;
    word-break: break-word;
}
.ai-ass-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-ass-msg-bot {
    align-self: flex-start;
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}
.ai-ass-msg-bot a {
    color: #4338ca;
    font-weight: 600;
    word-break: break-all;
}

.ai-ass-foot {
    border-top: 1px solid #e2e8f0;
    padding: 10px 12px;
    background: #fafafa;
    flex-shrink: 0;
}
.ai-ass-lead-toggle {
    font-size: 0.74rem;
    color: #64748b;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 6px;
    padding: 0;
}
.ai-ass-lead-panel {
    display: none;
    gap: 6px;
    margin-bottom: 8px;
}
.ai-ass-lead-panel.ai-ass-show {
    display: flex;
    flex-direction: column;
}
.ai-ass-lead-panel input {
    font-size: 0.85rem;
}

.ai-ass-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
.ai-ass-input {
    flex: 1;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 10px 12px;
    font-size: 0.88rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    font-family: inherit;
}
.ai-ass-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.ai-ass-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.12s, filter 0.12s;
}
.ai-ass-send:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.ai-ass-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Vendor portal (dark) */
body.vendor-portal-body .ai-ass-panel {
    background: linear-gradient(180deg, #1a2438 0%, #141c2f 50%);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(148, 163, 184, 0.12);
}
body.vendor-portal-body .ai-ass-chips {
    background: #141c2f;
    border-bottom-color: #2a3754;
}
body.vendor-portal-body .ai-ass-chip {
    border-color: #3b4d74;
    background: linear-gradient(180deg, #1e293b, #162032);
    color: #c7d2fe;
}
body.vendor-portal-body .ai-ass-msgs {
    background: #141c2f;
}
body.vendor-portal-body .ai-ass-msg-bot {
    background: #1a2438;
    color: #e8edf7;
    border-color: #2a3754;
}
body.vendor-portal-body .ai-ass-msg-bot a {
    color: #38bdf8;
}
body.vendor-portal-body .ai-ass-foot {
    background: #111827;
    border-top-color: #2a3754;
}
body.vendor-portal-body .ai-ass-input {
    background: #1a2438;
    border-color: #334155;
    color: #e8edf7;
}

@media (max-width: 480px) {
    .ai-ass-panel {
        right: 12px;
        bottom: 78px;
        width: calc(100vw - 24px);
        height: min(72vh, 540px);
    }
    .ai-ass-fab {
        right: 12px;
        bottom: 12px;
    }
}
