/* OnTarget AI support chat — floating widget (storefront uses Bootstrap, not Tailwind) */
@import url('theme-color.css');
.ox-chat-root {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 10050;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.45;
}

.ox-chat-root button,
.ox-chat-root textarea,
.ox-chat-root input {
    font-family: inherit;
    box-sizing: border-box;
}

body.ox-chat-mobile-open {
    overflow: hidden;
    touch-action: none;
}

@media (max-width: 768px) {
    .ox-chat-root {
        right: 8px;
        bottom: 80px; /* above mobile bottom nav */
    }

    /* Full-screen chat when open on mobile */
    .ox-chat-root--panel-open {
        inset: 0;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        z-index: 10060;
    }

    .ox-chat-root--panel-open .ox-chat-panel {
        position: fixed;
        inset: 0;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        font-size: 12px;
        line-height: 1.4;
        animation: none;
    }

    .ox-chat-root--panel-open .ox-chat-panel__footer {
        padding: 8px 12px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    }

    .ox-chat-root--panel-open .ox-chat-panel__body {
        flex: 1;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }

    .ox-chat-root--panel-open .ox-chat-panel__body::-webkit-scrollbar {
        width: 4px;
    }

    .ox-chat-root--panel-open .ox-chat-panel__body::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }

    .ox-chat-welcome-teaser {
        bottom: 68px;
        width: min(260px, calc(100vw - 24px));
        padding: 10px 12px;
        gap: 10px;
    }

    .ox-chat-welcome-teaser__title {
        font-size: 0.75rem;
    }

    .ox-chat-welcome-teaser__text {
        font-size: 0.65rem;
        margin-bottom: 8px;
    }

    .ox-chat-welcome-teaser__cta {
        padding: 5px 10px;
        font-size: 0.68rem;
    }

    .ox-chat-welcome-teaser__avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .ox-chat-root--panel-open .ox-chat-panel__header {
        padding: 8px 10px;
        padding-top: calc(8px + env(safe-area-inset-top, 0));
    }

    .ox-chat-root--panel-open .ox-chat-panel__title {
        font-size: 13px;
    }

    .ox-chat-root--panel-open .ox-chat-panel__header-icon img {
        width: 28px;
        height: 28px;
    }

    .ox-chat-root--panel-open .ox-chat-panel__icon-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .ox-chat-root--panel-open .ox-chat-panel__body {
        padding: 10px 12px;
    }

    .ox-chat-root--panel-open .ox-chat-bubble {
        max-width: 92%;
        padding: 8px 11px;
        font-size: 12px;
        border-radius: 14px;
    }

    .ox-chat-root--panel-open .ox-chat-msg__time {
        font-size: 10px;
    }

    .ox-chat-root--panel-open .ox-chat-msg__sender {
        font-size: 10px;
    }

    .ox-chat-root--panel-open .ox-chat-status-bar {
        font-size: 11px;
        padding: 6px 12px;
    }

    .ox-chat-root--panel-open .ox-chat-panel__textarea {
        min-height: 36px;
        max-height: 80px;
        padding: 8px 10px;
        font-size: 12px;
        line-height: 1.35;
    }

    .ox-chat-root--panel-open .ox-chat-panel__send {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .ox-chat-root--panel-open .ox-chat-panel__action-btn {
        font-size: 11px;
    }

    .ox-chat-root--panel-open .ox-chat-panel__footnote {
        font-size: 10px;
        margin-top: 6px;
    }

    .ox-chat-root--panel-open .ox-chat-quick-replies {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-top: 8px;
        padding-right: 0;
    }

    .ox-chat-root--panel-open .ox-chat-quick-replies__btn {
        width: 100%;
        max-width: 100%;
        font-size: 12px;
        font-weight: 500;
        line-height: 1.35;
        padding: 8px 12px;
        border-radius: 10px;
        text-align: center;
        white-space: normal;
    }

    .ox-chat-root--panel-open .ox-chat-rich__intro,
    .ox-chat-root--panel-open .ox-chat-rich-text,
    .ox-chat-root--panel-open .ox-chat-rich__footer {
        font-size: 12px;
        line-height: 1.45;
    }

    .ox-chat-root--panel-open .ox-chat-btn,
    .ox-chat-root--panel-open .ox-chat-bubble .ox-chat-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    .ox-chat-root--panel-open .ox-chat-btn--block {
        font-size: 11px;
        padding: 7px 10px;
    }

    .ox-chat-root--panel-open .ox-chat-explore__chip {
        font-size: 10px;
        padding: 5px 10px;
    }

    .ox-chat-root--panel-open .ox-chat-product-card {
        padding: 8px;
        gap: 8px;
    }

    .ox-chat-root--panel-open .ox-chat-product-card__image-link {
        width: 48px;
        height: 48px;
    }

    .ox-chat-root--panel-open .ox-chat-product-card__title {
        font-size: 11px;
    }

    .ox-chat-root--panel-open .ox-chat-product-card__now {
        font-size: 12px;
    }

    .ox-chat-root--panel-open .ox-chat-guest-form {
        padding: 12px 14px;
        gap: 10px;
    }

    .ox-chat-root--panel-open .ox-chat-guest-form__input {
        font-size: 12px;
        padding: 9px 10px;
    }

    .ox-chat-root--panel-open .ox-chat-guest-form__submit {
        font-size: 12px;
        padding: 10px 14px;
    }

    .ox-chat-root--panel-open .ox-chat-guest-form__captcha-wrap {
        overflow: hidden;
    }
}

