/* xSample account live chat — pill morphs into panel */
.xsample-ask{
  --xs-pill-ease:cubic-bezier(.22,1,.32,1);
  position:fixed;right:20px;bottom:20px;z-index:80;
  display:inline-flex;align-items:center;gap:11px;
  min-height:40px;padding:8px 14px 8px 12px;
  border:1px solid rgba(17,17,17,.22);border-radius:999px;background:#fff;color:#111;
  box-shadow:0 6px 20px rgba(0,0,0,.1);cursor:pointer;font:inherit;
  transform-origin:bottom right;
  transition:opacity .28s ease,visibility .28s ease;
}
.xsample-ask[hidden]{display:none!important}
.xsample-ask.is-panel-open,
.xsample-ask.is-closing-wait{
  opacity:0;visibility:hidden;pointer-events:none;
  transition:none;
}
.xsample-ask.is-instant{
  transition:none!important;
  opacity:1!important;visibility:visible!important;
  transform:none!important;
}
.xsample-ask__label{font-size:13px;font-weight:600;letter-spacing:.01em}
.xsample-ask__sparkle,.xsample-ask__send{display:inline-flex;color:#111;flex-shrink:0}
.xsample-ask__send{opacity:.8}
.xsample-ask__count{
  position:absolute;top:-7px;right:-6px;z-index:2;
  min-width:18px;height:18px;padding:0 5px;border-radius:999px;
  background:#e11d48;color:#fff;font-size:10px;font-weight:800;line-height:1;
  display:none;align-items:center;justify-content:center;
  border:2px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.18);pointer-events:none;
}
.xsample-ask__count.show{display:inline-flex}

.xsample-chat{
  --xs-chat-h:min(585px,calc(72vh + 65px));
  --xs-pill-w:168px;
  --xs-pill-h:40px;
  --xs-morph-ease:cubic-bezier(.22,1,.32,1);
  --xs-morph-ms:.58s;
  --xs-compose-h:62px;
  position:fixed;right:20px;bottom:20px;z-index:81;
  width:var(--xs-pill-w);height:var(--xs-pill-h);
  display:flex;flex-direction:column;background:#fff;border-radius:999px;
  box-shadow:0 10px 32px rgba(0,0,0,.16);overflow:hidden;
  font-size:12px;line-height:1.4;color:#111;
  opacity:0;visibility:hidden;pointer-events:none;
  transform-origin:bottom right;
  transition:
    width var(--xs-morph-ms) var(--xs-morph-ease),
    height var(--xs-morph-ms) var(--xs-morph-ease),
    border-radius var(--xs-morph-ms) var(--xs-morph-ease),
    opacity .2s ease,
    box-shadow .35s ease,
    visibility 0s linear var(--xs-morph-ms);
}
.xsample-chat.is-open{
  width:min(380px,calc(100vw - 32px));
  height:var(--xs-chat-h);
  border-radius:16px;
  opacity:1;visibility:visible;pointer-events:auto;
  box-shadow:0 18px 48px rgba(0,0,0,.2);
  transition:
    width var(--xs-morph-ms) var(--xs-morph-ease),
    height var(--xs-morph-ms) var(--xs-morph-ease),
    border-radius var(--xs-morph-ms) var(--xs-morph-ease),
    opacity .18s ease,
    box-shadow .35s ease,
    visibility 0s linear 0s;
}
.xsample-chat.is-closing{
  width:var(--xs-pill-w);height:var(--xs-pill-h);border-radius:999px;
  opacity:1;visibility:visible;pointer-events:none;
  box-shadow:0 6px 20px rgba(0,0,0,.1);
  transition:
    width var(--xs-morph-ms) var(--xs-morph-ease),
    height var(--xs-morph-ms) var(--xs-morph-ease),
    border-radius var(--xs-morph-ms) var(--xs-morph-ease),
    box-shadow .35s ease,
    visibility 0s linear var(--xs-morph-ms);
}

.xsample-chat__hd,
.xsample-chat__msgs{
  opacity:0;
  visibility:hidden;
  transition:opacity .2s ease,visibility 0s linear .2s;
}
.xsample-chat.is-open .xsample-chat__hd,
.xsample-chat.is-open .xsample-chat__msgs{
  opacity:1;
  visibility:visible;
  transition:opacity .28s ease .16s,visibility 0s linear 0s;
}
.xsample-chat.is-closing .xsample-chat__hd,
.xsample-chat.is-closing .xsample-chat__msgs{
  opacity:0!important;
  visibility:hidden!important;
  transition:none!important;
  pointer-events:none;
}

.xsample-chat__hd{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:8px;background:#0a0a0a;color:#fff;flex-shrink:0;
}
.xsample-chat__brand{display:flex;align-items:center;gap:8px;min-width:0}
.xsample-chat__logo{
  width:46px;height:46px;border-radius:999px;background:#fff;
  display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;
  padding:2px;box-sizing:border-box;
}
.xsample-chat__logo img{
  width:100%;height:100%;object-fit:contain;display:block;
  filter:brightness(0);
}
.xsample-chat__brand-text{min-width:0;display:flex;flex-direction:column;gap:1px}
.xsample-chat__title{
  display:inline-flex;align-items:center;gap:6px;
  font-size:13px;font-weight:700;line-height:1.15;
}
.xsample-chat__online{
  width:7px;height:7px;border-radius:999px;background:#22c55e;
  box-shadow:0 0 0 2px rgba(34,197,94,.28);flex-shrink:0;
}
.xsample-chat__sub{font-size:10px;font-weight:500;opacity:.7;line-height:1.2}

