/* HUDA AI Chat v1.5.6 — luxury 3D widget + pre-chat flow.
 *
 * Obsidian-black panels, champagne-gold accents, layered depth (stacked
 * shadows, gradients, glass highlights), smooth animations throughout:
 * FAB glow/pulse/orbit, panel slide/fade/zoom, bubble 3D tilt-in, typing
 * shimmer, glowing orb avatar. Every choice (theme, animation, colours,
 * dark/light) comes from Settings — the CSS only reads the variables and
 * data-attributes the widget prints. Respects prefers-reduced-motion.
 *
 * v1.5.3 contrast rule: any colour used as TEXT must be a mode-aware
 * variable (--huda-gold-text / --huda-danger / --huda-star-off), never a
 * fixed hex — #d4af37 gold text is 8.55:1 on dark panels but 2.10:1 on
 * white ones, and #ef4444 red is 4.78:1 dark but 3.76:1 light.
 * v1.5.4 adds --huda-link to the same rule (the browser default visited
 * link red is unreadable on dark bubbles) and .huda-ai-text strong uses
 * --huda-gold-text so **bold** prices render gold in both modes.
 */

#huda-ai-chat-root {
    --huda-green: #075e54;
    --huda-green-light: #128c7e;
    --huda-accent: #25d366;
    --huda-gold: #d4af37;
    --huda-gold-deep: #a97e1f;
    --huda-fab-speed: 2.2s;
    --huda-bg: #efeae2;
    --huda-panel: #ffffff;
    --huda-text: #111b21;
    --huda-muted: #667781;
    --huda-bubble-ai: #ffffff;
    --huda-bubble-me: #d9fdd3;
    --huda-border: #e5e0d8;
    --huda-input: #ffffff;
    --huda-gold-text: #8a6d1f;
    --huda-danger: #dc2626;
    --huda-star-off: #75828f;
    --huda-link: #1a56db;
    --huda-head-bg: linear-gradient(135deg, #14141c 0%, #0a0a10 100%);
    --huda-head-text: #f5eeda;
    --huda-shadow: 0 24px 64px rgba(0, 0, 0, .5), 0 4px 16px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
    color: var(--huda-text);
    z-index: 9999;
}

/* v1.5.1 — author display rules (#huda-ai-chat-panel flex, .huda-ai-typing
   flex, .huda-ai-proof flex, .huda-ai-pending-notice flex, .huda-ai-rec
   flex, .huda-ai-rate flex) beat the browser's [hidden] rule, so hidden
   elements stayed visible on the page. This restores [hidden] for every
   widget element — without it the X button can never hide the panel. */
#huda-ai-chat-root [hidden] { display: none !important; }

/* ---------- Themes ---------- */

/* Obsidian Black + Champagne Gold (site theme, default) */
#huda-ai-chat-root[data-theme="obsidian"] {
    --huda-bg: #0d0d13;
    --huda-panel: #16161f;
    --huda-text: #f2ead8;
    --huda-muted: #a89f83;
    --huda-bubble-ai: #1e1e2a;
    --huda-bubble-me: #3a2f10;
    --huda-border: #2c2c3a;
    --huda-input: #1e1e2a;
    --huda-gold-text: #d4af37;
    --huda-danger: #ef4444;
    --huda-star-off: #b6c4cc;
    --huda-link: #7dd3fc;
    --huda-accent: var(--huda-gold);
    --huda-green: #14141c;
    --huda-green-light: var(--huda-gold);
}

/* Glass (frosted, light) */
#huda-ai-chat-root[data-theme="glass"] {
    --huda-bg: rgba(255, 255, 255, .72);
    --huda-panel: rgba(255, 255, 255, .85);
    --huda-text: #1a1a22;
    --huda-muted: #6b6b78;
    --huda-bubble-ai: rgba(255, 255, 255, .9);
    --huda-bubble-me: rgba(212, 175, 55, .18);
    --huda-border: rgba(255, 255, 255, .6);
    --huda-input: rgba(255, 255, 255, .9);
    --huda-gold-text: #8a6d1f;
    --huda-danger: #dc2626;
    --huda-star-off: #75828f;
    --huda-head-bg: linear-gradient(135deg, rgba(20, 20, 28, .92), rgba(10, 10, 16, .92));
    --huda-head-text: #f5eeda;
    --huda-link: #1a56db;
    --huda-shadow: 0 24px 64px rgba(20, 20, 40, .35), 0 4px 16px rgba(20, 20, 40, .2), inset 0 1px 0 rgba(255, 255, 255, .5);
}

/* Midnight Gradient (violet → gold) */
#huda-ai-chat-root[data-theme="gradient"] {
    --huda-bg: #14102a;
    --huda-panel: #1d1738;
    --huda-text: #f3eefc;
    --huda-muted: #b3a6d6;
    --huda-bubble-ai: #2a2150;
    --huda-bubble-me: #4a3410;
    --huda-border: #3a2f66;
    --huda-input: #241d45;
    --huda-gold-text: #d4af37;
    --huda-danger: #ef4444;
    --huda-star-off: #b6c4cc;
    --huda-head-bg: linear-gradient(135deg, #5b21b6 0%, #7c3aed 45%, #d4af37 130%);
    --huda-head-text: #fff;
    --huda-link: #7dd3fc;
    --huda-accent: var(--huda-gold);
}

