/* =====================================================================
   EK Chatbot v6 -- minimal, premium, single-color, mobile-first
   NO gradients . NO saturated colors . NO heavy shadows
   ===================================================================== */

/* -- Root variables (light mode) ------------------------------------- */
:root {
    --e6bg:   #fdfcfa;
    --e6bgs:  #f7f4ef;
    --e6bgm:  #f1ede5;
    --e6bdr:  #e7e1d8;
    --e6bdrs: #d8d0c3;
    --e6tx:   #1a1714;
    --e6txs:  #6b6259;
    --e6txm:  #9a9087;
    --e6pri:  #1a1714;
    --e6pric: #f7f4ef;
    --e6ubb:  #1a1714;
    --e6ubt:  #f7f4ef;
    --e6abb:  #f1ede5;
    --e6abt:  #1a1714;
    --e6sh:   0 1px 3px rgba(0,0,0,.07);
    --e6shl:  0 4px 16px rgba(0,0,0,.11);
    --e6r:    12px;
    --e6rs:   8px;
    --e6tr:   180ms ease;
    --e6ff:   -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --e6-panel-bottom: 96px;
    --e6-panel-gap: 20px;
}
html[data-e6t="dark"],
:root[data-e6t="dark"] {
    --e6bg:   #1a1714; --e6bgs:  #221e19; --e6bgm:  #2a251f;
    --e6bdr:  #36302a; --e6bdrs: #463f36;
    --e6tx:   #f7f4ef; --e6txs:  #cfc8bd; --e6txm:  #8d857a;
    --e6pri:  #f7f4ef; --e6pric: #1a1714;
    --e6ubb:  #f7f4ef; --e6ubt:  #1a1714;
    --e6abb:  #2a251f; --e6abt:  #f7f4ef;
    --e6sh:   0 1px 3px rgba(0,0,0,.32);
    --e6shl:  0 4px 16px rgba(0,0,0,.48);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-e6t="light"]) {
        --e6bg:   #1a1714; --e6bgs:  #221e19; --e6bgm:  #2a251f;
        --e6bdr:  #36302a; --e6bdrs: #463f36;
        --e6tx:   #f7f4ef; --e6txs:  #cfc8bd; --e6txm:  #8d857a;
        --e6pri:  #f7f4ef; --e6pric: #1a1714;
        --e6ubb:  #f7f4ef; --e6ubt:  #1a1714;
        --e6abb:  #2a251f; --e6abt:  #f7f4ef;
        --e6sh:   0 1px 3px rgba(0,0,0,.32);
        --e6shl:  0 4px 16px rgba(0,0,0,.48);
    }
}

/* -- Launcher -------------------------------------------------------- */
#ekss-v6-launcher {
    position: fixed !important;
    right: 0 !important; bottom: 24px;
    z-index: var(--e6z);
    width: 64px; height: 64px;
    margin: 0 !important; /* override Flatsome/theme global button margin */
    padding: 0 !important;
    border-radius: 50%;
    background: var(--e6mobbg);
    color: #ffffff;
    border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: var(--e6shl);
    transition: transform var(--e6tr), box-shadow var(--e6tr);
    font-family: var(--e6ff);
    line-height: 1;
    box-sizing: border-box;
    overflow: visible; /* Ecomus button{overflow:hidden} clips the ::after tooltip */
}
/* Mobile only: float circle with 20px gap from edges */
@media (max-width: 768px) {
    #ekss-v6-launcher { right: 20px !important; }
}
#ekss-v6-launcher:hover { transform: scale(1.04); }
#ekss-v6-launcher:active { transform: scale(0.97); }
#ekss-v6-launcher:focus-visible { outline: 2px solid var(--e6pri); outline-offset: 3px; }
#ekss-v6-launcher .ekss-v6-lbl {
    display: none; font-size: 11px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
}
#ekss-v6-launcher .ekss-v6-badge {
    position: absolute; top: 3px; right: 3px;
    min-width: 18px; height: 18px; border-radius: 9px;
    background: #9c8a6e; color: #fff; font-size: 11px; font-weight: 700;
    display: none; align-items: center; justify-content: center; padding: 0 4px;
}
#ekss-v6-launcher .ekss-v6-badge:not(:empty) { display: inline-flex; }

