/* ═══════════════════════════════════════════════════════════
   OpenWPAgent AI Chat Widget — Modern "Martin-Style" Design System
   ═══════════════════════════════════════════════════════════ */

#owpa-chat-widget {
    --owpa-chat-primary: var(--owpa-chat-color, #10b981);
    --owpa-chat-primary-hover: #0d9668;
    --owpa-chat-primary-light: #ecfdf5;
    --owpa-chat-primary-glow: rgba(16,185,129,0.25);
    --owpa-chat-bg: #ffffff;
    --owpa-chat-bg-secondary: #f8fafc;
    --owpa-chat-bg-bot: #f1f5f9;
    --owpa-chat-text: #1e293b;
    --owpa-chat-text-secondary: #64748b;
    --owpa-chat-text-on-primary: #ffffff;
    --owpa-chat-border: #e2e8f0;
    --owpa-chat-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --owpa-chat-shadow-lg: 0 16px 48px rgba(0,0,0,0.12), 0 4px 16px rgba(0,0,0,0.08);
    --owpa-chat-panel-w: 400px;
    --owpa-chat-panel-h: 600px;
    --owpa-chat-toggle-size: 60px;
    --owpa-chat-avatar-sm: 32px;
    --owpa-chat-avatar-lg: 64px;
    --owpa-chat-radius: 16px;
    --owpa-chat-radius-sm: 10px;
    --owpa-chat-ease: cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--owpa-chat-text);
}

/* ── Toggle Button ────────────────────────────────────── */

.owpa-chat-toggle {
    width: var(--owpa-chat-toggle-size);
    height: var(--owpa-chat-toggle-size);
    border-radius: 50%;
    background: white;
    border: 3px solid var(--owpa-chat-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.25s var(--owpa-chat-ease), box-shadow 0.25s var(--owpa-chat-ease);
    position: relative;
    overflow: hidden;
    padding: 0;
}
.owpa-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,0.16), 0 4px 12px rgba(0,0,0,0.08);
}
.owpa-chat-toggle-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.owpa-chat-toggle-fallback {
    width: 28px;
    height: 28px;
    fill: var(--owpa-chat-primary);
}
.owpa-chat-toggle-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 10px;
    font-weight: 700;
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
}
.owpa-chat-toggle-badge.show { display: flex; }

/* Pulse animation on load */
@keyframes owpa-chat-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(0,0,0,0.12); }
    50% { box-shadow: 0 4px 20px rgba(0,0,0,0.12), 0 0 0 8px rgba(16,185,129,0.15); }
}
.owpa-chat-toggle.pulse { animation: owpa-chat-pulse 2s ease-in-out 3; }

/* ── Chat Panel ───────────────────────────────────────── */

.owpa-chat-panel {
    display: none;
    position: absolute;
    bottom: calc(var(--owpa-chat-toggle-size) + 16px);
    right: 0;
    width: var(--owpa-chat-panel-w);
    height: var(--owpa-chat-panel-h);
    max-height: 80vh;
    background: var(--owpa-chat-bg);
    border-radius: var(--owpa-chat-radius);
    box-shadow: var(--owpa-chat-shadow-lg);
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    transition: opacity 0.25s var(--owpa-chat-ease), transform 0.25s var(--owpa-chat-ease);
}
.owpa-chat-panel.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── Header ───────────────────────────────────────────── */

.owpa-chat-header {
    background: linear-gradient(135deg, var(--owpa-chat-primary), var(--owpa-chat-primary-hover));
    color: var(--owpa-chat-text-on-primary);
    padding: 16px 16px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.owpa-chat-header-avatar {
    width: var(--owpa-chat-avatar-sm);
    height: var(--owpa-chat-avatar-sm);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.owpa-chat-header-info { flex: 1; min-width: 0; }
.owpa-chat-header-name {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}
.owpa-chat-header-status {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}
.owpa-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}
.owpa-chat-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.owpa-chat-close:hover { background: rgba(255,255,255,0.25); }

/* ── Welcome Screen ───────────────────────────────────── */

.owpa-chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    text-align: center;
    gap: 16px;
    overflow-y: auto;
}
.owpa-chat-welcome-avatar {
    width: var(--owpa-chat-avatar-lg);
    height: var(--owpa-chat-avatar-lg);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--owpa-chat-primary-light);
}
.owpa-chat-welcome-greeting {
    font-size: 16px;
    font-weight: 600;
    color: var(--owpa-chat-text);
    margin: 0;
}
.owpa-chat-welcome-subtext {
    font-size: 13px;
    color: var(--owpa-chat-text-secondary);
    margin: 0;
    max-width: 280px;
}
.owpa-chat-starters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 300px;
    margin-top: 4px;
}
.owpa-chat-starter-btn {
    background: var(--owpa-chat-bg);
    border: 1px solid var(--owpa-chat-border);
    border-radius: var(--owpa-chat-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--owpa-chat-text);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
    line-height: 1.3;
}
.owpa-chat-starter-btn:hover,
.owpa-chat-starter-btn:focus,
.owpa-chat-starter-btn:active {
    border-color: var(--owpa-chat-primary);
    background: var(--owpa-chat-primary);
    color: #ffffff;
    transform: translateX(2px);
}

