/* Meanits — ArtNest's assistant (new theme). Launcher + chat window.
   Palette comes from the shared brand tokens (cream, dusty rose, sage). */

.mx-launcher, .mx-sheet, .mx-panel { --mx-rose: var(--brand-rose, #a85660); --mx-rose-deep: var(--brand-rose-deep, #934a54); --mx-sage: var(--brand-sage, #617a5b); --mx-sage-deep: var(--brand-sage-deep, #4f6449); --mx-cream: var(--brand-cream, #fbf7f1); --mx-sand: var(--brand-sand, #f3ebe0); --mx-blush: var(--brand-blush, #f6e3e0); --mx-blush-soft: var(--brand-blush-soft, #fbf1ef); --mx-ink: var(--brand-ink, #2c2a27); --mx-muted: var(--brand-muted, #6f6a63); --mx-line: var(--brand-line, #ece4d9); }

/* ------------------------------------------------------------ launcher */
.mx-launcher {
    position: fixed; right: 22px; bottom: 22px; z-index: 440;
    display: inline-flex; align-items: center; gap: .65rem;
    padding: .5rem 1.15rem .5rem .5rem;
    border: 1px solid rgba(255, 255, 255, .5); border-radius: 999px; cursor: pointer;
    font-family: var(--brand-sans, "DM Sans", system-ui, sans-serif); text-align: left; color: var(--mx-ink);
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px -8px rgba(44, 42, 39, .28), 0 2px 6px rgba(44, 42, 39, .08);
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.mx-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px rgba(44, 42, 39, .32), 0 2px 6px rgba(44, 42, 39, .08); }
.mx-launcher:focus-visible { outline: 2px solid var(--mx-rose); outline-offset: 3px; }
.mx-launcher.is-hidden { opacity: 0; pointer-events: none; transform: translateY(8px) scale(.96); }
.mx-launcher-orb {
    position: relative; display: grid; place-items: center; flex: none;
    width: 2.6rem; height: 2.6rem; border-radius: 50%; color: #fff;
    background: radial-gradient(circle at 30% 25%, #c98089 0%, var(--mx-rose) 45%, var(--mx-rose-deep) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}
.mx-launcher-orb svg { width: 1.25rem; height: 1.25rem; }
.mx-launcher-orb::after { /* one soft pulse to say hello, then it rests */
    content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--mx-rose); opacity: 0;
    animation: mx-pulse 2.4s ease-out 1.2s 2;
}
.mx-launcher-text { display: grid; line-height: 1.15; }
.mx-launcher-text strong { font-size: .92rem; font-weight: 700; }
.mx-launcher-text small { font-size: .72rem; color: var(--mx-muted); }
@keyframes mx-pulse { 0% { opacity: .55; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }

/* ------------------------------------------------------------ window */
.mx-sheet { position: fixed; inset: 0; z-index: 900; visibility: hidden; pointer-events: none; }
.mx-sheet.is-open { visibility: visible; pointer-events: auto; }
.mx-scrim { position: absolute; inset: 0; background: rgba(44, 42, 39, 0); transition: background .25s ease; }
.mx-sheet.is-open .mx-scrim { background: rgba(44, 42, 39, .16); }

.mx-panel {
    position: absolute; right: 22px; bottom: 22px;
    display: flex; flex-direction: column; overflow: hidden;
    width: min(410px, calc(100vw - 24px)); height: min(700px, calc(100dvh - 44px)); height: min(700px, calc(100vh - 44px));
    border-radius: 24px; background: var(--mx-cream); color: var(--mx-ink);
    font-family: var(--brand-sans, "DM Sans", system-ui, sans-serif);
    border: 1px solid var(--mx-line);
    box-shadow: 0 30px 80px -20px rgba(44, 42, 39, .45), 0 4px 14px rgba(44, 42, 39, .08);
    opacity: 0; transform: translateY(18px) scale(.97); transform-origin: bottom right;
    transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .3, 1);
}
@supports (height: 100dvh) { .mx-panel { height: min(700px, calc(100dvh - 44px)); } }
.mx-sheet.is-open .mx-panel { opacity: 1; transform: none; }

/* header */
.mx-head {
    display: flex; align-items: center; gap: .75rem; flex: none;
    padding: .95rem 1rem .9rem 1.1rem;
    background: linear-gradient(180deg, #fff 0%, var(--mx-blush-soft) 100%);
    border-bottom: 1px solid var(--mx-line);
}
.mx-avatar {
    display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; color: #fff;
    background: radial-gradient(circle at 30% 25%, #c98089 0%, var(--mx-rose) 45%, var(--mx-rose-deep) 100%);
    box-shadow: 0 4px 12px -3px rgba(168, 86, 96, .55);
}
.mx-avatar svg { width: 1.3rem; height: 1.3rem; }
.mx-head-copy { flex: 1; min-width: 0; }
.mx-head-copy h2 { margin: 0; font-family: var(--brand-serif, "Fraunces", Georgia, serif); font-size: 1.28rem; font-weight: 560; letter-spacing: -.01em; line-height: 1.1; }
.mx-head-copy p { margin: .18rem 0 0; font-size: .76rem; color: var(--mx-muted); display: flex; align-items: center; gap: .4rem; }
.mx-live { width: .5rem; height: .5rem; border-radius: 50%; background: #3f9b5f; box-shadow: 0 0 0 3px rgba(63, 155, 95, .18); flex: none; }
.mx-head-tools { display: flex; align-items: center; gap: .2rem; flex: none; }
.mx-tool {
    display: grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--mx-muted); cursor: pointer; transition: background .15s, color .15s;
}
.mx-tool:hover, .mx-tool:focus-visible { background: rgba(44, 42, 39, .07); color: var(--mx-ink); }
.mx-tool svg { width: 1.15rem; height: 1.15rem; }

/* body */
.mx-body {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth;
    padding: 1.1rem 1rem .6rem; display: flex; flex-direction: column; gap: .95rem;
    scrollbar-width: thin; scrollbar-color: rgba(44, 42, 39, .22) transparent;
}

/* welcome */
.mx-welcome { display: grid; gap: .35rem; padding: .35rem .1rem 0; }
.mx-welcome h3 { margin: 0; font-family: var(--brand-serif, "Fraunces", Georgia, serif); font-size: 1.6rem; font-weight: 540; letter-spacing: -.015em; line-height: 1.15; }
.mx-welcome > p { margin: .15rem 0 .8rem; color: var(--mx-muted); font-size: .93rem; line-height: 1.5; }
.mx-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mx-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; text-align: left;
    padding: .8rem .85rem; border: 1px solid var(--mx-line); border-radius: 16px; background: #fff; cursor: pointer;
    font: inherit; color: var(--mx-ink); transition: border-color .15s, box-shadow .15s, transform .15s;
    min-width: 0; width: 100%;
}
.mx-tile:hover, .mx-tile:focus-visible { border-color: rgba(168, 86, 96, .55); box-shadow: 0 6px 18px -8px rgba(168, 86, 96, .45); transform: translateY(-1px); outline: none; }
.mx-tile-ico { display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; border-radius: 10px; color: var(--mx-rose-deep); background: var(--mx-blush); }
.mx-tile-ico svg { width: 1.1rem; height: 1.1rem; }
.mx-tile-text { display: flex; flex-direction: column; gap: .12rem; width: 100%; min-width: 0; }
.mx-tile-text strong { display: block; font-size: .9rem; font-weight: 650; line-height: 1.25; }
.mx-tile-text small { display: block; font-size: .74rem; color: var(--mx-muted); line-height: 1.35; }
.mx-suggest-label { margin: 1rem 0 .1rem; font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8d857b; }
.mx-suggest { display: flex; flex-wrap: wrap; gap: .45rem; }

/* chips and links */
.mx-chip {
    padding: .45rem .8rem; border: 1px solid rgba(168, 86, 96, .4); border-radius: 999px; background: #fff; cursor: pointer;
    font: inherit; font-size: .83rem; font-weight: 550; line-height: 1.25; color: var(--mx-rose-deep); text-align: left;
    transition: background .15s, border-color .15s;
}
.mx-chip:hover, .mx-chip:focus-visible { background: var(--mx-blush-soft); border-color: var(--mx-rose); outline: none; }
.mx-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .55rem; }
.mx-link {
    display: inline-flex; align-items: center; max-width: 100%; padding: .5rem .95rem; border-radius: 18px; text-decoration: none;
    font-size: .84rem; font-weight: 650; line-height: 1.3; color: #fff; background: var(--mx-rose); white-space: normal; overflow-wrap: anywhere;
    transition: background .15s, transform .15s;
}
.mx-link:hover, .mx-link:focus-visible { background: var(--mx-rose-deep); transform: translateY(-1px); outline: none; }
.mx-link.is-wa { background: var(--mx-sage); }
.mx-link.is-wa:hover, .mx-link.is-wa:focus-visible { background: var(--mx-sage-deep); }

/* conversation */
.mx-turn { display: flex; gap: .55rem; align-items: flex-start; max-width: 100%; animation: mx-in .28s ease both; }
.mx-turn.is-user { justify-content: flex-end; }
.mx-turn-main { min-width: 0; display: grid; justify-items: start; max-width: calc(100% - 2.2rem); }
.mx-turn.is-user .mx-turn-main { justify-items: end; max-width: 86%; }
.mx-mini-avatar { display: grid; place-items: center; flex: none; width: 1.7rem; height: 1.7rem; margin-top: .1rem; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #c98089, var(--mx-rose-deep)); }
.mx-mini-avatar svg { width: .9rem; height: .9rem; }
.mx-bubble {
    padding: .7rem .95rem; border-radius: 18px 18px 18px 6px; background: #fff; border: 1px solid var(--mx-line);
    font-size: .94rem; line-height: 1.55; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(44, 42, 39, .04);
}
.mx-turn.is-user .mx-bubble { border-radius: 18px 18px 6px 18px; border-color: transparent; color: #fff; background: linear-gradient(135deg, #b4636e, var(--mx-rose-deep)); box-shadow: 0 6px 16px -8px rgba(147, 74, 84, .6); white-space: normal; }
.mx-bubble a { color: var(--mx-rose-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.mx-bubble strong { font-weight: 650; }
.mx-time { margin: .25rem .15rem 0; font-size: .68rem; color: #9a948c; }
.mx-turn.is-user .mx-time { text-align: right; }
@keyframes mx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* typing + status */
.mx-typing { display: inline-flex; align-items: center; gap: .6rem; padding: .65rem .9rem; }
.mx-typing-dots { display: inline-flex; gap: 4px; }
.mx-typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--mx-rose); opacity: .35; animation: mx-dot 1.2s infinite ease-in-out; }
.mx-typing-dots i:nth-child(2) { animation-delay: .15s; }
.mx-typing-dots i:nth-child(3) { animation-delay: .3s; }
.mx-typing-text { font-size: .82rem; color: var(--mx-muted); }
@keyframes mx-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.mx-status { display: inline-flex; align-items: center; gap: .45rem; color: var(--mx-muted); font-size: .85rem; }
.mx-status-dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--mx-rose); animation: mx-dot 1.2s infinite ease-in-out; }
.mx-cursor { display: inline-block; width: 2px; height: 1em; margin-left: 1px; vertical-align: -.12em; background: var(--mx-rose); animation: mx-blink 1s steps(1) infinite; }
@keyframes mx-blink { 50% { opacity: 0; } }

/* product cards */
.mx-products {
    display: flex; gap: .6rem; margin: .6rem 0 0 -.1rem; padding: .1rem .1rem .45rem; max-width: calc(100vw - 4.6rem); width: 100%;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(44, 42, 39, .2) transparent;
}
.mx-product {
    flex: 0 0 8.6rem; scroll-snap-align: start; display: grid; gap: .15rem; align-content: start; text-decoration: none; color: var(--mx-ink);
    padding: .45rem .45rem .6rem; border: 1px solid var(--mx-line); border-radius: 16px; background: #fff;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.mx-product:hover, .mx-product:focus-visible { border-color: rgba(168, 86, 96, .55); box-shadow: 0 8px 20px -10px rgba(168, 86, 96, .55); transform: translateY(-2px); outline: none; }
.mx-product-img { display: block; position: relative; aspect-ratio: 1; margin-bottom: .35rem; overflow: hidden; border-radius: 11px; background: var(--mx-sand); }
.mx-product-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mx-product-ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--brand-serif, Georgia, serif); font-size: 2rem; color: var(--mx-rose); }
.mx-product-name { padding: 0 .15rem; font-size: .8rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mx-product-price { padding: 0 .15rem; font-size: .8rem; font-weight: 700; color: var(--mx-sage-deep); }
.mx-product-price.is-enquire { color: var(--mx-rose-deep); font-weight: 600; }

/* hand-off note */
.mx-note { margin-top: .6rem; padding: .75rem .9rem; border: 1px dashed rgba(97, 122, 91, .55); border-radius: 14px; background: #f1f5ee; font-size: .85rem; width: 100%; }
.mx-note-label { margin: 0 0 .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mx-sage-deep); }
.mx-note dl { margin: 0; display: grid; gap: .25rem; }
.mx-note dl > div { display: flex; gap: .6rem; }
.mx-note dt { flex: none; width: 3.2rem; color: var(--mx-muted); }
.mx-note dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* composer */
.mx-foot { flex: none; padding: .7rem .9rem calc(.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--mx-line); background: #fff; }
.mx-composer {
    display: flex; align-items: flex-end; gap: .5rem; padding: .35rem .35rem .35rem .95rem;
    border: 1.5px solid var(--mx-line); border-radius: 22px; background: var(--mx-cream);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.mx-composer:focus-within { border-color: var(--mx-rose); background: #fff; box-shadow: 0 0 0 4px rgba(168, 86, 96, .12); }
.mx-composer textarea {
    flex: 1; min-width: 0; max-height: 7.5rem; padding: .5rem 0; resize: none;
    border: 0; border-radius: 0; outline: none; background: transparent; box-shadow: none;
    -webkit-appearance: none; appearance: none;
    font: inherit; font-size: .95rem; line-height: 1.45; color: var(--mx-ink);
}
.mx-composer textarea::placeholder { color: #9a948c; }
.mx-send {
    display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    color: #fff; background: var(--mx-rose); transition: background .15s, transform .15s, opacity .15s;
}
.mx-send svg { width: 1.2rem; height: 1.2rem; }
.mx-send:hover:not(:disabled), .mx-send:focus-visible { background: var(--mx-rose-deep); transform: scale(1.06); outline: none; }
.mx-send:disabled { opacity: .35; cursor: default; }
.mx-foot-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-top: .55rem; }
.mx-foot-row p { margin: 0; font-size: .68rem; line-height: 1.4; color: #9a948c; }
.mx-human {
    display: inline-flex; align-items: center; gap: .35rem; flex: none; padding: .25rem .6rem; border: 0; border-radius: 999px; cursor: pointer;
    font: inherit; font-size: .72rem; font-weight: 650; color: var(--mx-sage-deep); background: #eaf0e6; transition: background .15s;
}
.mx-human:hover, .mx-human:focus-visible { background: #dde7d7; outline: none; }
.mx-human svg { width: .9rem; height: .9rem; }

/* phones: the window becomes a full-height sheet; the launcher clears the bottom bar */
@media (max-width: 640px) {
    .mx-launcher { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: .4rem; }
    .mx-launcher-text { display: none; }
    body.has-buybar .mx-launcher { bottom: calc(92px + env(safe-area-inset-bottom)); }
    .mx-sheet { z-index: 920; }
    .mx-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; transform: translateY(24px); transform-origin: bottom center; }
    .mx-head { padding-top: calc(.95rem + env(safe-area-inset-top)); }
    .mx-welcome h3 { font-size: 1.45rem; }
    .mx-tiles { gap: .5rem; }
    .mx-tile { padding: .75rem .7rem; }
    .mx-tile-text strong { font-size: .82rem; }
    .mx-tile-text small { font-size: .7rem; }
    .mx-foot-row { flex-direction: column; align-items: stretch; }
    .mx-human { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .mx-launcher, .mx-panel, .mx-scrim, .mx-turn { transition: none; animation: none; }
    .mx-launcher-orb::after, .mx-typing-dots i, .mx-status-dot, .mx-cursor { animation: none; }
}

/* The composer draws the focus ring; the textarea must never show its own border/outline/ring. */
body.v2 .mx-composer textarea,
body.v2 .mx-composer textarea:focus,
body.v2 .mx-composer textarea:focus-visible,
.atelier .mx-composer textarea,
.atelier .mx-composer textarea:focus,
.atelier .mx-composer textarea:focus-visible {
    outline: none; box-shadow: none; border: 0; border-radius: 0; border-color: transparent; background: transparent;
}

/* ------------------------------------------------------- product page: "Ask Meanits about this product" */
.mx-ask {
    --mx-rose: var(--brand-rose, #a85660); --mx-rose-deep: var(--brand-rose-deep, #934a54); --mx-ink: var(--brand-ink, #2c2a27); --mx-muted: var(--brand-muted, #6f6a63); --mx-line: var(--brand-line, #ece4d9);
    margin: 1.25rem 0; padding: 1.1rem 1.15rem 1.15rem; border: 1px solid var(--mx-line); border-radius: 18px;
    background: linear-gradient(180deg, var(--brand-blush-soft, #fbf1ef) 0%, #fff 70%);
    font-family: var(--brand-sans, "DM Sans", system-ui, sans-serif);
}
.mx-ask-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .85rem; }
.mx-ask-orb {
    display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: #fff;
    background: radial-gradient(circle at 30% 25%, #c98089 0%, var(--mx-rose) 45%, var(--mx-rose-deep) 100%);
    box-shadow: 0 4px 12px -3px rgba(168, 86, 96, .5);
}
.mx-ask-orb svg { width: 1.2rem; height: 1.2rem; }
.mx-ask-head h2 { margin: 0; font-family: var(--brand-serif, "Fraunces", Georgia, serif); font-size: 1.15rem; font-weight: 560; letter-spacing: -.01em; line-height: 1.2; color: var(--mx-ink); }
.mx-ask-head p { margin: .15rem 0 0; font-size: .82rem; color: var(--mx-muted); }
.mx-ask-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .85rem; }
.mx-ask-chip {
    padding: .5rem .85rem; border: 1px solid rgba(168, 86, 96, .38); border-radius: 999px; background: #fff; cursor: pointer;
    font: inherit; font-size: .85rem; font-weight: 550; line-height: 1.25; color: var(--mx-rose-deep); text-align: left;
    transition: background .15s, border-color .15s, transform .15s;
}
.mx-ask-chip:hover, .mx-ask-chip:focus-visible { background: var(--brand-blush-soft, #fbf1ef); border-color: var(--mx-rose); transform: translateY(-1px); outline: none; }
.mx-ask-form {
    display: flex; align-items: center; gap: .5rem; padding: .3rem .3rem .3rem 1rem;
    border: 1.5px solid var(--mx-line); border-radius: 999px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.mx-ask-form:focus-within { border-color: var(--mx-rose); box-shadow: 0 0 0 4px rgba(168, 86, 96, .12); }
body.v2 .mx-ask-form input, body.v2 .mx-ask-form input:focus, body.v2 .mx-ask-form input:focus-visible {
    flex: 1; min-width: 0; height: 2.4rem; padding: 0; border: 0; border-radius: 0; outline: none; box-shadow: none; background: transparent;
    font: inherit; font-size: .93rem; color: var(--mx-ink);
}
.mx-ask-form input::placeholder { color: #9a948c; }
.mx-ask-form button {
    display: grid; place-items: center; flex: none; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
    color: #fff; background: var(--mx-rose); transition: background .15s, opacity .15s;
}
.mx-ask-form button svg { width: 1.15rem; height: 1.15rem; }
.mx-ask-form button:hover:not(:disabled), .mx-ask-form button:focus-visible { background: var(--mx-rose-deep); }
.mx-ask-form button:disabled { opacity: .35; cursor: default; }
@media (max-width: 640px) { .mx-ask { margin: 1rem 0; padding: 1rem; } .mx-ask-chip { font-size: .83rem; } }

/* Calmer, less "AI" feel: a single quiet three-dot wait, replies simply fade in. */
.mx-typing { padding: .8rem 1rem; }
.mx-typing-dots i { opacity: .4; }
.mx-launcher-orb svg, .mx-avatar svg, .mx-ask-orb svg { width: 1.45rem; height: 1.45rem; }
.mx-mini-avatar svg { width: 1rem; height: 1rem; }