/* Desktop: side tab */
@media (min-width: 769px) {
    #ekss-v6-launcher {
        right: 0 !important; bottom: auto !important; top: 72% !important;
        width: auto !important; height: 90px;
        border-radius: 10px 0 0 10px;
        flex-direction: column; gap: 7px;
        padding: 14px 8px !important;
        margin: 0 !important;
        background: var(--e6deskbg);
        box-shadow: -3px 0 12px rgba(0,0,0,.13);
        transform: translateY(-50%);
    }
    #ekss-v6-launcher:hover { transform: translateY(-50%) translateX(-3px); }
    #ekss-v6-launcher .ekss-v6-lbl {
        display: block;
        writing-mode: vertical-rl; text-orientation: mixed;
        font-size: 10px; letter-spacing: .08em;
    }
    #ekss-v6-launcher .ekss-v6-lico { width: 20px; height: 20px; }
}

/* Bounce animation (first idle) */
#ekss-v6-launcher.e6-bounce { animation: e6bounce 1.1s ease-in-out 2; }
@keyframes e6bounce {
    0%,100% { transform: translateY(0); }
    45%     { transform: translateY(-9px); }
}
@media (min-width: 769px) {
    #ekss-v6-launcher.e6-bounce { animation: none; }
}

/* Tooltip via pseudo-element */
#ekss-v6-launcher::after {
    content: attr(data-tip);
    position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    /* Neutralize Ecomus button::after "shine" (left:150%; width:200%; bottom:0)
       which over-constrains the box and pushes the tooltip off-screen */
    left: auto; bottom: auto; width: auto; height: auto;
    background: var(--e6pri); color: var(--e6pric);
    font-size: 12px; font-family: var(--e6ff);
    padding: 6px 12px; border-radius: var(--e6rs);
    white-space: nowrap; pointer-events: none;
    opacity: 0; transition: opacity var(--e6tr);
}
#ekss-v6-launcher[data-tip]::after { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    #ekss-v6-launcher.e6-bounce { animation: none; }
    #ekss-v6-launcher, #ekss-v6-launcher:hover { transition: none; transform: none; }
    @media (min-width: 769px) { #ekss-v6-launcher { transform: translateY(-50%); } }
}

/* Mobile: EK's bottom navigation opens Chat. Other storefronts keep the
   floating launcher so the fullscreen panel remains reachable. */
@media (max-width: 768px) {
    #ekss-v6-launcher[data-mnav="1"] { display: none !important; }
    #ekss-v6-launcher[data-mnav="0"] {
        display: flex !important;
        right: 16px !important;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 56px;
        height: 56px;
        box-shadow: 0 4px 16px rgba(0,0,0,.2);
    }
}

/* -- Panel ----------------------------------------------------------- */
#ekss-v6-panel {
    position: fixed; z-index: var(--e6z1);
    right: var(--e6-panel-gap); bottom: var(--e6-panel-bottom);
    width: min(400px, calc(100vw - 40px));
    height: min(660px, calc(100vh - var(--e6-panel-bottom) - var(--e6-panel-gap)));
    max-height: calc(100dvh - var(--e6-panel-bottom) - var(--e6-panel-gap));
    display: flex; flex-direction: column;
    background: var(--e6bg); color: var(--e6tx);
    border: 1px solid var(--e6bdr);
    border-radius: var(--e6r);
    box-shadow: var(--e6shl);
    font-family: var(--e6ff);
    opacity: 0; transform: translateY(10px) scale(.98);
    pointer-events: none;
    transition: opacity var(--e6tr), transform var(--e6tr);
    overflow: hidden;
}
#ekss-v6-panel.e6-open {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
/* Mobile fullscreen bottom-sheet */
@media (max-width: 768px) {
    #ekss-v6-panel {
        left: 0; right: 0; bottom: 0; top: 0;
        width: 100%; height: 100vh; height: 100dvh;
        max-width: 100%; max-height: none;
        border-radius: 0; border: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transform: translateY(100%);
    }
    #ekss-v6-panel.e6-open { transform: translateY(0); }
    body.e6-locked { overflow: hidden; touch-action: none; }
    /* Theme mobile bars are separate fixed stacking contexts. Hide them while the
       fullscreen chat is open so they cannot cover/intercept the composer. */
    body.e6-locked .fmt-mobile-nav,
    body.e6-locked .ecomus-mobile-navigation-bar { display: none !important; }
}