/* Classic Green (v1.2 look) */
#huda-ai-chat-root[data-theme="whatsapp"] {
    --huda-bg: #efeae2;
    --huda-panel: #ffffff;
    --huda-text: #111b21;
    --huda-muted: #667781;
    --huda-bubble-ai: #ffffff;
    --huda-bubble-me: #d9fdd3;
    --huda-border: #e5e0d8;
    --huda-input: #ffffff;
    --huda-gold-text: #8a6d1f;
    --huda-danger: #dc2626;
    --huda-star-off: #75828f;
    --huda-head-bg: var(--huda-green);
    --huda-head-text: #fff;
    --huda-link: #1a56db;
    --huda-shadow: 0 16px 48px rgba(0, 0, 0, .35);
}

/* ---------- Dark / Light modes ---------- */

#huda-ai-chat-root[data-mode="dark"] {
    --huda-bg: #0d0d13;
    --huda-panel: #16161f;
    --huda-text: #f2ead8;
    --huda-muted: #a89f83;
    --huda-bubble-ai: #1e1e2a;
    --huda-bubble-me: #3a2f10;
    --huda-border: #2c2c3a;
    --huda-input: #1e1e2a;
    --huda-gold-text: #d4af37;
    --huda-danger: #ef4444;
    --huda-star-off: #b6c4cc;
    --huda-link: #7dd3fc;
}

#huda-ai-chat-root[data-mode="light"] {
    --huda-bg: #f6f2ea;
    --huda-panel: #ffffff;
    --huda-text: #1a1a22;
    --huda-muted: #6b6b78;
    --huda-bubble-ai: #ffffff;
    --huda-bubble-me: #f3e6bd;
    --huda-border: #e5e0d8;
    --huda-input: #ffffff;
    --huda-gold-text: #8a6d1f;
    --huda-danger: #dc2626;
    --huda-star-off: #75828f;
    --huda-link: #1a56db;
}

@media (prefers-color-scheme: dark) {
    #huda-ai-chat-root[data-mode="system"] {
        --huda-bg: #0d0d13;
        --huda-panel: #16161f;
        --huda-text: #f2ead8;
        --huda-muted: #a89f83;
        --huda-bubble-ai: #1e1e2a;
        --huda-bubble-me: #3a2f10;
        --huda-border: #2c2c3a;
        --huda-input: #1e1e2a;
        --huda-gold-text: #d4af37;
        --huda-danger: #ef4444;
        --huda-star-off: #b6c4cc;
        --huda-link: #7dd3fc;
    }
}

html[data-theme="dark"] #huda-ai-chat-root[data-mode="system"] {
    --huda-bg: #0d0d13;
    --huda-panel: #16161f;
    --huda-text: #f2ead8;
    --huda-muted: #a89f83;
    --huda-bubble-ai: #1e1e2a;
    --huda-bubble-me: #3a2f10;
    --huda-border: #2c2c3a;
    --huda-input: #1e1e2a;
    --huda-gold-text: #d4af37;
    --huda-danger: #ef4444;
    --huda-star-off: #b6c4cc;
    --huda-link: #7dd3fc;
}

/* ---------- Floating button (3D, animated) ---------- */

#huda-ai-chat-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 62px;
    height: 62px;
    border: 1px solid rgba(212, 175, 55, .55);
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #3a3a4a 0%, #14141c 55%, #0a0a10 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -6px 12px rgba(0, 0, 0, .5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 9999;
    transition: transform .25s ease, box-shadow .25s ease;
}

#huda-ai-chat-root[data-theme="whatsapp"] #huda-ai-chat-fab {
    background: var(--huda-accent);
    border: 0;
}

#huda-ai-chat-fab:hover { transform: translateY(-2px) scale(1.05); }
#huda-ai-chat-fab:active { transform: translateY(0) scale(.97); }

#huda-ai-chat-fab svg { width: 30px; height: 30px; position: relative; z-index: 2; }

/* Glow ring (default animation) */
.huda-ai-fab-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--huda-gold);
    opacity: 0;
    pointer-events: none;
}

#huda-ai-chat-root.huda-ai-fab-glow .huda-ai-fab-ring {
    animation: huda-ai-glow var(--huda-fab-speed) ease-out infinite;
}

@keyframes huda-ai-glow {
    0% { transform: scale(.85); opacity: .9; }
    70% { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* Pulse */
#huda-ai-chat-root.huda-ai-fab-pulse #huda-ai-chat-fab {
    animation: huda-ai-pulse var(--huda-fab-speed) ease-in-out infinite;
}

@keyframes huda-ai-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 0 0 0 rgba(212, 175, 55, .45); }
    50% { transform: scale(1.08); box-shadow: 0 10px 28px rgba(0, 0, 0, .5), 0 0 0 12px rgba(212, 175, 55, 0); }
}

/* Orbiting dots */
.huda-ai-fab-orbit { display: none; position: absolute; inset: -9px; pointer-events: none; }
.huda-ai-fab-orbit i {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--huda-gold);
    box-shadow: 0 0 8px var(--huda-gold);
}