/* Launcher */
.ox-chat-launcher {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a6dd4 0%, #1558b0 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(26, 109, 212, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ox-chat-launcher:hover {
    transform: scale(1.06);
    box-shadow: 0 10px 32px rgba(26, 109, 212, 0.55);
    background: linear-gradient(145deg, #1f7ae8 0%, #1558b0 100%);
}

.ox-chat-launcher:focus-visible {
    outline: 3px solid rgba(26, 109, 212, 0.45);
    outline-offset: 3px;
}

.ox-chat-launcher__icon {
    position: relative;
    z-index: 2;
    font-size: 1.35rem;
    line-height: 1;
    margin-bottom: 2px;
    animation: oxChatLauncherIconBounce 4.5s ease-in-out infinite;
}

.ox-chat-launcher__ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    pointer-events: none;
    z-index: 1;
}

.ox-chat-launcher__status {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #1558b0;
    z-index: 3;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ox-chat-launcher--active .ox-chat-launcher__status {
    opacity: 1;
    transform: scale(1);
}

.ox-chat-launcher__unread {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    z-index: 4;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.ox-chat-launcher__unread--visible {
    opacity: 1;
    transform: scale(1);
}

.ox-chat-launcher--active {
    box-shadow: 0 10px 32px rgba(26, 109, 212, 0.5), 0 0 0 4px rgba(26, 109, 212, 0.12);
}

.ox-chat-launcher__tail {
    position: absolute;
    bottom: -4px;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid #1558b0;
    z-index: 1;
}

.ox-chat-launcher__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(26, 109, 212, 0.4);
    animation: oxChatLauncherPulse 3.2s ease-out infinite;
    pointer-events: none;
}

.ox-chat-launcher__pulse--delayed {
    animation-delay: 1.6s;
}

.ox-chat-launcher__label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

@keyframes oxChatLauncherPulse {
    0% {
        transform: scale(1);
        opacity: 0.75;
    }
    70% {
        transform: scale(1.55);
        opacity: 0;
    }
    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

@keyframes oxChatLauncherIconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Welcome teaser bubble (site entry) */
.ox-chat-welcome-teaser {
    position: absolute;
    right: 0;
    bottom: 76px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: min(320px, calc(100vw - 48px));
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ox-chat-welcome-teaser--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    animation: oxChatTeaserEnter 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.ox-chat-welcome-teaser--hidden {
    display: none;
}

@keyframes oxChatTeaserEnter {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ox-chat-welcome-teaser__close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.ox-chat-welcome-teaser__close:hover {
    background: #e5e7eb;
    color: #374151;
}

.ox-chat-welcome-teaser__avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg, #1a6dd4 0%, #1558b0 100%);
    color: #fff;
    font-size: 1rem;
}

.ox-chat-welcome-teaser__content {
    padding-right: 16px;
}

.ox-chat-welcome-teaser__title {
    margin: 0 0 4px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}

.ox-chat-welcome-teaser__text {
    margin: 0 0 10px;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.45;
}

.ox-chat-welcome-teaser__cta {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(145deg, #1a6dd4 0%, #1558b0 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ox-chat-welcome-teaser__cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 109, 212, 0.35);
}

/* Panel header branding */
.ox-chat-panel__header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    background-color: var(--accent-header);
}

.ox-chat-panel__header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    /* background: rgba(255, 255, 255, 0.18); */
    font-size: 1rem;
    flex-shrink: 0;
}

.ox-chat-panel__subtitle {
    margin: 2px 0 0;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.88;
}

/* In-panel welcome card */
.ox-chat-welcome-card {
    text-align: center;
    padding: 28px 18px 12px;
    margin: 8px 0 4px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    animation: oxChatMsgEnter 0.4s ease forwards;
}

.ox-chat-welcome-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #f0fdf4;
    color: var(--accent-green, #16a34a);
    font-size: 1.2rem;
    border: 1px solid #bbf7d0;
}

.ox-chat-welcome-card__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.ox-chat-welcome-card__text {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Message enter animation */
.ox-chat-msg[data-ox-chat-msg] {
    animation: oxChatMsgEnter 0.32s ease forwards;
}

@keyframes oxChatMsgEnter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ox-chat-bubble--streaming {
    border: 1px dashed #cbd5e1;
    background: #f8fafc;
}

.ox-chat-msg--typing .ox-chat-typing {
    margin-left: 4px;
}

/* Chat panel */
.ox-chat-panel {
    display: flex;
    flex-direction: column;
    width: min(420px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    height: min(600px, calc(100vh - 100px));
    max-height: calc(100vh - 100px);
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    overflow-x: hidden;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    box-shadow:
        0 24px 64px rgba(15, 23, 42, 0.18),
        0 8px 24px rgba(15, 23, 42, 0.08);
    animation: oxChatOpen 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes oxChatOpen {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ox-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 7px 14px;
    background: var(--accent-green);
    color: #fff;
}

.ox-chat-panel__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.ox-chat-panel__header-actions {
    display: flex;
    gap: 4px;
}

.ox-chat-panel__icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ox-chat-panel__icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.ox-chat-panel__body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
}

.ox-chat-panel__intro {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0 0 16px;
}

.ox-chat-msg {
    margin-bottom: 12px;
}

.ox-chat-msg--customer {
    display: flex;
    justify-content: flex-end;
}

.ox-chat-msg--agent {
    display: flex;
    justify-content: flex-start;
}

.ox-chat-bubble {
    max-width: 88%;
    padding: 10px 14px;
    font-size: 0.875rem;
    border-radius: 16px;
    word-break: break-word;
}

.ox-chat-bubble--customer {
    background: var(--accent-green);
    /* background: linear-gradient(135deg, #1f7ae8 0%, #1558b0 100%); */
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 14px rgba(26, 109, 212, 0.28);
}

.ox-chat-bubble--agent {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
}

.ox-chat-bubble--agent-ai {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.ox-chat-bubble--agent-human {
    background: #fff;
    border: 2px solid #34d399;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.ox-chat-msg__sender--ai {
    color: #6b7280;
}

.ox-chat-msg__sender--human {
    color: #059669;
}

.ox-chat-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
}

.ox-chat-status-bar--ai {
    background: #f3f4f6;
    color: #4b5563;
}

.ox-chat-status-bar--waiting {
    background: #fffbeb;
    color: #b45309;
}

.ox-chat-status-bar--human {
    background: #ecfdf5;
    color: #047857;
}

.ox-chat-phase-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.ox-chat-phase-divider::before,
.ox-chat-phase-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #9ca3af, transparent);
}

.ox-chat-phase-divider span {
    padding: 3px 8px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    white-space: nowrap;
}

.ox-chat-bubble a:not(.ox-chat-btn) {
    color: #1a6dd4;
    font-weight: 600;
    text-decoration: underline;
}

.ox-chat-bubble .ox-chat-btn,
.ox-chat-bubble .ox-chat-btn:hover {
    text-decoration: none;
}

.ox-chat-bubble a.ox-chat-btn--primary {
    color: #fff !important;
}

.ox-chat-bubble a.ox-chat-btn--ghost {
    color: #1a6dd4 !important;
}

.ox-chat-bubble--customer a {
    color: #fff;
}

.ox-chat-msg__sender {
    display: block;
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #1a6dd4;
}

.ox-chat-msg__time {
    display: block;
    margin-top: 4px;
    font-size: 0.7rem;
    color: #9ca3af;
}

.ox-chat-msg--customer .ox-chat-msg__time {
    text-align: right;
}

.ox-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ox-chat-quick-replies__btn {
    padding: 8px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #1f2937;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ox-chat-quick-replies__btn:hover:not(:disabled) {
    background: #f9fafb;
    border-color: #9ca3af;
}

.ox-chat-quick-replies__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ox-chat-typing {
    display: flex;
    gap: 5px;
    padding: 12px 14px;
    background: #f3f4f6;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.ox-chat-typing span {
    width: 7px;
    height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: oxChatBounce 1.2s infinite ease-in-out;
}

.ox-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ox-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes oxChatBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-5px); opacity: 1; }
}