/* Mobile drag handle */
.ekss-v6-handle {
    display: none;
    width: 36px; height: 4px;
    background: var(--e6bdrs); border-radius: 2px;
    margin: 10px auto 0; flex-shrink: 0;
}
@media (max-width: 768px) { .ekss-v6-handle { display: block; } }

/* -- Header ---------------------------------------------------------- */
.ekss-v6-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--e6bdr);
    flex-shrink: 0; background: var(--e6bg);
}
/* Theme-proof: some themes (e.g. Flatsome) apply heading font-size/family to
   any h2 with higher specificity/!important, blowing up the widget title
   (SMZ rendered "AI Help" at 64px Cormorant). Pin the widget's own style. */
.ekss-v6-title-block h2,
#ekss-v6-title {
    margin: 0 !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: .02em !important;
    text-transform: none !important;
    color: var(--e6tx) !important;
}
.ekss-v6-subtitle {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--e6txs); margin-top: 2px;
}
.ekss-v6-sdot { width: 7px; height: 7px; border-radius: 50%; background: #9c8a6e; flex-shrink: 0; }
.ekss-v6-hactions { display: flex; gap: 2px; }
.ekss-v6-ibtn {
    width: 32px; height: 32px; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: var(--e6rs);
    color: var(--e6txs); cursor: pointer;
    transition: background var(--e6tr), color var(--e6tr);
}
.ekss-v6-ibtn:hover { background: var(--e6bgm); color: var(--e6tx); }
.ekss-v6-ibtn:focus-visible { outline: 2px solid var(--e6pri); outline-offset: 2px; }

/* -- Body (scroll area) ---------------------------------------------- */
#ekss-v6-body {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 18px 18px; scroll-behavior: smooth;
}
#ekss-v6-body::-webkit-scrollbar { width: 5px; }
#ekss-v6-body::-webkit-scrollbar-thumb { background: var(--e6bdrs); border-radius: 3px; }

/* -- Messages -------------------------------------------------------- */
#ekss-v6-messages { display: flex; flex-direction: column; }
.e6msg {
    display: flex; flex-direction: column;
    max-width: 88%; margin-bottom: 18px;
    animation: e6fadein .22s ease;
}
/* User: compact soft pill on the right (ChatGPT/Claude pattern). */
.e6msg.user { align-self: flex-end; margin-left: auto; max-width: 84%; align-items: flex-end; }
/* AI: borderless, full-width editorial text — the defining premium-chat trait. */
.e6msg.ai   { align-self: stretch; margin-right: 0; max-width: 100%; }
.e6msg.staff{ align-self: stretch; margin-right: 0; max-width: 100%; }
.e6bbl {
    padding: 0;
    font-size: 15px; line-height: 1.65;
    word-break: break-word; white-space: pre-wrap;
}
.e6msg.user .e6bbl {
    background: var(--e6bgm); color: var(--e6tx);
    border: 1px solid var(--e6bdr);
    padding: 10px 15px; border-radius: 18px; border-bottom-right-radius: 6px;
}
.e6msg.ai   .e6bbl { background: transparent; color: var(--e6tx); }
.e6msg.staff .e6bbl { background: var(--e6bgs); color: var(--e6tx); border:1px solid var(--e6bdrs); padding:10px 12px; border-radius:var(--e6rs); }
.e6msg.staff .e6bbl::before { content:'Customer Care'; display:block; margin-bottom:5px; color:var(--e6txs); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.e6ts { font-size: 10px; color: var(--e6txm); margin-top: 5px; }
.e6msg.user .e6ts { text-align: right; }
@keyframes e6fadein { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }

/* -- Typing indicator ----------------------------------------------- */
.e6typing {
    display: inline-flex; gap: 4px;
    padding: 11px 13px;
    background: var(--e6abb); border-radius: var(--e6r); border-bottom-left-radius: 3px;
}
.e6td {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--e6txm); animation: e6type 1.2s infinite;
}
.e6td:nth-child(2) { animation-delay: .15s; }
.e6td:nth-child(3) { animation-delay: .3s; }
@keyframes e6type {
    0%,60%,100% { transform:translateY(0); opacity:.35; }
    30%         { transform:translateY(-5px); opacity:1; }
}