#huda-ai-chat-root.huda-ai-fab-orbit .huda-ai-fab-orbit { display: block; animation: huda-ai-spin calc(var(--huda-fab-speed) * 1.6) linear infinite; }
#huda-ai-chat-root.huda-ai-fab-orbit .huda-ai-fab-orbit i:nth-child(1) { top: 0; left: 50%; margin-left: -3px; }
#huda-ai-chat-root.huda-ai-fab-orbit .huda-ai-fab-orbit i:nth-child(2) { bottom: 6px; left: 8px; }
#huda-ai-chat-root.huda-ai-fab-orbit .huda-ai-fab-orbit i:nth-child(3) { bottom: 6px; right: 8px; }

@keyframes huda-ai-spin { to { transform: rotate(360deg); } }

.huda-ai-fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    padding: 2px 7px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, .55);
    z-index: 3;
}

#huda-ai-chat-root[data-theme="whatsapp"] .huda-ai-fab-badge { background: #7c3aed; color: #fff; }

/* ---------- Panel ---------- */

#huda-ai-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 94px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--huda-bg);
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 20px;
    box-shadow: var(--huda-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    transform-origin: bottom right;
}

#huda-ai-chat-root.huda-ai-place-bottom-left #huda-ai-chat-fab { right: auto; left: 20px; }
#huda-ai-chat-root.huda-ai-place-bottom-left #huda-ai-chat-panel { right: auto; left: 20px; transform-origin: bottom left; }
#huda-ai-chat-root.huda-ai-place-bottom-left #huda-ai-teaser { right: auto; left: 96px; border-radius: 16px 16px 16px 4px; }

/* Open animations */
#huda-ai-chat-root.huda-ai-open-slide #huda-ai-chat-panel:not([hidden]) { animation: huda-ai-panel-slide .35s cubic-bezier(.2, .9, .3, 1.2) both; }
#huda-ai-chat-root.huda-ai-open-fade #huda-ai-chat-panel:not([hidden]) { animation: huda-ai-panel-fade .3s ease both; }
#huda-ai-chat-root.huda-ai-open-zoom #huda-ai-chat-panel:not([hidden]) { animation: huda-ai-panel-zoom .3s cubic-bezier(.2, .9, .3, 1.2) both; }