.ox-chat-panel__footer {
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    padding: 12px 14px;
    background: #fff;
}

.ox-chat-panel__input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.ox-chat-panel__textarea {
    flex: 1;
    min-height: 44px;
    max-height: 100px;
    padding: 10px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    resize: none;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ox-chat-panel__textarea:focus {
    border-color: #1a6dd4;
    box-shadow: 0 0 0 3px rgba(26, 109, 212, 0.15);
}

.ox-chat-panel__send {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: var(--accent-green);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.ox-chat-panel__send:hover:not(:disabled) {
    background: var(--accent-green);
}

.ox-chat-panel__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ox-chat-panel__footnote {
    margin: 8px 0 0;
    text-align: center;
    font-size: 0.65rem;
    color: #9ca3af;
    line-height: 1.35;
}

.ox-chat-panel__footnote a {
    color: #1a6dd4;
    text-decoration: underline;
}

/* Hide until Livewire hydrates (legacy — launcher stays visible on .ox-chat-root) */
[wire\:cloak] {
    display: none !important;
}

.ox-chat-panel--busy {
    opacity: 0.98;
}

.ox-chat-bubble--rich {
    max-width: 100%;
    padding: 12px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.ox-chat-bubble--streaming {
    min-height: 2rem;
}

.ox-chat-rich__intro {
    margin: 0 0 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1f2937;
}

.ox-chat-rich__footer {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: #6b7280;
}

/* Product result cards */
.ox-chat-product-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.ox-chat-product-card {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ox-chat-product-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(26, 109, 212, 0.12);
}

.ox-chat-product-card--single {
    border-color: #93c5fd;
    background: #fff;
}

.ox-chat-product-card__image-link {
    flex-shrink: 0;
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.ox-chat-product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ox-chat-product-card__body {
    flex: 1;
    min-width: 0;
}

.ox-chat-product-card__title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #111827 !important;
    text-decoration: none !important;
    line-height: 1.3;
    margin-bottom: 4px;
}

.ox-chat-product-card__title:hover {
    color: #1a6dd4 !important;
}

.ox-chat-product-card__meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.65rem;
    color: #6b7280;
}

.ox-chat-product-card__sku {
    font-weight: 600;
}

.ox-chat-product-card__variants {
    padding: 1px 6px;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 4px;
    font-weight: 600;
}

.ox-chat-product-card__excerpt {
    margin: 0 0 6px;
    font-size: 0.7rem;
    color: #4b5563;
    line-height: 1.4;
}

.ox-chat-product-card__variant-list {
    margin: 0 0 6px;
    padding-left: 14px;
    font-size: 0.65rem;
    color: #6b7280;
    line-height: 1.35;
}

.ox-chat-product-card__price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ox-chat-product-card__was {
    font-size: 0.7rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.ox-chat-product-card__now {
    font-size: 0.9rem;
    font-weight: 800;
    color: #111827;
}

.ox-chat-product-card__sale {
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    border-radius: 4px;
}

.ox-chat-product-card__stock-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ox-chat-product-card__qty {
    font-size: 0.65rem;
    color: #6b7280;
}

.ox-chat-product-card__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ox-chat-btn--block {
    display: block;
    width: 100%;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.75rem;
}

.ox-chat-btn--ghost {
    color: #1a6dd4 !important;
    background: #fff;
    border: 1px solid #bfdbfe;
}

.ox-chat-btn--ghost:hover {
    background: #eff6ff;
}

.ox-chat-explore {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #d1d5db;
}

.ox-chat-explore__title {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #374151;
}

.ox-chat-explore__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ox-chat-explore__chip {
    padding: 6px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #1a6dd4;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.ox-chat-explore__chip:hover:not(:disabled) {
    background: #dbeafe;
    border-color: #93c5fd;
}

.ox-chat-explore__chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ox-chat-product-table-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    -webkit-overflow-scrolling: touch;
}

.ox-chat-product-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.ox-chat-product-table th,
.ox-chat-product-table td {
    padding: 8px 6px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}

.ox-chat-product-table th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
    background: #f9fafb;
}

.ox-chat-scroll-anchor {
    height: 1px;
    width: 100%;
    flex-shrink: 0;
    pointer-events: none;
}

.ox-chat-product-table__name {
    max-width: 130px;
    line-height: 1.3;
}

.ox-chat-product-table__title {
    display: block;
    font-weight: 600;
    color: #111827;
}

.ox-chat-product-table__meta {
    display: block;
    margin-top: 2px;
    font-size: 0.65rem;
    color: #6b7280;
}

.ox-chat-product-table__price {
    white-space: nowrap;
}

.ox-chat-product-table__was {
    display: block;
    font-size: 0.65rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.ox-chat-product-table__now {
    display: block;
    font-weight: 600;
    color: #111827;
}

.ox-chat-product-table__badge {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #b45309;
    background: #fef3c7;
    border-radius: 4px;
}

.ox-chat-product-table__action {
    text-align: right;
    white-space: nowrap;
}

.ox-chat-stock {
    font-size: 0.7rem;
    font-weight: 600;
}

.ox-chat-stock--in_stock {
    color: #059669;
}

.ox-chat-stock--out_of_stock {
    color: #dc2626;
}

.ox-chat-btn {
    display: inline-block;
    padding: 6px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.ox-chat-btn--primary {
    color: #fff;
    background: #1a6dd4;
}

.ox-chat-btn--primary:hover {
    background: #1558b0;
    color: #fff;
}

.ox-chat-btn--muted {
    opacity: 0.85;
    background: #6b7280;
}

.ox-chat-btn--muted:hover {
    background: #4b5563;
    color: #fff;
}

.ox-chat-btn--inline {
    display: inline-block;
    margin: 2px 0;
    padding: 4px 10px;
    font-size: 0.75rem;
}

.ox-chat-btn--link {
    color: #1a6dd4;
    background: transparent;
    padding: 0 2px;
    text-decoration: underline;
}

.ox-chat-rich-text {
    font-size: 0.875rem;
    line-height: 1.55;
    overflow-wrap: break-word;
}

.ox-chat-rich-text strong,
.ox-chat-rich__intro strong {
    font-weight: 700;
    color: #111827;
}

.ox-chat-list {
    margin: 8px 0;
    padding-left: 1.15rem;
}

.ox-chat-list li {
    margin-bottom: 6px;
}

.ox-chat-list li:last-child {
    margin-bottom: 0;
}

.ox-chat-facts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 4px;
}

.ox-chat-fact {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.ox-chat-fact__title {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.ox-chat-fact__body {
    font-size: 0.8rem;
    color: #4b5563;
    line-height: 1.5;
}

.ox-chat-table-wrap {
    margin: 10px 0 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ox-chat-markdown-table {
    width: 100%;
    min-width: 280px;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.ox-chat-markdown-table th,
.ox-chat-markdown-table td {
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    vertical-align: top;
    text-align: left;
    word-break: normal;
    overflow-wrap: break-word;
}

.ox-chat-markdown-table th {
    background: #f3f4f6;
    font-weight: 700;
    color: #374151;
}

.ox-chat-code {
    padding: 1px 5px;
    border-radius: 4px;
    background: #eef2ff;
    font-size: 0.8em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ox-chat-rich-text .ox-chat-link,
.ox-chat-rich__intro .ox-chat-link,
.ox-chat-invoice-list .ox-chat-link {
    color: #1a6dd4;
    font-weight: 600;
    text-decoration: underline;
}

.ox-chat-rich-text .ox-chat-link:hover,
.ox-chat-rich__intro .ox-chat-link:hover {
    color: #1558a8;
}

.ox-chat-order-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ox-chat-order-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.ox-chat-order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.ox-chat-order-card__title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}

.ox-chat-order-card__invoice {
    margin: 4px 0 0;
    font-size: 0.75rem;
    color: #6b7280;
}

.ox-chat-order-card__status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    white-space: nowrap;
}

.ox-chat-order-card__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}

.ox-chat-order-card__meta div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ox-chat-order-card__meta dt {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
}

.ox-chat-order-card__meta dd {
    margin: 0;
    font-size: 0.8rem;
    color: #374151;
    font-weight: 600;
}

.ox-chat-order-card__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ox-chat-invoice-list {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    background: #f9fafb;
}

.ox-chat-invoice-list__title {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #374151;
}

.ox-chat-invoice-list__items {
    margin: 0;
    padding-left: 18px;
    font-size: 0.78rem;
    color: #4b5563;
}

.ox-chat-invoice-list__items li + li {
    margin-top: 6px;
}

.ox-chat-invoice-list__status,
.ox-chat-invoice-list__total {
    margin-left: 6px;
    color: #6b7280;
}

.ox-chat-rich-text .ox-chat-btn {
    margin-top: 4px;
}

@media (max-width: 400px) {
    .ox-chat-root:not(.ox-chat-root--panel-open) {
        right: 6px;
    }

    .ox-chat-product-table th:nth-child(2),
    .ox-chat-product-table td:nth-child(2) {
        display: none;
    }
}

/* Guest pre-chat form */
.ox-chat-guest-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 20px 18px;
    overflow-y: auto;
    background: #ffffff;
}

.ox-chat-guest-form__hero {
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}

.ox-chat-guest-form__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ox-chat-guest-form__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow: hidden;
}

.ox-chat-guest-form__avatar img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.ox-chat-guest-form__title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
}

.ox-chat-guest-form__subtitle {
    margin: 2px 0 0;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

.ox-chat-guest-form__text {
    margin: 0;
    font-size: 0.84rem;
    color: #4b5563;
    line-height: 1.5;
}

.ox-chat-guest-form__fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ox-chat-guest-form__field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.ox-chat-required {
    color: #dc2626;
}

.ox-chat-optional {
    font-weight: 400;
    color: #9ca3af;
}

.ox-chat-guest-form__input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ox-chat-guest-form__input::placeholder {
    color: #9ca3af;
}

.ox-chat-guest-form__input:focus {
    outline: none;
    border-color: var(--accent-green, #16a34a);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.ox-chat-guest-form__field-error,
.ox-chat-guest-form__error {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    color: #dc2626;
}

.ox-chat-guest-form__error {
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: 10px;
    border: 1px solid #fecaca;
}

.ox-chat-guest-form__captcha-wrap {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
}

.ox-chat-guest-form__captcha-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    text-align: center;
}

.ox-chat-guest-form__captcha-scale {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.ox-chat-guest-form__captcha-inner {
    display: flex;
    justify-content: center;
    transform-origin: top center;
    width: 304px;
}

.ox-chat-guest-form__submit {
    margin-top: 2px;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 13px 16px;
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    background: var(--accent-green, #16a34a);
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.ox-chat-guest-form__submit:hover {
    filter: brightness(1.04);
}

.ox-chat-guest-form__submit:active {
    transform: translateY(1px);
}

.ox-chat-guest-form__submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.ox-chat-guest-form__privacy {
    margin: 0;
    text-align: center;
    font-size: 0.72rem;
    color: #9ca3af;
    line-height: 1.45;
}

.ox-chat-guest-form__locked {
    padding: 11px 12px;
    border-radius: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    font-size: 0.88rem;
    color: #166534;
    word-break: break-all;
}

.ox-chat-guest-form__hint {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: #6b7280;
}

/* System / idle messages */
.ox-chat-msg--system {
    justify-content: center;
    text-align: center;
}

.ox-chat-bubble--system {
    background: #fffbeb;
    border: 1px dashed #fcd34d;
    color: #92400e;
    font-size: 0.82rem;
    max-width: 92%;
    padding: 10px 14px;
    border-radius: 10px;
}

/* Chat history panel */
.ox-chat-history {
    padding: 16px 18px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

.ox-chat-history__title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
}

.ox-chat-history__empty {
    color: #6b7280;
    font-size: 0.88rem;
}

.ox-chat-history__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ox-chat-history__item {
    width: 100%;
    text-align: left;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ox-chat-history__item:hover {
    border-color: var(--accent-green, #16a34a);
    background: #f0fdf4;
}

.ox-chat-history__item-date {
    font-weight: 600;
    font-size: 0.88rem;
    color: #111827;
}

.ox-chat-history__item-meta {
    font-size: 0.78rem;
    color: #6b7280;
}

.ox-chat-history__link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--accent-green, #16a34a);
    text-decoration: none;
}

.ox-chat-panel__actions {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.ox-chat-panel__action-btn {
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}

.ox-chat-panel__action-btn:hover {
    color: var(--accent-green, #16a34a);
}

.ox-chat-panel__notice {
    margin: 0 0 8px;
    font-size: 0.78rem;
    color: #15803d;
}

.ox-chat-idle-prompt {
    margin: 12px 8px 4px;
    padding: 12px;
    border-radius: 12px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    text-align: center;
}

.ox-chat-idle-prompt__label {
    margin: 0 0 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #92400e;
}

.ox-chat-idle-prompt__actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.ox-chat-idle-prompt__btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.ox-chat-idle-prompt__btn--stay {
    background: #16a34a;
    color: #fff;
}

.ox-chat-idle-prompt__btn--stay:hover {
    filter: brightness(1.05);
}

.ox-chat-idle-prompt__btn--end {
    background: #fff;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.ox-chat-idle-prompt__btn--end:hover {
    background: #fef2f2;
}