/* ── Messages Area ────────────────────────────────────── */

.owpa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.owpa-chat-messages::-webkit-scrollbar { width: 4px; }
.owpa-chat-messages::-webkit-scrollbar-track { background: transparent; }
.owpa-chat-messages::-webkit-scrollbar-thumb { background: var(--owpa-chat-border); border-radius: 4px; }

/* Message groups */
.owpa-chat-msg-group {
    display: flex;
    gap: 8px;
    max-width: 88%;
    animation: owpa-chat-msg-in 0.2s var(--owpa-chat-ease) both;
}
.owpa-chat-msg-group.assistant { align-self: flex-start; }
.owpa-chat-msg-group.user { align-self: flex-end; flex-direction: row-reverse; }

@keyframes owpa-chat-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.owpa-chat-msg-avatar {
    width: var(--owpa-chat-avatar-sm);
    height: var(--owpa-chat-avatar-sm);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.owpa-chat-msg-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* Message bubbles */
.owpa-chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.owpa-chat-msg-group.assistant .owpa-chat-msg-bubble {
    background: var(--owpa-chat-bg-bot);
    color: var(--owpa-chat-text);
    border-bottom-left-radius: 4px;
}
.owpa-chat-msg-group.user .owpa-chat-msg-bubble {
    background: var(--owpa-chat-primary);
    color: var(--owpa-chat-text-on-primary);
    border-bottom-right-radius: 4px;
}
.owpa-chat-msg-bubble a {
    color: var(--owpa-chat-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.owpa-chat-msg-group.user .owpa-chat-msg-bubble a {
    color: var(--owpa-chat-text-on-primary);
}

/* ── Product Card ─────────────────────────────────────── */

.owpa-chat-product-card {
    background: var(--owpa-chat-bg);
    border: 1px solid var(--owpa-chat-border);
    border-radius: var(--owpa-chat-radius-sm);
    overflow: hidden;
    max-width: 260px;
    transition: box-shadow 0.15s;
}
.owpa-chat-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.owpa-chat-product-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--owpa-chat-bg-secondary);
    display: block;
}
.owpa-chat-product-info {
    padding: 12px;
}
.owpa-chat-product-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--owpa-chat-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.owpa-chat-product-price {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.owpa-chat-price-current {
    font-size: 15px;
    font-weight: 700;
    color: var(--owpa-chat-text);
}
.owpa-chat-price-original {
    font-size: 12px;
    color: var(--owpa-chat-text-secondary);
    text-decoration: line-through;
}
.owpa-chat-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #f59e0b;
    margin-bottom: 8px;
}
.owpa-chat-product-rating .count {
    color: var(--owpa-chat-text-secondary);
}
.owpa-chat-product-cta {
    display: block;
    text-align: center;
    background: var(--owpa-chat-primary);
    color: var(--owpa-chat-text-on-primary) !important;
    text-decoration: none !important;
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s;
}
.owpa-chat-product-cta:hover {
    background: var(--owpa-chat-primary-hover);
}

/* ── Product Carousel ─────────────────────────────────── */

.owpa-chat-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}
.owpa-chat-carousel::-webkit-scrollbar { height: 3px; }
.owpa-chat-carousel::-webkit-scrollbar-thumb { background: var(--owpa-chat-border); border-radius: 3px; }
.owpa-chat-carousel .owpa-chat-product-card {
    min-width: 200px;
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* ── Quick Replies ────────────────────────────────────── */

.owpa-chat-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.owpa-chat-quick-btn {
    background: var(--owpa-chat-bg);
    border: 1px solid var(--owpa-chat-primary);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--owpa-chat-primary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
}
.owpa-chat-quick-btn:hover {
    background: var(--owpa-chat-primary);
    color: var(--owpa-chat-text-on-primary);
    transform: translateY(-1px);
}

/* ── Order Lookup ─────────────────────────────────────── */

.owpa-chat-order-lookup {
    background: var(--owpa-chat-bg);
    border: 1px solid var(--owpa-chat-border);
    border-radius: var(--owpa-chat-radius-sm);
    padding: 14px;
}
.owpa-chat-order-lookup h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
}
.owpa-chat-order-field {
    width: 100%;
    border: 1px solid var(--owpa-chat-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    margin-bottom: 8px;
    box-sizing: border-box;
    outline: none;
}
.owpa-chat-order-field:focus { border-color: var(--owpa-chat-primary); }
.owpa-chat-order-submit {
    width: 100%;
    background: var(--owpa-chat-primary);
    color: var(--owpa-chat-text-on-primary);
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.owpa-chat-order-submit:hover { background: var(--owpa-chat-primary-hover); }

/* Order status card */
.owpa-chat-order-card {
    background: var(--owpa-chat-bg);
    border: 1px solid var(--owpa-chat-border);
    border-radius: var(--owpa-chat-radius-sm);
    padding: 14px;
}
.owpa-chat-order-card h4 { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.owpa-chat-order-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 12px 0;
}
.owpa-chat-order-timeline::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--owpa-chat-border);
}
.owpa-chat-order-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.owpa-chat-order-step-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--owpa-chat-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.owpa-chat-order-step.active .owpa-chat-order-step-dot {
    background: var(--owpa-chat-primary);
    color: white;
}
.owpa-chat-order-step.completed .owpa-chat-order-step-dot {
    background: var(--owpa-chat-primary);
    color: white;
}
.owpa-chat-order-step-label {
    font-size: 10px;
    color: var(--owpa-chat-text-secondary);
    text-align: center;
    max-width: 60px;
}
.owpa-chat-order-items {
    font-size: 12px;
    color: var(--owpa-chat-text-secondary);
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}
.owpa-chat-order-items li { padding: 2px 0; }
.owpa-chat-order-tracking {
    margin-top: 8px;
    font-size: 12px;
}
.owpa-chat-order-tracking a { color: var(--owpa-chat-primary); }