/* -- Citations ------------------------------------------------------- */
.e6cite {
    display: inline-block; min-width: 17px; height: 17px;
    padding: 0 4px; margin-left: 3px;
    font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
    background: var(--e6bgm); color: var(--e6tx);
    border-radius: 4px; cursor: pointer; vertical-align: super;
    text-decoration: none;
    transition: background var(--e6tr), color var(--e6tr);
}
.e6cite:hover { background: var(--e6pri); color: var(--e6pric); }

/* -- Product cards v2 ------------------------------------------------ */
.e6products {
    display: grid; gap: 10px; margin-top: 12px;
    grid-template-columns: 1fr;
}
/* Horizontal compact card (Intercom / Shopify-assistant pattern): thumbnail +
   info + CTA, so several products stack cleanly and fill the panel width. */
.e6pcard {
    display: flex; flex-direction: row; align-items: stretch;
    min-height: 112px;
    background: var(--e6bg); border: 1px solid var(--e6bdr);
    border-radius: 14px; overflow: hidden;
    cursor: pointer; text-decoration: none; color: inherit;
    transition: transform var(--e6tr), box-shadow var(--e6tr), border-color var(--e6tr);
}
.e6pcard:hover { transform: translateY(-2px); box-shadow: var(--e6shl); border-color: var(--e6bdrs); }
.e6pcard:active { transform: translateY(0); }
.e6pimg {
    width: 106px; align-self: stretch; flex-shrink: 0;
    background: var(--e6bgm) center/cover no-repeat;
}
.e6pinfo { flex: 1; min-width: 0; padding: 11px 13px; display: flex; flex-direction: column; }
.e6pbadge {
    align-self: flex-start;
    display: inline-flex; align-items: center;
    font-size: 9.5px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px;
    background: transparent; color: var(--e6txs);
    border: 1px solid var(--e6bdr);
    letter-spacing: .05em; text-transform: uppercase; margin-bottom: 6px;
}
.e6ptitle {
    font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--e6tx);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.e6pmeta { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.e6pprice { font-size: 15px; font-weight: 700; color: var(--e6tx); font-variant-numeric: tabular-nums; }
.e6prating { font-size: 11px; color: var(--e6txs); }
.e6pactions { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; }
.e6pbtn {
    flex: 1; padding: 7px 10px; font-size: 11.5px; font-weight: 700;
    border: 1px solid var(--e6bdrs); background: var(--e6bg); color: var(--e6tx);
    border-radius: 9px; cursor: pointer; font-family: var(--e6ff);
    transition: background var(--e6tr), color var(--e6tr), border-color var(--e6tr), transform var(--e6tr);
}
.e6pbtn.pri { background: var(--e6pri); color: var(--e6pric); border-color: var(--e6pri); }
.e6pbtn:hover:not(.pri) { background: var(--e6bgm); border-color: var(--e6bdr); }
.e6pbtn.pri:hover { opacity: .88; }
.e6pbtn:active { transform: scale(.97); }
/* Mobile: comfortable touch targets so taps don't miss (esp. card View/Add to cart) */
@media (max-width: 768px) {
    .e6pbtn { padding: 10px 8px; font-size: 13px; min-height: 42px; }
    .e6qbtn, .e6chip { font-size: 13px; padding: 9px 14px; min-height: 38px; }
}

/* -- Follow-up chips ------------------------------------------------- */
.e6followups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.e6chip {
    font-size: 11px; padding: 6px 12px;
    background: var(--e6bg); border: 1px solid var(--e6bdrs);
    color: var(--e6tx); border-radius: 999px; cursor: pointer; font-family: var(--e6ff);
    transition: background var(--e6tr), color var(--e6tr), border-color var(--e6tr);
}
.e6chip:hover { background: var(--e6pri); color: var(--e6pric); border-color: var(--e6pri); }

/* -- Optional photo consultation ------------------------------------ */
.e6photo-card {
    margin-top: 8px; padding: 12px; background: var(--e6bgs);
    border: 1px solid var(--e6bdr); border-radius: var(--e6r);
}
.e6photo-title { font-size: 13px; font-weight: 700; color: var(--e6tx); line-height: 1.4; }
.e6photo-copy { margin-top: 6px; font-size: 12px; line-height: 1.55; color: var(--e6txs); }
.e6photo-tips { margin: 8px 0 0; padding-left: 18px; font-size: 11px; line-height: 1.55; color: var(--e6txs); }
.e6photo-preview {
    display: block; width: 100%; max-height: 240px; margin-top: 10px;
    object-fit: contain; background: var(--e6bgm); border: 1px solid var(--e6bdr);
    border-radius: var(--e6rs);
}
.e6photo-privacy { margin-top: 8px; font-size: 10px; line-height: 1.45; color: var(--e6txm); }
@media (max-width: 768px) {
    .e6photo-card { padding: 14px; }
    .e6photo-copy { font-size: 13px; }
    .e6photo-tips { font-size: 12px; }
    .e6photo-preview { max-height: 280px; }
}

/* -- Coupon card (editorial, no gradients/neon) ---------------------- */
.e6coupon {
    margin-top: 10px; padding: 14px 16px;
    background: var(--e6bgs); border: 1px solid var(--e6bdr);
    border-radius: var(--e6r); text-align: center;
    position: relative; overflow: hidden;
}
.e6coupon::before, .e6coupon::after {
    content: ''; position: absolute; top: 50%; width: 14px; height: 14px;
    background: var(--e6bg); border: 1px solid var(--e6bdr);
    border-radius: 50%; transform: translateY(-50%);
}
.e6coupon::before { left: -8px; }
.e6coupon::after  { right: -8px; }
.e6coupon-vip { border-color: var(--e6acc, #9c8a6e); }
.e6coupon-head { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--e6txs); }
.e6coupon-code {
    margin: 8px 0 2px; font-size: 17px; font-weight: 700; letter-spacing: .12em;
    color: var(--e6tx); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.e6coupon-disc { font-size: 13px; font-weight: 700; color: #9c8a6e; letter-spacing: .04em; }
.e6coupon-meta { margin-top: 6px; font-size: 10px; color: var(--e6txm); line-height: 1.5; }
.e6coupon-copy {
    margin-top: 10px; width: 100%; padding: 8px 12px; font-size: 12px; font-weight: 600;
    background: var(--e6pri); color: var(--e6pric); border: 0; border-radius: var(--e6rs);
    cursor: pointer; font-family: var(--e6ff); transition: opacity var(--e6tr);
}
.e6coupon-copy:hover { opacity: .9; }

/* -- Quick replies (context-aware) ----------------------------------- */
#ekss-v6-qr {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 14px 6px; border-top: 1px solid var(--e6bdr); flex-shrink: 0;
}
#ekss-v6-qr:empty { display: none; }
.e6qbtn {
    font-size: 12px; padding: 6px 12px;
    background: var(--e6bg); border: 1px solid var(--e6bdrs);
    color: var(--e6tx); border-radius: 999px; cursor: pointer; font-family: var(--e6ff);
    transition: background var(--e6tr);
}
.e6qbtn:hover { background: var(--e6bgm); }

/* -- Input area ------------------------------------------------------ */
#ekss-v6-form {
    display: flex; align-items: center; gap: 3px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--e6bdr);
    background: var(--e6bg); flex-shrink: 0;
}
.ekss-v6-fbtn {
    width: 36px; height: 36px; padding: 0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: 0; border-radius: var(--e6rs);
    color: var(--e6txs); cursor: pointer;
    transition: background var(--e6tr), color var(--e6tr);
}
.ekss-v6-fbtn:hover { background: var(--e6bgm); color: var(--e6tx); }
.ekss-v6-fbtn:disabled { opacity: .3; cursor: not-allowed; }
.ekss-v6-fbtn.recording {
    background: #a8553a; color: #fff;
    animation: e6pulse 1.4s infinite;
}
@keyframes e6pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(168,85,58,.40); }
    50%     { box-shadow: 0 0 0 7px rgba(168,85,58,0); }
}
#ekss-v6-input {
    flex: 1; padding: 11px 16px; font-size: 15px; font-family: var(--e6ff);
    border: 1px solid var(--e6bdrs); border-radius: 22px;
    background: var(--e6bg); color: var(--e6tx);
    outline: none; min-width: 0;
    -webkit-appearance: none; appearance: none;
    transition: border-color var(--e6tr), box-shadow var(--e6tr);
}
@media (max-width: 768px) {
    #ekss-v6-form { padding-left: 10px; padding-right: 10px; }
    #ekss-v6-input { font-size: 16px; min-height: 42px; }
}
#ekss-v6-input:focus { border-color: var(--e6pri); box-shadow: 0 0 0 3px rgba(26,23,20,.06); }
#ekss-v6-input::placeholder { color: var(--e6txm); }
.ekss-v6-sendbtn {
    width: 40px; height: 40px; padding: 0; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--e6pri); color: var(--e6pric);
    border: 0; border-radius: 50%; cursor: pointer;
    transition: opacity var(--e6tr);
}
.ekss-v6-sendbtn:hover { opacity: .82; }
.ekss-v6-sendbtn:disabled { opacity: .3; cursor: not-allowed; }