@keyframes huda-ai-panel-slide { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes huda-ai-panel-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes huda-ai-panel-zoom { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

/* Glass theme: frosted panel */
#huda-ai-chat-root[data-theme="glass"] #huda-ai-chat-panel { backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }

/* ---------- Header ---------- */

.huda-ai-head {
    background: var(--huda-head-bg);
    color: var(--huda-head-text);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    flex: 0 0 auto;
    border-bottom: 1px solid rgba(212, 175, 55, .4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}

#huda-ai-chat-root[data-theme="whatsapp"] .huda-ai-head { border-bottom: 0; }

.huda-ai-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(212, 175, 55, .5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.huda-ai-avatar svg { width: 22px; height: 22px; }

/* Animated glowing orb avatar (feature 14) */
.huda-ai-orb {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    position: relative;
    animation: huda-ai-orb-idle 3s ease-in-out infinite;
}

.huda-ai-orb-gold { background: radial-gradient(circle at 35% 30%, #fff3c4 0%, #f6d365 30%, var(--huda-gold) 60%, #7a5c10 100%); box-shadow: 0 0 14px rgba(212, 175, 55, .8), 0 0 32px rgba(212, 175, 55, .35); }
.huda-ai-orb-violet { background: radial-gradient(circle at 35% 30%, #ede9fe 0%, #a78bfa 35%, #7c3aed 65%, #3b0764 100%); box-shadow: 0 0 14px rgba(139, 92, 246, .8), 0 0 32px rgba(139, 92, 246, .35); }
.huda-ai-orb-teal { background: radial-gradient(circle at 35% 30%, #ccfbf1 0%, #5eead4 35%, #14b8a6 65%, #042f2e 100%); box-shadow: 0 0 14px rgba(45, 212, 191, .8), 0 0 32px rgba(45, 212, 191, .35); }

.huda-ai-orb-core {
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 0 10px rgba(255, 255, 255, .9);
}

@keyframes huda-ai-orb-idle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Orb "speaking" while the AI types */
.huda-ai-orb.speaking { animation: huda-ai-orb-speak .5s ease-in-out infinite; }

@keyframes huda-ai-orb-speak {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.22); filter: brightness(1.35); }
}

.huda-ai-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.huda-ai-head-text strong { font-size: 16px; line-height: 1.25; letter-spacing: .2px; }
.huda-ai-presence { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }

.huda-ai-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
    box-shadow: 0 0 6px #34d399;
    animation: huda-ai-dot-pulse 2s ease-in-out infinite;
}

@keyframes huda-ai-dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.huda-ai-head-btn {
    color: var(--huda-head-text);
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    cursor: pointer;
    padding: 5px 8px;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.huda-ai-head-btn.off { opacity: .45; }

/* v1.5.1 — visible pressed state for the mode toggle (light mode on),
   and 34px minimum touch targets on every header button so a tap on a
   phone always lands. */
.huda-ai-head-btn.is-light {
    background: rgba(212, 175, 55, .35);
    border-color: var(--huda-gold);
    color: #fff;
}

.huda-ai-head-btn, .huda-ai-wa-link, #huda-ai-chat-close { min-width: 34px; min-height: 34px; }

.huda-ai-wa-link, #huda-ai-chat-close {
    color: var(--huda-head-text);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.huda-ai-wa-link svg, #huda-ai-chat-close svg { width: 22px; height: 22px; }

/* ---------- Announcement bar (feature 21) ---------- */

.huda-ai-announce {
    flex: 0 0 auto;
    background: linear-gradient(90deg, var(--huda-gold-deep), var(--huda-gold), var(--huda-gold-deep));
    background-size: 200% 100%;
    animation: huda-ai-shimmer 4s linear infinite;
    color: #1a1a22;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
    padding: 7px 10px;
}

@keyframes huda-ai-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Body / messages ---------- */

.huda-ai-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* v1.5.5 — never let a long unbreakable token spill sideways out
       of the panel (see .huda-ai-chip-clarify): the body is the scroll
       container, vertical scroll only. */
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.huda-ai-day {
    align-self: center;
    background: rgba(0, 0, 0, .08);
    color: var(--huda-muted);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
}

/* v1.5.5 — min-width: 0: the msgs column is a flex item of
   .huda-ai-body, and flex items default to min-width: auto, so a long
   unbreakable token inside it (the old clarify-button markup) forced
   the whole column wider than the panel. 0 lets it shrink to the
   panel width; long labels wrap inside their own buttons instead. */
.huda-ai-msgs { display: flex; flex-direction: column; gap: 8px; perspective: 600px; min-width: 0; }

.huda-ai-row { display: flex; }
.huda-ai-row.me { justify-content: flex-end; }
.huda-ai-row.ai { justify-content: flex-start; }

/* Bubble 3D tilt-in (feature 13) */
.huda-ai-row .huda-ai-bubble { animation: huda-ai-bubble-in .35s cubic-bezier(.2, .9, .3, 1.15) both; }

@keyframes huda-ai-bubble-in {
    from { opacity: 0; transform: translateY(10px) rotateX(18deg) scale(.96); }
    to { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}

.huda-ai-bubble {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
    /* v1.5.3 — explicit pairing: bubble text ALWAYS uses --huda-text,
       so it can never inherit a mismatched ancestor colour again. */
    color: var(--huda-text);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.huda-ai-row.me .huda-ai-bubble {
    background: var(--huda-bubble-me);
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(212, 175, 55, .35);
}

.huda-ai-row.ai .huda-ai-bubble {
    background: var(--huda-bubble-ai);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--huda-border);
}

/* v1.5.4 — links inside AI bubbles had NO rule at all, so they fell
   back to the browser default: unvisited blue, VISITED dark red
   (#551a8b-ish) — the live 12:01 test showed a dark-red product link
   on the dark bubble, nearly unreadable. Links now use the mode-aware
   --huda-link in BOTH states (light #1a56db 6.18:1 on white, dark
   #7dd3fc 9.87:1 on #1e1e2a), underlined for affordance. The :visited
   state is pinned to the same colour so a visited link can never go
   dark red again. */
.huda-ai-bubble a, .huda-ai-bubble a:visited,
.huda-ai-text a, .huda-ai-text a:visited { color: var(--huda-link); text-decoration: underline; }

/* v1.5.4 — **bold** in AI replies (usually the price) renders gold:
   markdown() turns **৳350** into <strong>, and this pairs it with the
   mode-aware gold text (dark 8.55:1, light 4.90:1). Scoped to
   .huda-ai-text so section headers ("Related products") keep their
   own styling. */
.huda-ai-text strong { color: var(--huda-gold-text); }

.huda-ai-meta {
    display: block;
    font-size: 11px;
    color: var(--huda-muted);
    margin-top: 4px;
    text-align: right;
}

/* Product cards (3D, gold border) */
.huda-ai-card {
    background: var(--huda-panel);
    border: 1px solid rgba(212, 175, 55, .5);
    border-radius: 14px;
    padding: 10px 12px;
    margin-top: 6px;
    display: block;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.huda-ai-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .1); }

.huda-ai-card strong { display: block; font-size: 14px; }
.huda-ai-card .huda-ai-price { color: var(--huda-gold-text); font-weight: 800; font-size: 15px; }
.huda-ai-card .huda-ai-stock-out { color: var(--huda-danger); font-size: 12px; font-weight: 700; }
.huda-ai-card .huda-ai-view { font-size: 12px; color: var(--huda-muted); }

.huda-ai-buy {
    display: inline-block;
    margin-top: 8px;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold) 55%, var(--huda-gold-deep));
    color: #1a1a22;
    font-weight: 800;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(212, 175, 55, .45);
}

.huda-ai-notify-btn {
    display: inline-block;
    margin-top: 8px;
    background: transparent;
    border: 1px solid var(--huda-gold);
    color: var(--huda-gold-text);
    font-weight: 700;
    font-size: 12.5px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.huda-ai-notify-form { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.huda-ai-notify-form input[type="tel"] {
    border: 1px solid var(--huda-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    background: var(--huda-input);
    color: var(--huda-text);
}
.huda-ai-notify-form label { font-size: 12px; color: var(--huda-muted); display: flex; gap: 6px; align-items: flex-start; }
.huda-ai-notify-form button {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    padding: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* Typing indicator with shimmer */
.huda-ai-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--huda-bubble-ai);
    border: 1px solid var(--huda-border);
    border-radius: 12px;
    padding: 10px 14px;
    width: fit-content;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
    font-size: 12px;
    color: var(--huda-muted);
    background-image: linear-gradient(100deg, transparent 30%, rgba(212, 175, 55, .12) 50%, transparent 70%);
    background-size: 200% 100%;
    animation: huda-ai-shimmer 2.2s linear infinite;
}

.huda-ai-dots { display: inline-flex; gap: 4px; }
.huda-ai-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--huda-gold);
    animation: huda-ai-bounce 1.2s infinite ease-in-out;
}
.huda-ai-dots i:nth-child(2) { animation-delay: .15s; }
.huda-ai-dots i:nth-child(3) { animation-delay: .3s; }

@keyframes huda-ai-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.huda-ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.huda-ai-chip {
    border: 1px solid rgba(212, 175, 55, .55);
    background: rgba(212, 175, 55, .1);
    color: inherit;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12.5px;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.huda-ai-chip:hover { background: rgba(212, 175, 55, .25); transform: translateY(-1px); }

/* Order tracking + offline lead forms */
.huda-ai-track, .huda-ai-lead {
    border: 1px solid rgba(212, 175, 55, .45);
    background: rgba(212, 175, 55, .06);
    border-radius: 16px;
    padding: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

/* v1.5.4 — the track row wraps: two 50% inputs left "Phone used in
   the order" truncated ("Phone used in the orde", live 12:01–12:10)
   on narrow panels. Each input now takes at least 160px and drops to
   its own full-width line when the row cannot fit both. */
.huda-ai-track-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.huda-ai-track-row input, .huda-ai-lead input, .huda-ai-lead textarea {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--huda-border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    background: var(--huda-input);
    color: var(--huda-text);
    width: 100%;
    box-sizing: border-box;
}
/* v1.5.4 — track inputs need a 160px basis to wrap (this rule must
   sit AFTER the shared input rule above: equal specificity, later
   wins). Without it the shared "flex: 1" shrinks both inputs to 50%
   and the phone placeholder truncates again. */
.huda-ai-track-row input { flex: 1 1 160px; }

.huda-ai-lead { display: flex; flex-direction: column; gap: 8px; }
.huda-ai-lead strong { font-size: 13.5px; }

.huda-ai-track button, .huda-ai-lead button {
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    padding: 9px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(212, 175, 55, .4);
}

/* v1.5.6 — the compact track box lives in ONE row (Order ID input +
   Track button side by side, directly above the typing box). The
   full-width button rule above must NOT apply inside the row: the
   button is auto-width beside the input. */
.huda-ai-track-row #huda-ai-track-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 16px;
    white-space: nowrap;
}

.huda-ai-track-result { margin-top: 9px; font-size: 13.5px; line-height: 1.55; }

/* v1.5.6 — round Track Order entry button (owner order 12:47). A
   small circular button styled like the chat FAB, in its own row
   directly above the typing box; tapping it opens the compact track
   box (Order ID + Track) without filling the panel. 44px = clearly
   tappable on mobile. The track box itself is hidden by default and
   capped (~160px result) so it never fills the panel. */
.huda-ai-track-fab-row {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px 0;
}
#huda-ai-track-fab {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, .6);
    background: radial-gradient(circle at 35% 30%, #f6d365, var(--huda-gold) 55%, #8a6d1f);
    color: #1a1a22;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(212, 175, 55, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
    padding: 0;
}
#huda-ai-track-fab svg { width: 22px; height: 22px; }
#huda-ai-track-fab:focus-visible { outline: 2px solid var(--huda-gold); outline-offset: 2px; }
.huda-ai-track-box { margin: 6px 10px 0; }
.huda-ai-track-box .huda-ai-track-result { max-height: 160px; overflow-y: auto; }

/* v1.5.6 — "Talk to admin" button (revised owner order 12:58,
   supersedes the 12:52 "Human Support" header button). Exactly ONE
   human-support button in the panel: the old "Talk to a human on
   WhatsApp" footer button is REMOVED. This button sits in its own
   row directly under the header, right-aligned and separate — like
   ChatGPT's pop-up options — with the admin's photo/logo (circular)
   on the left and the label "admin এর সাথে কথা বলুন" (editable in
   Settings). Empty photo → default person SVG icon. Tap = the same
   WhatsApp handoff (with transcript). */
.huda-ai-admin-btn-row {
    display: flex;
    justify-content: flex-end;
    padding: 8px 10px 0;
}
#huda-ai-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    max-width: 100%;
    border: 1px solid rgba(212, 175, 55, .6);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(212, 175, 55, .22), rgba(212, 175, 55, .08));
    color: var(--huda-text);
    padding: 5px 14px 5px 5px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
#huda-ai-admin-btn img,
#huda-ai-admin-btn .huda-ai-admin-photo {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(212, 175, 55, .25);
    display: flex;
    align-items: center;
    justify-content: center;
}
#huda-ai-admin-btn .huda-ai-admin-photo svg { width: 18px; height: 18px; }
#huda-ai-admin-btn span.huda-ai-admin-label { overflow-wrap: break-word; }
#huda-ai-admin-btn:focus-visible { outline: 2px solid var(--huda-gold); outline-offset: 2px; }

/* v1.5.6 — the old full-width "Talk to a human on WhatsApp" footer
   button is REMOVED (owner correction 12:58); its rule is deleted
   with it. The only human-support button is #huda-ai-admin-btn
   (own row under the header, styled above). */

/* Cart reminder banner (feature 2) */
.huda-ai-cart-note {
    border: 1px solid rgba(212, 175, 55, .5);
    background: linear-gradient(135deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .05));
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13.5px;
    line-height: 1.5;
}

.huda-ai-cart-note a { color: var(--huda-gold-text); font-weight: 800; }

/* ---------- Composer ---------- */

.huda-ai-send {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 10px;
    background: var(--huda-panel);
    border-top: 1px solid var(--huda-border);
}

.huda-ai-send input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--huda-border);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 14px;
    background: var(--huda-input);
    color: var(--huda-text);
    outline: none;
}

.huda-ai-send input:focus { border-color: var(--huda-gold); box-shadow: 0 0 0 2px rgba(212, 175, 55, .25); }

/* v1.5.3 — explicit placeholder colour (was browser-default): muted text
   on the input background in both modes (dark 6.24:1, light 5.25:1). */
.huda-ai-send input::placeholder,
.huda-ai-track-row input::placeholder,
.huda-ai-lead input::placeholder,
.huda-ai-lead textarea::placeholder,
.huda-ai-prechat input::placeholder { color: var(--huda-muted); opacity: 1; }

.huda-ai-send button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: 0 3px 10px rgba(212, 175, 55, .4);
}

.huda-ai-send button svg { width: 20px; height: 20px; }
.huda-ai-send .huda-ai-attach-btn { background: none; color: var(--huda-muted); box-shadow: none; }

.huda-ai-img { max-width: 210px; width: 100%; border-radius: 10px; display: block; }

.huda-ai-offline {
    background: rgba(245, 158, 11, .14);
    border: 1px solid rgba(245, 158, 11, .4);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12.5px;
}

#huda-ai-teaser {
    position: fixed;
    right: 96px;
    bottom: 158px;
    z-index: 9998;
    max-width: 250px;
    background: var(--huda-panel);
    color: var(--huda-text);
    border: 1px solid rgba(212, 175, 55, .45);
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 12px 32px rgba(2, 20, 30, .35);
    padding: 12px 34px 12px 14px;
    font-size: 13.5px;
    line-height: 1.45;
    cursor: pointer;
    animation: huda-ai-panel-slide .3s ease both;
}