.xsample-chat__hd .drawer__close{
  width:34px;height:34px;margin:0;
  background:transparent;border-color:rgba(255,255,255,.35);color:#fff;
}
.xsample-chat__hd .drawer__close:hover{background:rgba(255,255,255,.12)}
.xsample-chat__hd .drawer__close svg{width:13px;height:13px;stroke:#fff}

.xsample-chat__msgs{
  flex:1;min-height:0;overflow:auto;padding:12px;
  padding-bottom:calc(var(--xs-compose-h) + 18px);
  display:flex;flex-direction:column;gap:8px;background:#fff;
  box-sizing:border-box;
  scrollbar-width:none;-ms-overflow-style:none;
}
.xsample-chat__msgs::-webkit-scrollbar{display:none;width:0;height:0}
.xsample-chat.is-drag-over .xsample-chat__msgs{
  background:linear-gradient(180deg,#f5f5f5 0%,#fff 100%);
  outline:1.5px dashed #111;outline-offset:-8px;border-radius:8px;
}
.xsample-chat__row{display:flex;align-items:flex-end;gap:7px;max-width:92%}
.xsample-chat__row--staff{align-self:flex-start}
.xsample-chat__row--mine{align-self:flex-end;flex-direction:row-reverse}
.xsample-chat__avatar{
  width:22px;height:22px;border-radius:999px;border:1px solid #e5e5e5;background:#fff;
  display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0;
  padding:2px;box-sizing:border-box;
}
.xsample-chat__avatar img{width:100%;height:100%;object-fit:contain;display:block;filter:brightness(0)}
.xsample-chat__avatar--bot{
  background:#111;border-color:#111;color:#fff;padding:0;
}
.xsample-chat__stack{display:flex;flex-direction:column;gap:4px;min-width:0}
.xsample-chat__bot-tag{
  display:inline-flex;align-items:center;gap:4px;
  font-size:10px;font-weight:600;letter-spacing:-0.02em;color:#6b6b6b;line-height:1.2;
}
.xsample-chat__bot-tag svg{flex-shrink:0;opacity:.9}
.xsample-chat__bubble{
  padding:8px 10px;border-radius:12px;font-size:12px;line-height:1.4;
  border:1px solid #ececec;background:#f3f3f3;white-space:pre-wrap;word-break:break-word;
}
.xsample-chat__bubble--mine{background:#111;color:#fff;border-color:#111}
.xsample-chat__bubble--staff{background:#f3f3f3;color:#111}
.xsample-chat__bubble--bot{border-style:dashed;border-color:#d6d6d6}
.xsample-chat__img{
  display:block;max-width:180px;max-height:160px;border-radius:8px;margin-top:4px;object-fit:cover;
}

/* Compose always floats over chat content and stays pinned to the bottom when open */
.xsample-chat__compose{
  position:absolute;left:0;right:0;bottom:0;z-index:5;
  padding:10px 10px max(10px,env(safe-area-inset-bottom));
  background:linear-gradient(180deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.92) 28%,#fff 55%);
  border-top:0;flex-shrink:0;box-sizing:border-box;
  opacity:0;visibility:hidden;pointer-events:none;
  transform:translateY(110%);
  transition:
    opacity .18s ease,
    transform .42s var(--xs-morph-ease),
    visibility 0s linear .42s;
}
.xsample-chat__upload{margin:0 2px 8px}
.xsample-chat__upload[hidden]{display:none!important}
.xsample-chat__upload-bar{height:3px;border-radius:999px;background:#ececec;overflow:hidden;margin-bottom:5px}
.xsample-chat__upload-fill{height:100%;width:0;background:#111;border-radius:999px;transition:width .12s ease}
.xsample-chat__upload-label{display:block;font-size:10px;color:#888;letter-spacing:-0.02em}
.xsample-chat.is-open .xsample-chat__compose{
  opacity:1;visibility:visible;pointer-events:auto;
  transform:translateY(0);
  transition:
    opacity .26s ease .18s,
    transform .48s var(--xs-morph-ease) .1s,
    visibility 0s linear 0s;
}
.xsample-chat.is-closing .xsample-chat__compose{
  opacity:0;visibility:hidden;pointer-events:none;
  transform:translateY(110%);
  transition:
    opacity .14s ease,
    transform .36s var(--xs-morph-ease),
    visibility 0s linear .36s;
}

.xsample-chat__form{
  display:flex;align-items:center;gap:2px;
  border:1px solid #ddd;border-radius:999px;padding:3px 5px 3px 12px;background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.1);
}
.xsample-chat__input{
  flex:1;min-width:0;border:0;outline:none;background:transparent;
  font:inherit;font-size:16px;padding:7px 0;color:#111;
}
.xsample-chat__input::placeholder{color:#9a9a9a}
.xsample-chat__attach,
.xsample-chat__send{
  width:32px;height:32px;border:0;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;
}
.xsample-chat__attach{background:transparent;color:#555}
.xsample-chat__attach:hover{color:#111;background:#f3f3f3}
.xsample-chat__attach:disabled{opacity:.45;cursor:not-allowed}
.xsample-chat__send{background:#111;color:#fff}
.xsample-chat__send:disabled{opacity:.45;cursor:not-allowed}
.xsample-chat__status{margin:4px 2px 0;font-size:10px;color:#888;min-height:12px}

@media(max-width:640px){
  .xsample-ask{right:12px;bottom:12px;padding:8px 11px}
  .xsample-ask__label{font-size:11px}
  .xsample-chat{right:12px;bottom:12px}
  .xsample-chat.is-open{
    width:calc(100vw - 24px);
    --xs-chat-h:min(625px,calc(78vh + 65px));
  }
}