/* -- Floating hints -------------------------------------------------- *
 * Desktop: launcher is a side-tab at right:0; top:72% (translateY(-50%)).
 * Position the hint balloon to its LEFT at the same vertical anchor.
 * Mobile: launcher is hidden; hint sits above the theme's bottom nav.
 */
#ekss-v6-hints {
    position: fixed;
    right: 52px;            /* just left of side-tab (~36px tab + 16px gap) */
    top: 72%;               /* match launcher vertical anchor */
    transform: translateY(-50%);
    bottom: auto;
    z-index: var(--e6zm1);
    max-width: 260px;
    display: flex; flex-direction: column; gap: 7px;
    pointer-events: none;
}
@media (max-width: 768px) {
    #ekss-v6-hints {
        right: 16px;
        bottom: 88px;       /* above mobile bottom-nav (Ecomus / Flatsome ~70-80px) */
        top: auto;
        transform: none;
        max-width: calc(100vw - 32px);
    }
}
/* Speech-bubble tail pointing toward launcher (desktop only) */
@media (min-width: 769px) {
    .e6hint::after {
        content: '';
        position: absolute; right: -7px; top: 50%; transform: translateY(-50%);
        width: 0; height: 0;
        border-left: 7px solid var(--e6pri);
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
    }
}
.e6hint {
    position: relative;     /* anchor for ::after tail */
    background: var(--e6pri); color: var(--e6pric);
    padding: 10px 14px; border-radius: var(--e6r);
    font-size: 12px; line-height: 1.45; font-family: var(--e6ff);
    box-shadow: var(--e6shl);
    opacity: 0; transform: translateY(8px);
    transition: opacity var(--e6tr), transform var(--e6tr);
    cursor: pointer; pointer-events: auto;
}
.e6hint.show { opacity: 1; transform: translateY(0); }
.e6hint-x { float: right; margin-left: 8px; opacity: .65; font-size: 15px; line-height: 1; cursor: pointer; }