#huda-ai-teaser-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: 0;
    background: none;
    color: inherit;
    opacity: .55;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
}

.huda-ai-fab-unread {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #d92d20;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 999px;
    padding: 0 5px;
    z-index: 3;
}

.huda-ai-rate {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    flex-wrap: wrap;
}

.huda-ai-rate button {
    border: 0;
    background: none;
    padding: 2px;
    cursor: pointer;
    color: var(--huda-star-off);
    line-height: 0;
}

.huda-ai-rate button.on { color: var(--huda-gold-text); }
.huda-ai-rate button svg { width: 20px; height: 20px; }

@media (max-width: 480px) {
    #huda-ai-chat-panel {
        right: 8px;
        bottom: calc(190px + env(safe-area-inset-bottom, 0px));
        width: calc(100vw - 16px);
        height: calc(100vh - 212px);
        height: calc(100dvh - 212px);
        max-height: none;
    }
    /* v1.5.6 — mobile FAB + panel MUST clear the theme's fixed bottom
       navigation bar (measured ~58-67px tall on the owner's phone).
       v1.5.5's 96px FAB / 166px panel DID clear it on a fresh load —
       the owner confirmed "Fixed" 12:51 — but the 96px rule lived ONLY
       inside this 480px query while the bottom-left placement class
       (line ~312) applies at ALL widths: on a phone wider than 480px
       CSS the FAB went bottom-left but stayed at bottom:20px, hidden
       behind the nav (only an "AI" sliver showed). v1.5.6 raises the
       offsets AND widens the breakpoint to 768px (new block below), so
       every phone width is covered. New offsets, per the owner's
       "a bit more above the Home button": FAB bottom 120px (nav ~67px
       + ~53px clearance + safe-area), panel bottom 190px (= 120 FAB +
       62 FAB height + 8 gap + safe-area), panel height keeps the 22px
       top margin (100dvh - 212px). The typing box + send button sit
       ~200px above the viewport bottom — fully visible and tappable. */
    #huda-ai-chat-fab { left: 12px; right: auto; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
    #huda-ai-chat-root.huda-ai-place-mobile-bottom-right #huda-ai-chat-fab { left: auto; right: 12px; }
    #huda-ai-chat-root.huda-ai-place-bottom-left #huda-ai-chat-panel { left: 8px; right: 8px; }
    #huda-ai-chat-root.huda-ai-place-mobile-bottom-left #huda-ai-teaser { right: auto; left: 76px; }
    #huda-ai-chat-root.huda-ai-place-mobile-bottom-right #huda-ai-teaser { right: 76px; left: auto; }
    .huda-ai-teaser, #huda-ai-teaser { max-width: calc(100vw - 100px); }
}