/* ── Typing Indicator ─────────────────────────────────── */

.owpa-chat-typing {
    display: flex;
    gap: 8px;
    align-self: flex-start;
    max-width: 88%;
    align-items: flex-start;
}
.owpa-chat-typing-avatar {
    width: var(--owpa-chat-avatar-sm);
    height: var(--owpa-chat-avatar-sm);
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.owpa-chat-typing-dots {
    padding: 12px 16px;
    background: var(--owpa-chat-bg-bot);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.owpa-chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--owpa-chat-text-secondary);
    animation: owpa-chat-blink 1.4s infinite both;
}
.owpa-chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.owpa-chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes owpa-chat-blink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

/* ── Attachment Preview ────────────────────────────────── */

.owpa-chat-attachments-preview {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--owpa-chat-border);
    background: var(--owpa-chat-bg-secondary);
    overflow-x: auto;
    flex-shrink: 0;
}
.owpa-chat-attach-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px;
    background: var(--owpa-chat-bg);
    border: 1px solid var(--owpa-chat-border);
    border-radius: 8px;
    min-width: 72px;
    max-width: 80px;
}
.owpa-chat-attach-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
}
.owpa-chat-attach-file-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--owpa-chat-text-secondary);
}
.owpa-chat-attach-name {
    font-size: 10px;
    color: var(--owpa-chat-text-secondary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 68px;
}
.owpa-chat-attach-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: 2px solid var(--owpa-chat-bg);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

/* Image messages from user */
.owpa-chat-msg-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 10px;
    object-fit: cover;
    cursor: pointer;
}

/* ── Input Area ───────────────────────────────────────── */