/* -- Conversational form --------------------------------------------- */
.e6cform {
    background: var(--e6bgs); border: 1px solid var(--e6bdr);
    border-radius: var(--e6r); padding: 14px; margin-top: 8px;
}
.e6cform-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--e6tx); }
.e6cform-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.e6cform-prog { display: flex; gap: 5px; margin-bottom: 10px; }
.e6pdot { width: 6px; height: 6px; border-radius: 50%; background: var(--e6bdrs); }
.e6pdot.done { background: var(--e6pri); }

/* -- Toast ----------------------------------------------------------- */
#ekss-v6-toast {
    position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
    background: var(--e6pri); color: var(--e6pric);
    padding: 9px 16px; border-radius: var(--e6rs);
    font-size: 12px; font-family: var(--e6ff);
    z-index: var(--e6z10);
    opacity: 0; pointer-events: none;
    transition: opacity var(--e6tr);
    white-space: nowrap;
}
#ekss-v6-toast.show { opacity: 1; }

/* -- Product context pin (Fix 3) ----------------------------------------- */
.e6ctxpin {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-bottom: 12px;
    background: var(--e6bgs); border: 1px solid var(--e6bdr);
    border-left: 3px solid var(--e6pri);
    border-radius: var(--e6rs);
    font-size: 12px; color: var(--e6txs);
    flex-wrap: wrap;
}
.e6ctxpin-ask {
    margin-left: auto; padding: 4px 10px;
    font-size: 11px; font-weight: 600;
    background: var(--e6pri); color: var(--e6pric);
    border: 0; border-radius: 999px; cursor: pointer;
    flex-shrink: 0; font-family: var(--e6ff);
    transition: opacity var(--e6tr);
}
.e6ctxpin-ask:hover { opacity: 0.85; }