/* v1.5.6 — the same raised offsets for 481–768px viewports. The
   site's bottom nav shows at these widths too (its breakpoint is
   wider than 480px), and the bottom-left placement class already
   applies here, so without this block the FAB/panel sat at
   bottom:20px/94px — behind the nav. Desktop (>768px, no bottom
   nav) keeps the base 20px / 94px offsets. Teaser bottom 182px =
   120 FAB bottom + 62 FAB height. */
@media (max-width: 768px) {
    #huda-ai-chat-fab { bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
    #huda-ai-chat-panel {
        bottom: calc(190px + env(safe-area-inset-bottom, 0px));
        height: calc(100vh - 212px);
        height: calc(100dvh - 212px);
        max-height: none;
    }
    #huda-ai-teaser { bottom: calc(182px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- v1.4.0 — pre-chat form + quick chips ---------- */

.huda-ai-chip-quick {
    background: linear-gradient(135deg, rgba(212, 175, 55, .28), rgba(212, 175, 55, .12));
    border-color: var(--huda-gold);
    color: var(--huda-text);
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(212, 175, 55, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.huda-ai-prechat {
    margin: 10px 0;
    padding: 14px;
    border: 1px solid var(--huda-gold);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(212, 175, 55, .14), rgba(212, 175, 55, .04));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .1);
    animation: huda-ai-bubble-in .35s ease both;
}