.owpa-chat-input-area {
    padding: 10px 12px;
    border-top: 1px solid var(--owpa-chat-border);
    display: flex;
    align-items: flex-end;
    gap: 6px;
    background: var(--owpa-chat-bg);
    flex-shrink: 0;
}
.owpa-chat-attach-btn,
.owpa-chat-mic-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--owpa-chat-text-secondary);
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
}
.owpa-chat-attach-btn:hover,
.owpa-chat-mic-btn:hover {
    color: var(--owpa-chat-primary);
    background: var(--owpa-chat-primary-light);
}
.owpa-chat-mic-btn.recording {
    color: #ef4444;
    background: rgba(239,68,68,0.1);
    animation: owpa-chat-mic-pulse 1s ease-in-out infinite;
}
@keyframes owpa-chat-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
.owpa-chat-input {
    flex: 1;
    border: 1px solid var(--owpa-chat-border);
    border-radius: var(--owpa-chat-radius-sm);
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 80px;
    min-width: 0;
    line-height: 1.4;
    transition: border-color 0.15s;
    background: var(--owpa-chat-bg);
    color: var(--owpa-chat-text);
}
.owpa-chat-input:focus { border-color: var(--owpa-chat-primary); }
.owpa-chat-input::placeholder { color: var(--owpa-chat-text-secondary); }
.owpa-chat-send {
    width: 36px;
    height: 36px;
    background: var(--owpa-chat-primary);
    color: var(--owpa-chat-text-on-primary);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.owpa-chat-send:hover { background: var(--owpa-chat-primary-hover); transform: scale(1.05); }
.owpa-chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.owpa-chat-send svg { width: 16px; height: 16px; fill: currentColor; }

/* ── Satisfaction ─────────────────────────────────────── */

.owpa-chat-satisfaction {
    padding: 16px;
    border-top: 1px solid var(--owpa-chat-border);
    text-align: center;
    background: var(--owpa-chat-bg-secondary);
    flex-shrink: 0;
}
.owpa-chat-satisfaction p {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--owpa-chat-text-secondary);
}
.owpa-chat-satisfaction-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}
.owpa-chat-thumb-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--owpa-chat-border);
    background: var(--owpa-chat-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.owpa-chat-thumb-btn:hover { border-color: var(--owpa-chat-primary); transform: scale(1.1); }
.owpa-chat-thumb-btn.selected {
    background: var(--owpa-chat-primary);
    border-color: var(--owpa-chat-primary);
}
.owpa-chat-feedback-input {
    width: 100%;
    border: 1px solid var(--owpa-chat-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
    margin-top: 8px;
    display: none;
}
.owpa-chat-feedback-input.show { display: block; }
.owpa-chat-feedback-submit {
    margin-top: 8px;
    background: var(--owpa-chat-primary);
    color: var(--owpa-chat-text-on-primary);
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: none;
}
.owpa-chat-feedback-submit.show { display: inline-block; }

/* ── Powered By ───────────────────────────────────────── */

.owpa-chat-powered {
    text-align: center;
    padding: 6px 0;
    font-size: 10px;
    color: var(--owpa-chat-text-secondary);
    opacity: 0.6;
    flex-shrink: 0;
}

/* ── Mobile Responsive ────────────────────────────────── */

@media (max-width: 480px) {
    #owpa-chat-widget {
        bottom: 12px;
        right: 12px;
    }
    .owpa-chat-panel {
        position: fixed;
        bottom: 0 !important;
        right: 0 !important;
        left: 0;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .owpa-chat-product-card { max-width: 100%; }
    .owpa-chat-carousel .owpa-chat-product-card { min-width: 170px; }
    .owpa-chat-product-cta { min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .owpa-chat-quick-btn { min-height: 44px; display: flex; align-items: center; }
    .owpa-chat-starter-btn { min-height: 44px; }
    .owpa-chat-attach-btn, .owpa-chat-mic-btn { width: 40px; height: 40px; }
    .owpa-chat-send { width: 40px; height: 40px; }
    .owpa-chat-input-area { gap: 4px; padding: 8px 10px; }
    .owpa-chat-input { padding: 10px; font-size: 16px; /* prevent iOS zoom */ }
    .owpa-chat-msg-image { max-width: 160px; max-height: 160px; }
    .owpa-chat-attach-thumb { width: 48px; height: 48px; }
    .owpa-chat-attach-item { min-width: 64px; }
}

/* ── Dark Mode ────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    #owpa-chat-widget {
        --owpa-chat-bg: #1e293b;
        --owpa-chat-bg-secondary: #0f172a;
        --owpa-chat-bg-bot: #334155;
        --owpa-chat-text: #f1f5f9;
        --owpa-chat-text-secondary: #94a3b8;
        --owpa-chat-border: #334155;
        --owpa-chat-shadow-lg: 0 16px 48px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
    }
    .owpa-chat-product-card { background: #1e293b; }
    .owpa-chat-order-lookup, .owpa-chat-order-card { background: #1e293b; }
    .owpa-chat-quick-btn { background: #1e293b; }
    .owpa-chat-starter-btn { background: #1e293b; }
    .owpa-chat-toggle-badge { border-color: #1e293b; }
}

/* ── Accessibility ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .owpa-chat-panel,
    .owpa-chat-msg-group,
    .owpa-chat-toggle { transition: none; animation: none; }
}