/* -- Product page AI question CTA ------------------------------------ */
.ekss-product-ai-cta { clear: both; margin: 10px 0 14px; }
.ekss-product-ai-cta__button {
    width: auto;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid #d8d0c3;
    border-radius: 8px;
    background: #f7f4ef;
    color: #1a1714;
    text-align: center;
    cursor: pointer;
    font-family: var(--e6ff);
    text-transform: none !important;
    box-shadow: none;
    transition: background var(--e6tr), border-color var(--e6tr), color var(--e6tr);
}
.ekss-product-ai-cta__button * { text-transform: none !important; }
.ekss-product-ai-cta__button:hover,
.ekss-product-ai-cta__button:focus-visible {
    border-color: #9c8a6e;
    background: #fff;
    color: #1a1714;
    outline: none;
}
.ekss-product-ai-cta__button:focus-visible {
    box-shadow: 0 0 0 3px rgba(156, 138, 110, .16);
}
.ekss-product-ai-cta__icon {
    width: 21px;
    height: 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 21px;
    border: 1px solid #e7e1d8;
    border-radius: 6px;
    background: #fff;
    color: #1a1714;
}
.ekss-product-ai-cta__text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.ekss-product-ai-cta__label {
    font-size: 13px;
    line-height: 1.15;
    font-weight: 650;
    letter-spacing: 0;
}
.ekss-product-ai-cta__hint {
    display: none;
    font-size: 11px;
    line-height: 1.2;
    color: #3a332b;
    letter-spacing: 0;
}
@media (max-width: 480px) {
    .ekss-product-ai-cta__button {
        min-height: 36px;
        padding: 7px 13px;
    }
}

/* -- Markdown rendering (Fix 1 v6 polish2) -------------------------------- */
.e6bbl pre {
    background: var(--e6bgs); border: 1px solid var(--e6bdr);
    border-radius: 6px; padding: 8px 10px; margin: 6px 0;
    font-family: ui-monospace, Menlo, monospace; font-size: 12px;
    overflow-x: auto;
}
.e6bbl code {
    background: var(--e6bgs); padding: 1px 5px; border-radius: 3px;
    font-family: ui-monospace, Menlo, monospace; font-size: 12px;
}
.e6bbl pre code { background: transparent; padding: 0; font-size: inherit; }
.e6bbl .e6mdh {
    margin: 8px 0 4px 0; font-weight: 700;
    font-size: 13px; color: var(--e6tx);
}
.e6bbl .e6mdli { display: block; padding-left: 4px; }
.e6bbl strong { font-weight: 700; }
.e6bbl em { font-style: italic; }
.e6bbl a {
    color: var(--e6pri); text-decoration: underline;
    text-underline-offset: 2px; text-decoration-thickness: 1px;
}
.e6bbl a:hover { text-decoration-thickness: 2px; }