.huda-ai-prechat strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--huda-text);
}

.huda-ai-prechat-note {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--huda-muted);
}

.huda-ai-prechat label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--huda-muted);
    margin-bottom: 8px;
}

.huda-ai-prechat input {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--huda-text);
    background: var(--huda-input);
    border: 1px solid var(--huda-border);
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
}

.huda-ai-prechat input:focus {
    border-color: var(--huda-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, .25);
}

.huda-ai-prechat button {
    width: 100%;
    padding: 11px;
    font-size: 14.5px;
    font-weight: 700;
    color: #1a1405;
    background: linear-gradient(135deg, #f0d878, var(--huda-gold) 55%, #a97e1f);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(212, 175, 55, .35), inset 0 1px 0 rgba(255, 255, 255, .45);
    transition: transform .15s ease, box-shadow .15s ease;
}

.huda-ai-prechat button:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(212, 175, 55, .45), inset 0 1px 0 rgba(255, 255, 255, .45); }
.huda-ai-prechat button:active { transform: translateY(0); }

.huda-ai-prefilled {
    font-size: 13px;
    color: var(--huda-muted);
    padding: 6px 2px;
    margin-bottom: 8px;
}

.huda-ai-prechat .huda-ai-track-result { color: var(--huda-danger); }
/* v1.5.6 — the track box moved out of .huda-ai-prechat (it now sits
   above the send form); the error colour must follow it. */
.huda-ai-track .huda-ai-track-result { color: var(--huda-danger); }

/* ---------- v1.5.0: premium 3D widget, .top cards, suggestions, typing, 3D input ---------- */

/* FAB — deeper 3D: gold rim light + layered drop shadow; the icon is a
   detailed gradient AI orb (SVG in widget.php), not a flat glyph. */
#huda-ai-chat-fab {
    background: radial-gradient(circle at 30% 24%, #4a4a5e 0%, #1c1c28 48%, #0b0b12 100%);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .55), 0 3px 10px rgba(0, 0, 0, .45), inset 0 2px 1px rgba(255, 255, 255, .22), inset 0 -8px 16px rgba(0, 0, 0, .55), 0 0 0 1px rgba(212, 175, 55, .35);
}
#huda-ai-chat-fab svg { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }

/* Panel — premium realistic: gold hairline under the header, deeper
   glass shadow, bubbles with a soft inner highlight. */
.huda-ai-head { position: relative; }
.huda-ai-head::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .7), transparent);
}
.huda-ai-bubble { box-shadow: 0 2px 8px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .08); }

/* Typing indicator variants (style from Settings). */
.huda-ai-typing--line .huda-ai-dots { display: none; }
.huda-ai-typing--line::after {
    content: '';
    display: block;
    height: 2px;
    margin-top: 6px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--huda-gold), transparent);
    background-size: 200% 100%;
    animation: huda-ai-type-line 1.1s linear infinite;
}
@keyframes huda-ai-type-line { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.huda-ai-typing--orb .huda-ai-dots { display: none; }
.huda-ai-typing--orb .huda-ai-typing-label { opacity: .85; }

/* Cross-site .top fallback. */
.huda-ai-top-bubble { border: 1px solid rgba(212, 175, 55, .5); }
.huda-ai-top-head { margin-bottom: 6px; line-height: 1.5; }
.huda-ai-top-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
    margin-right: 4px;
    box-shadow: 0 2px 6px rgba(212, 175, 55, .4);
}
.huda-ai-card-top { border-color: rgba(212, 175, 55, .45); }
.huda-ai-top-search-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--huda-gold-text); }

/* Suggested + clarify chips. */
.huda-ai-suggest-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.huda-ai-chip-suggest { border-color: rgba(212, 175, 55, .35); }
.huda-ai-chip-clarify {
    border-color: var(--huda-gold);
    font-weight: 700;
    /* v1.5.5 — clarify buttons must FIT the panel: the label is a full
       product name + price, and the old raw-markup label's unbroken
       tokens ("class=\"woocommerce-Price-amount", "amount\"><bdi>4,300<span")
       set a huge min-content width. Flex items default to min-width:
       auto, so the button (flex item of .huda-ai-msgs) AND the msgs
       column (flex item of .huda-ai-body) both refused to shrink below
       it, grew past the 380px panel, and the panel's overflow: hidden
       clipped the text mid-word at the right edge ("…Instant Top-Up
       Ba…", live 12:26–12:32, both modes). Block + full width +
       border-box + normal wrapping keeps the whole name readable on
       two lines; break-word only fires as a last resort for a token
       that has no space in it at all. */
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    white-space: normal;
    text-align: left;
    overflow-wrap: break-word;
}

