/* RMA storefront chat. Shared CSS/LESS source; no global theme overrides. */
.rma-chat-root { --rma-ink:#23332f; --rma-muted:#73817b; --rma-line:#e3e9e5; position:fixed; inset:0; pointer-events:none; z-index:10000; color:var(--rma-ink); font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
.rma-chat-root *, .rma-chat-root *::before, .rma-chat-root *::after { box-sizing:border-box; }
.rma-chat-root button, .rma-chat-root input, .rma-chat-root textarea { font:inherit; }
.rma-chat-root button { cursor:pointer; }
.rma-chat-root button:focus-visible, .rma-chat-root input:focus-visible, .rma-chat-root textarea:focus-visible { outline:2px solid var(--rma-primary-color,#246b58); outline-offset:3px; }
.rma-chat-root button { transition:background .18s,transform .18s; }
.rma-chat-root button:active { transform:translateY(1px); }
.rma-chat-backdrop { position:absolute; inset:0; background:rgba(25,39,32,.28); opacity:0; visibility:hidden; transition:opacity .3s,visibility .3s; }
.rma-chat-opened .rma-chat-backdrop { opacity:1; visibility:visible; pointer-events:auto; }
/* Compact edge bubble: 44px visible target, centered on the viewport. */
.rma-chat-root .rma-chat-launcher { position:absolute; top:50%; bottom:auto; right:-8px; width:52px; height:48px; padding:0 8px 0 0; border:1px solid #ffffffb3; border-right:0; border-radius:26px 0 0 26px; display:flex; align-items:center; justify-content:center; background:#f4faf6; color:var(--rma-primary-color,#246b58); pointer-events:auto; transform:translateY(-50%); box-shadow:-3px 2px 12px #203e321a; isolation:isolate; transition:transform .22s,background .22s; }
.rma-chat-root .rma-chat-launcher::before { content:""; position:absolute; inset:-5px 0 -5px -5px; z-index:-1; border-radius:inherit; box-shadow:-4px 0 18px var(--rma-primary-color,#246b58); opacity:.18; pointer-events:none; animation:rma-edge-glow 3s ease-in-out infinite; }
.rma-chat-root .rma-chat-launcher:hover, .rma-chat-root .rma-chat-launcher:focus-visible { transform:translate(-6px,-50%); background:#fff; border-radius:26px; }
.rma-chat-root .rma-chat-launcher:active { transform:translate(-3px,-50%); }
.rma-chat-launcher-icon { display:flex; align-items:center; justify-content:center; }
.rma-chat-launcher-icon svg { width:22px; height:22px; }
.rma-chat-root.rma-chat-opened .rma-chat-launcher, .rma-chat-launcher-glow, .rma-chat-launcher-close-icon { display:none; }
.rma-chat-badge { position:absolute; top:-5px; left:-3px; min-width:18px; padding:1px 5px; border:2px solid white; border-radius:12px; background:var(--rma-primary-color,#246b58); color:white; font-size:10px; line-height:14px; }
@keyframes rma-edge-glow { 0%,100% { opacity:.12; } 50% { opacity:.3; } }
.rma-chat-window { position:absolute; top:0; right:0; width:480px; max-width:100%; height:100%; height:100dvh; margin:0; border:0; border-radius:0; background:#fff; box-shadow:-12px 0 48px #203e321a; display:flex; flex-direction:column; overflow:hidden; pointer-events:auto; transform:translateX(100%); visibility:hidden; transition:transform .32s cubic-bezier(.22,1,.36,1),visibility .32s; }
.rma-chat-opened .rma-chat-window { transform:translateX(0); visibility:visible; }
.rma-chat-tabs { display:flex; gap:4px; flex-shrink:0; margin:24px 24px 16px; padding:5px; background:#eff3f0; border-radius:12px; }
.rma-chat-tab { flex:1; min-width:0; min-height:44px; padding:10px 8px; display:flex; gap:8px; justify-content:center; align-items:center; border:0; border-radius:8px; background:transparent; color:#67776e; font-size:13px; font-weight:600; }
.rma-chat-tab:hover { background:#e3ebe5; }
.rma-chat-tab-active { background:#fff; color:var(--rma-primary-color,#246b58); box-shadow:0 2px 5px #203e3210; }
.rma-chat-header { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 24px 20px; border-bottom:1px solid var(--rma-line); flex-shrink:0; }
.rma-chat-header-info { display:flex; align-items:center; gap:12px; min-width:0; }
.rma-chat-avatar { width:44px; height:44px; flex-shrink:0; border-radius:14px; display:flex; align-items:center; justify-content:center; background:#eaf1ec; color:var(--rma-primary-color,#246b58); overflow:hidden; }
.rma-chat-avatar img { width:100%; height:100%; object-fit:cover; }
.rma-chat-avatar-text { font-size:13px; font-weight:700; letter-spacing:.03em; }
.rma-chat-titles { min-width:0; }
.rma-chat-title { font-size:17px; font-weight:650; letter-spacing:-.3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rma-chat-status { margin-top:3px; font-size:11px; color:var(--rma-muted); }
.rma-chat-header-actions { display:flex; gap:4px; }
.rma-chat-btn-header,.rma-chat-threads-back,.rma-chat-product-remove,.rma-chat-reply-cancel { width:36px; height:36px; padding:0; flex-shrink:0; display:flex; align-items:center; justify-content:center; border:0; border-radius:10px; background:transparent; color:var(--rma-muted); }
.rma-chat-btn-header:hover,.rma-chat-threads-back:hover,.rma-chat-product-remove:hover,.rma-chat-reply-cancel:hover { background:#edf2ee; color:var(--rma-ink); }
.rma-chat-conversation { display:flex; flex-direction:column; flex:1; min-height:0; }
.rma-chat-messages { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:24px; display:flex; flex-direction:column; gap:18px; background:#f6f8f5; scrollbar-width:thin; }
.rma-chat-welcome { text-align:center; margin:24px auto; max-width:290px; }
.rma-chat-welcome-bubble { display:flex; flex-direction:column; align-items:center; gap:14px; }
.rma-chat-welcome-icon { display:grid; place-items:center; width:52px; height:52px; border:1px solid #dce5de; border-radius:18px; color:var(--rma-primary-color,#246b58); font-weight:700; }
.rma-chat-welcome-text { font-size:13px; line-height:1.65; color:var(--rma-muted); }
.rma-chat-welcome .rma-chat-time-stamp { display:none; }
.rma-chat-msg-row { display:flex; flex-direction:column; max-width:86%; flex-shrink:0; }
.rma-chat-msg-in { align-self:flex-start; align-items:flex-start; }
.rma-chat-msg-out { align-self:flex-end; align-items:flex-end; }
.rma-chat-msg-bubble { padding:12px 15px; line-height:1.6; overflow-wrap:anywhere; }
.rma-chat-msg-in .rma-chat-msg-bubble { background:white; border:1px solid #e6ece6; border-radius:16px 16px 16px 4px; }
.rma-chat-msg-out .rma-chat-msg-bubble { background:var(--rma-primary-color,#246b58); color:white; border-radius:16px 16px 4px 16px; }
.rma-chat-msg-bubble a { color:inherit; text-decoration:underline; }
.rma-chat-time-stamp { margin-top:5px; padding:0 3px; font-size:10px; color:var(--rma-muted); font-variant-numeric:tabular-nums; }
.rma-chat-author-line { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:5px; font-size:11px; }
.rma-chat-author-name { font-weight:600; }
.rma-chat-author-badge { font-size:10px; color:var(--rma-muted); }
.rma-chat-msg-reply-quote { padding:6px 9px; margin-bottom:8px; border-left:2px solid currentColor; background:#73817b15; font-size:12px; }
.rma-chat-product-banner { display:flex; gap:12px; align-items:center; padding:12px 24px; border-bottom:1px solid var(--rma-line); flex-shrink:0; }
.rma-chat-product-thumb { width:46px; height:46px; flex-shrink:0; }
.rma-chat-product-thumb img { width:100%; height:100%; object-fit:cover; border-radius:8px; }
.rma-chat-product-details,.rma-chat-reply-content { flex:1; min-width:0; }
.rma-chat-product-tag { font-size:10px; color:var(--rma-muted); }
.rma-chat-product-name,.rma-chat-reply-text { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; }
.rma-chat-product-price,.rma-chat-reply-sender { font-size:12px; font-weight:600; color:var(--rma-primary-color,#246b58); }
.rma-chat-guest-bar { padding:12px 24px 0; flex-shrink:0; }
.rma-chat-guest-inputs { display:flex; gap:8px; }
.rma-chat-guest-inputs input { width:50%; min-width:0; height:36px; padding:8px 10px; border:1px solid var(--rma-line); border-radius:8px; background:#fff; font-size:12px; }
.rma-chat-reply-preview { display:flex; gap:10px; align-items:center; padding:12px 24px; border-top:1px solid var(--rma-line); flex-shrink:0; }
.rma-chat-reply-bar { width:3px; height:30px; background:var(--rma-primary-color,#246b58); }
.rma-chat-composer { margin:0; padding:16px 24px max(16px,env(safe-area-inset-bottom)); flex-shrink:0; background:#fff; }
.rma-chat-composer-box { display:flex; align-items:flex-end; gap:8px; padding:8px; border:1px solid #dce5df; border-radius:16px; background:#f8faf7; }
.rma-chat-composer-box:focus-within { border-color:var(--rma-primary-color,#246b58); }
.rma-chat-root .rma-chat-input { flex:1; min-width:0; width:100%; height:auto; min-height:40px; max-height:120px; padding:9px 6px; margin:0; border:0; border-radius:0; box-shadow:none; background:transparent; resize:none; color:var(--rma-ink); line-height:22px; }
.rma-chat-send-btn { width:40px; height:40px; flex-shrink:0; display:grid; place-items:center; border:0; border-radius:11px; background:#e5ece6; color:#73817b; }
.rma-chat-send-btn.has-text { color:#fff; background:var(--rma-primary-color,#246b58); }
.rma-chat-branding { margin-top:9px; text-align:center; font-size:10px; color:var(--rma-muted); }
.rma-chat-threads-drawer { flex:1; min-height:0; flex-direction:column; background:#fff; }
.rma-chat-threads-drawer[style*="flex"] ~ .rma-chat-conversation { display:none; }
.rma-chat-threads-header { display:flex; align-items:center; gap:10px; padding:16px 24px; border-bottom:1px solid var(--rma-line); font-weight:600; }
.rma-chat-threads-list { overflow:auto; flex:1; min-height:0; }
.rma-chat-thread-item { width:100%; display:flex; align-items:center; gap:12px; padding:18px 24px; text-align:left; border:0; border-bottom:1px solid var(--rma-line); background:white; }
.rma-chat-thread-item:hover { background:#f1f5f0; }
.rma-chat-thread-name { font-weight:600; font-size:14px; }
.rma-chat-thread-last { color:var(--rma-muted); font-size:12px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.rma-chat-loading-threads { padding:32px 24px; text-align:center; color:var(--rma-muted); }
body.rma-chat-locked { overflow:hidden; }
@media(max-width:540px) { .rma-chat-window { width:100%; } .rma-chat-tabs { margin: max(16px,env(safe-area-inset-top)) 16px 12px; } .rma-chat-header { padding:8px 16px 16px; } .rma-chat-messages { padding:20px 16px; } .rma-chat-composer { padding-left:16px; padding-right:16px; } .rma-chat-status { font-size:10px; } .rma-chat-tab { font-size:12px; gap:5px; } }
@media(prefers-reduced-motion:reduce) { .rma-chat-root *, .rma-chat-root *::before { transition:none; animation:none; scroll-behavior:auto; } }
.rma-chat-message-author { display:flex; align-items:center; gap:7px; max-width:100%; margin-bottom:6px; color:var(--rma-ink); font-size:11px; text-decoration:none; }
a.rma-chat-message-author:hover { color:var(--rma-primary-color,#246b58); text-decoration:underline; }
.rma-chat-message-avatar { position:relative; flex-shrink:0; display:grid; place-items:center; width:28px; height:28px; overflow:hidden; border-radius:10px; background:#e6eee7; color:var(--rma-primary-color,#246b58); font-weight:600; }
.rma-chat-message-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; background:#e6eee7; }
.rma-chat-identity { display:flex; flex-wrap:wrap; align-items:center; gap:7px; padding:12px 24px 0; flex-shrink:0; }
.rma-chat-identity-caption { color:var(--rma-muted); font-size:11px; }
.rma-chat-identity .rma-chat-message-author { margin:0; }
.rma-chat-identity select { margin-left:auto; max-width:100%; padding:7px 9px; border:1px solid var(--rma-line); border-radius:8px; background:#fff; color:var(--rma-ink); font:inherit; font-size:12px; }
.rma-chat-identity select:focus-visible { outline:2px solid var(--rma-primary-color,#246b58); outline-offset:2px; }
#rma-chat-vendor-profile { display:inline-block; color:var(--rma-primary-color,#246b58); font-size:11px; text-decoration:none; }
#rma-chat-vendor-profile:hover { text-decoration:underline; }
.rma-chat-send-btn:disabled { opacity:.5; cursor:wait; }