/* -- Per-message Copy + Regenerate actions (Fix 2 v6 polish2) ------------- */
.ekss-v6-msg-actions {
    display: flex; gap: 4px; margin-top: 6px;
    opacity: 0; transition: opacity var(--e6tr);
}
.e6msg.ai:hover .ekss-v6-msg-actions,
.e6msg.ai:focus-within .ekss-v6-msg-actions { opacity: 0.7; }
.ekss-v6-msg-actions:hover { opacity: 1 !important; }
.ekss-v6-msg-act-btn {
    width: 26px; height: 26px; padding: 0; margin: 0 !important;
    background: transparent; border: 1px solid var(--e6bdr);
    border-radius: 6px; color: var(--e6txs); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background var(--e6tr), color var(--e6tr);
}
.ekss-v6-msg-act-btn:hover { background: var(--e6bgs); color: var(--e6tx); }
.ekss-v6-msg-act-btn.done { background: #9c8a6e; color: #fff; border-color: #9c8a6e; }
@media (max-width: 768px) {
    .ekss-v6-msg-actions { opacity: 0.6; } /* always visible on mobile (no hover) */
}

/* -- UX enhance (merged from class-chatbot-ux-enhance.php) -- */
        .ekss-msg.ai .ekss-msg-bubble { position: relative; }
        .ekss-msg-actions {
            display: inline-flex;
            gap: 4px;
            margin-top: 8px;
            opacity: 0;
            transition: opacity 0.15s ease;
        }
        .ekss-msg.ai .ekss-msg-bubble:hover .ekss-msg-actions,
        .ekss-msg-actions.ekss-action-active { opacity: 1; }
        .ekss-msg-action-btn {
            background: transparent;
            border: 1px solid #ddd;
            border-radius: 14px;
            padding: 4px 10px;
            cursor: pointer;
            color: #666;
            font-size: 12px;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            transition: all 0.15s ease;
            font-family: inherit;
        }
        .ekss-msg-action-btn:hover {
            border-color: #999;
            color: #333;
            background: #fafafa;
        }
        .ekss-msg-action-btn.ekss-active-up {
            background: #f0f8f4;
            border-color: #4a7c6a;
            color: #2E4A3E;
        }
        .ekss-msg-action-btn.ekss-active-down {
            background: #fdf3f3;
            border-color: #c66;
            color: #933;
        }
        .ekss-msg-action-btn svg { width: 12px; height: 12px; }
        .ekss-msg-action-comment { display: none; margin-top: 6px; }
        .ekss-msg-action-comment.ekss-comment-open { display: block; }
        .ekss-msg-action-comment textarea {
            width: 100%;
            min-height: 50px;
            padding: 6px 8px;
            font-size: 12px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-family: inherit;
            resize: vertical;
            box-sizing: border-box;
        }
        .ekss-msg-action-comment .ekss-comment-submit {
            margin-top: 4px;
            padding: 4px 12px;
            background: #333;
            color: #fff;
            border: none;
            border-radius: 4px;
            font-size: 12px;
            cursor: pointer;
        }
        /* Image upload */
        .ekss-img-btn {
            background: transparent;
            border: 1px solid #ddd;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            cursor: pointer;
            color: #666;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-right: 6px;
            transition: all 0.15s ease;
        }
        .ekss-img-btn:hover {
            border-color: #333;
            color: #333;
            background: #fafafa;
        }
        .ekss-img-btn svg {
            width: 18px;
            height: 18px;
        }
        .ekss-img-preview {
            display: none;
            position: relative;
            width: 100%;
            padding: 8px;
            background: #fafafa;
            border: 1px solid #eee;
            border-radius: 6px;
            margin-bottom: 8px;
            box-sizing: border-box;
        }
        .ekss-img-preview img {
            max-width: 100px;
            max-height: 80px;
            border-radius: 4px;
            display: block;
        }
        .ekss-img-clear {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: rgba(0,0,0,0.6);
            color: #fff;
            border: none;
            cursor: pointer;
            font-size: 14px;
            line-height: 1;
            padding: 0;
        }