/* v1.5.3 — type-ahead suggestion strip: ONE horizontal line directly
   above the typing box, scrollable sideways, hidden until the visitor
   types. Chips never wrap (flex 0 0 auto + nowrap); the strip is hidden
   ([hidden] beats the flex display, same as the v1.5.1 root rule). */
.huda-ai-suggest-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    background: var(--huda-panel);
    scrollbar-width: thin;
    flex: 0 0 auto;
}
.huda-ai-suggest-strip .huda-ai-chip { flex: 0 0 auto; white-space: nowrap; }

/* 3D input box: layered gradient, inner depth, gold focus glow. */
.huda-ai-send {
    background: linear-gradient(180deg, var(--huda-panel), var(--huda-input));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 -4px 18px rgba(0, 0, 0, .25);
}
.huda-ai-send input {
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35), inset 0 -1px 0 rgba(255, 255, 255, .06);
}
.huda-ai-send input:focus { box-shadow: inset 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 3px rgba(212, 175, 55, .3); }
.huda-ai-send button[type="submit"] {
    box-shadow: 0 4px 12px rgba(212, 175, 55, .45), inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -3px 6px rgba(0, 0, 0, .18);
}
.huda-ai-send button[type="submit"]:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(212, 175, 55, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }

/* Voice-message recording state + recording bar. */
.huda-ai-send .huda-ai-attach-btn.recording { color: #ef4444; animation: huda-ai-dot-pulse .8s ease-in-out infinite; }
.huda-ai-rec {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(239, 68, 68, .08);
    border-top: 1px solid rgba(239, 68, 68, .35);
    font-size: 13px;
}
.huda-ai-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: huda-ai-dot-pulse .8s ease-in-out infinite; }
.huda-ai-rec button {
    border: 1px solid var(--huda-border);
    background: var(--huda-panel);
    color: var(--huda-text);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 12.5px;
    cursor: pointer;
}
.huda-ai-rec button:first-of-type { background: linear-gradient(135deg, #f6d365, var(--huda-gold)); color: #1a1a22; border: 0; font-weight: 700; }

/* Video + voice messages in the thread. */
.huda-ai-video { max-width: 240px; width: 100%; border-radius: 10px; display: block; background: #000; }
.huda-ai-audio { width: 220px; max-width: 100%; display: block; }

/* Pending-order header notice (v1.5.0). */
.huda-ai-pending-notice {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 14px;
    background: linear-gradient(90deg, rgba(245, 158, 11, .18), rgba(212, 175, 55, .12));
    border-bottom: 1px solid rgba(212, 175, 55, .4);
    font-size: 13px;
    line-height: 1.45;
}
.huda-ai-pending-icon {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(212, 175, 55, .45);
}
.huda-ai-pending-text { display: flex; flex-direction: column; gap: 2px; }
.huda-ai-pending-text span { opacity: .85; }

/* Payment-proof 3D popup form (v1.5.0). */
.huda-ai-proof {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 12px;
    background: rgba(5, 5, 10, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    overflow-y: auto;
}
.huda-ai-proof-card {
    position: relative;
    width: 100%;
    max-width: 320px;
    background: linear-gradient(180deg, #262633, #14141c);
    border: 1px solid rgba(212, 175, 55, .55);
    border-radius: 18px;
    padding: 18px 16px 16px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -6px 14px rgba(0, 0, 0, .4);
    color: var(--huda-text);
    animation: huda-ai-panel-zoom .25s cubic-bezier(.2, .9, .3, 1.2) both;
}
.huda-ai-proof-close {
    position: absolute;
    top: 8px; right: 8px;
    width: 28px; height: 28px;
    border: 0; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: var(--huda-text);
    cursor: pointer;
    font-size: 13px;
}
.huda-ai-proof-title { font-size: 16px; display: block; margin-bottom: 4px; padding-right: 28px; }
.huda-ai-proof-note { font-size: 12.5px; opacity: .8; margin: 0 0 12px; line-height: 1.5; }
.huda-ai-proof-card label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 10px; }
.huda-ai-proof-card label input,
.huda-ai-proof-card label select {
    display: block;
    width: 100%;
    margin-top: 4px;
    border: 1px solid var(--huda-border);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 13.5px;
    background: var(--huda-input);
    color: var(--huda-text);
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .35);
}
.huda-ai-proof-card label input:focus,
.huda-ai-proof-card label select:focus { border-color: var(--huda-gold); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .35), 0 0 0 3px rgba(212, 175, 55, .3); }
#huda-ai-proof-submit {
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 11px;
    font-size: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #f6d365, var(--huda-gold));
    color: #1a1a22;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(212, 175, 55, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
}
#huda-ai-proof-submit:disabled { opacity: .6; cursor: wait; }
.huda-ai-proof-msg { border-left: 3px solid var(--huda-gold); }

@media (max-width: 480px) {
    .huda-ai-video { max-width: 100%; }
    .huda-ai-audio { width: 100%; }
    .huda-ai-rec { flex-wrap: wrap; }
}

/* ---------- Reduced motion: every animation off ---------- */

@media (prefers-reduced-motion: reduce) {
    #huda-ai-chat-root *, #huda-ai-chat-root *::before, #huda-ai-chat-root *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
