.ls-root {
  --ls-purple: #790CD1;
  --ls-purple-2: #5a09a0;
  --ls-ink: #1d1430;
  --ls-muted: #7f7394;
  --ls-line: #ece4f7;
  --ls-card: #ffffff;
  --ls-bg: #f7f4fb;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  z-index: 2147483000;
  position: fixed;
  right: 18px;
  bottom: 18px;
  pointer-events: none;
}
.ls-root * { box-sizing: border-box; }
.ls-root button, .ls-root input, .ls-root textarea { font-family: inherit; }
.ls-root button { -webkit-tap-highlight-color: transparent; }

/* ---------- floating button ---------- */
.ls-fab {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(150deg, #9b4dff, #790CD1);
  color: #fff;
  box-shadow: 0 12px 30px rgba(121, 12, 209, 0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
  animation: ls-fab-float 2.8s ease-in-out infinite;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ls-fab:hover {
  animation-play-state: paused;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 36px rgba(121, 12, 209, 0.55);
}
.ls-fab:focus-visible { outline: 3px solid rgba(121, 12, 209, .35); outline-offset: 3px; }
.ls-fab svg { width: 26px; height: 26px; }
@keyframes ls-fab-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.ls-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3d5a;
  color: #fff;
  border: 2px solid #fff;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}
.ls-badge.on { display: inline-flex; }
.ls-root.open .ls-fab { display: none; }
.ls-root.ls-hide-game,
html.bov-game-open .ls-root { display: none !important; }

/* ---------- panel ---------- */
.ls-panel {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(392px, calc(100vw - 24px));
  height: min(600px, calc(100vh - 110px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--ls-card);
  color: var(--ls-ink);
  border-radius: 22px;
  box-shadow: 0 30px 70px -12px rgba(40, 8, 70, .45), 0 0 0 1px rgba(121, 12, 209, .12);
}
.ls-root.open .ls-panel {
  display: flex;
  animation: ls-in .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes ls-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- header ---------- */
.ls-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 12px 14px 16px;
  background: linear-gradient(150deg, #8f2fe6 0%, #790CD1 48%, #4c0a8a 100%);
  color: #fff;
}
.ls-head-agent { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ls-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.ls-avatar.has-agent {
  background: linear-gradient(145deg, #ffe0f6, #d4b5ff);
  color: #4a1a7a;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7);
}
.ls-avatar svg { width: 22px; height: 22px; }
/* Temsilci fotoğrafı: beyaz yuvarlak içinde, kenarları kırpılmadan */
.ls-photo,
.ls-avatar.ls-photo.has-agent {
  overflow: hidden;
  background: #fff;
}
.ls-avatar.ls-photo { box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.ls-mini.ls-photo { box-shadow: 0 0 0 1px var(--ls-line, rgba(121, 12, 209, .15)); }
.ls-photo img {
  display: block;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 7%;
  object-fit: contain;
  border-radius: 50%;
  user-select: none;
  -webkit-user-drag: none;
}
.ls-head-copy { min-width: 0; display: flex; flex-direction: column; }
.ls-head b {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ls-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(255, 255, 255, .86);
  min-width: 0;
}
.ls-status em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffb020;
}
.ls-dot.on {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .28);
}
.ls-head-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.ls-icon {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}
.ls-icon:hover { background: rgba(255, 255, 255, .18); }
.ls-icon:focus-visible { outline: 2px solid rgba(255, 255, 255, .8); outline-offset: 1px; }
.ls-icon svg { width: 18px; height: 18px; }

/* ---------- message area ---------- */
.ls-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.ls-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  scroll-behavior: auto;
}
.ls-day { text-align: center; margin: 12px 0 4px; }
.ls-day span {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ls-muted);
  background: #f3f0f8;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(30, 10, 60, .06);
}
.ls-sys {
  align-self: center;
  max-width: 92%;
  margin: 10px 0 2px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #efe6fb;
  color: #5f5173;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.ls-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}
.ls-row:not(.grouped) { margin-top: 12px; }
.ls-row.grouped { margin-top: 3px; }
.ls-row.user { justify-content: flex-end; }
.ls-row.admin { justify-content: flex-start; }
.ls-mini {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffe0f6, #d4b5ff);
  color: #4a1a7a;
  font-size: 11px;
  font-weight: 800;
}
.ls-mini svg { width: 15px; height: 15px; }
.ls-mini.ghost { visibility: hidden; }
.ls-col {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  min-width: 0;
}
.ls-row.user .ls-col { align-items: flex-end; }
.ls-who {
  margin: 0 4px 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ls-purple);
}
.ls-bubble {
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(30, 10, 60, .06);
}
.ls-row.user .ls-bubble {
  background: linear-gradient(135deg, #8f2fe6, #6a0bbd);
  color: #fff;
  border-bottom-right-radius: 6px;
}
.ls-row.user.grouped .ls-bubble { border-top-right-radius: 6px; }
.ls-row.admin .ls-bubble {
  background: #fff;
  color: var(--ls-ink);
  border: 1px solid var(--ls-line);
  border-bottom-left-radius: 6px;
}
.ls-row.admin.grouped .ls-bubble { border-top-left-radius: 6px; }
.ls-bubble.pending { opacity: .6; }
.ls-bubble.failed {
  background: #fff1f3;
  color: #9b1c31;
  border: 1px solid #ffc9d1;
}
.ls-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 4px 4px 0;
  font-size: 10.5px;
  color: var(--ls-muted);
}
.ls-row.user .ls-meta { justify-content: flex-end; }
.ls-fail { color: #9b1c31; font-weight: 600; }
.ls-retry {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  padding: 0;
  color: #9b1c31;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ls-retry svg { width: 12px; height: 12px; }

.ls-welcome {
  margin: auto;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--ls-muted);
}
.ls-welcome b { color: var(--ls-ink); font-size: 15px; }
.ls-welcome span { max-width: 260px; font-size: 13px; line-height: 1.45; }
.ls-promo {
  width: 100%;
  max-width: 300px;
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  text-align: left;
  background: #faf7ff;
  border: 1px solid var(--ls-line);
  box-shadow: 0 4px 14px rgba(121, 12, 209, .08);
}
.ls-promo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #f3f0f8; }
.ls-promo div { padding: 10px 12px 12px; }
.ls-promo b { display: block; font-size: 13px; color: var(--ls-ink); }
.ls-promo p { margin: 4px 0 0; font-size: 12px; line-height: 1.4; color: var(--ls-muted); }

.ls-jump {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--ls-purple);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(121, 12, 209, .35);
  cursor: pointer;
  white-space: nowrap;
}
.ls-jump[hidden] { display: none; }
.ls-jump svg { width: 14px; height: 14px; }

/* ---------- footer ---------- */
.ls-foot {
  flex: 0 0 auto;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid var(--ls-line);
}
.ls-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}
.ls-chips::-webkit-scrollbar { display: none; }
.ls-chips:empty { display: none; }
.ls-chip {
  flex: 0 0 auto;
  border: 1px solid #e2d3f5;
  border-radius: 999px;
  background: #faf6ff;
  color: var(--ls-purple);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.ls-chip:hover { background: #f0e5ff; }
.ls-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 14px;
  background: #f6f2fb;
  border: 1px solid #e6dcf3;
  border-radius: 22px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ls-compose:focus-within {
  background: #fff;
  border-color: var(--ls-purple);
  box-shadow: 0 0 0 3px rgba(121, 12, 209, .12);
}
.ls-compose textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 24px;
  max-height: 120px;
  padding: 7px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ls-ink);
  font-size: 14px;
  line-height: 1.4;
  resize: none;
}
.ls-compose textarea::placeholder { color: #a293b8; }
.ls-send {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ls-purple);
  color: #fff;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.ls-send:hover { background: var(--ls-purple-2); }
.ls-send:active { transform: scale(.94); }
.ls-send:disabled { background: #d9c8ee; cursor: default; }
.ls-send svg { width: 18px; height: 18px; }
.ls-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 11.5px;
  color: var(--ls-muted);
}
.ls-count { font-variant-numeric: tabular-nums; }
.ls-link {
  border: 0;
  background: none;
  padding: 2px 0;
  color: var(--ls-muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ls-link:hover { color: var(--ls-purple); }
.ls-confirm {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fbf3f4;
  border: 1px solid #f5d4da;
  color: #7a1d2c;
  font-size: 12.5px;
}
.ls-confirm span { flex: 1 1 auto; }
.ls-confirm[hidden] { display: none; }
.ls-err {
  margin-top: 6px;
  color: #b4233b;
  font-size: 12px;
  line-height: 1.4;
}
.ls-err:empty { display: none; }
.ls-note {
  padding: 9px 11px;
  border-radius: 12px;
  background: #f4effb;
  color: #5f5173;
  font-size: 12.5px;
  line-height: 1.45;
}

/* ---------- start form ---------- */
.ls-start { display: flex; flex-direction: column; gap: 10px; }
.ls-start-lead { margin: 0; color: var(--ls-muted); font-size: 13px; line-height: 1.45; }
.ls-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ls-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ls-field span { font-size: 11.5px; font-weight: 700; color: #6b5b80; }
.ls-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2d8ef;
  border-radius: 12px;
  background: #fff;
  color: var(--ls-ink);
  font-size: 14px;
  outline: none;
}
.ls-field input::placeholder { color: #a293b8; }
.ls-field input:focus {
  border-color: var(--ls-purple);
  box-shadow: 0 0 0 3px rgba(121, 12, 209, .12);
}
.ls-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #8f2fe6, #6a0bbd);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease;
}
.ls-btn:hover { filter: brightness(1.06); }
.ls-btn:disabled { opacity: .6; cursor: default; filter: none; }
.ls-btn.block { width: 100%; }
.ls-btn.ghost { background: #f1eaf9; color: var(--ls-purple); }
.ls-btn.danger { background: #c81e3b; }
.ls-btn.sm { padding: 7px 11px; border-radius: 10px; font-size: 12.5px; }
.ls-fine { margin: 0; text-align: center; font-size: 11px; color: #a193b5; }

/* ---------- motion & mobile ---------- */
@media (prefers-reduced-motion: reduce) {
  .ls-fab, .ls-root.open .ls-panel { animation: none; }
  .ls-fab:hover { transform: none; }
}
@media (max-width: 520px) {
  .ls-root { right: 10px; bottom: 10px; }
  .ls-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: var(--ls-vh, 100dvh);
    border-radius: 0;
    box-shadow: none;
  }
  .ls-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .ls-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ls-compose textarea,
  .ls-field input { font-size: 16px; }
  .ls-col { max-width: 84%; }
}

/* Pencere: site moru, sade sohbet */
.ls-fab { animation: none; box-shadow: 0 8px 20px rgba(88, 28, 135, .35); }
.ls-panel {
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 100px));
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(24, 8, 40, .28);
}
.ls-head { padding: 14px 10px 14px 14px; background: #6d28d9; }
.ls-avatar {
  width: 40px;
  height: 40px;
  background: #fff;
  color: #6d28d9;
  font-size: 16px;
  font-weight: 700;
  box-shadow: none;
}
.ls-head b { font-size: 15px; font-weight: 650; letter-spacing: 0; }
.ls-body { background: #f5f6f8; padding: 16px; }
.ls-day span { background: transparent; box-shadow: none; color: #8b8498; font-weight: 600; }
.ls-sys { background: transparent; color: #8b8498; padding: 0; }
.ls-row.user .ls-bubble {
  background: #6d28d9;
  border-radius: 16px 16px 4px 16px;
  box-shadow: none;
}
.ls-row.admin .ls-bubble {
  background: #fff;
  border: 1px solid #ece8f2;
  border-radius: 16px 16px 16px 4px;
  box-shadow: none;
  color: #1c1428;
}
.ls-mini {
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #ece8f2;
  color: #6d28d9;
}
.ls-who { color: #6b6478; font-weight: 600; }
.ls-foot { background: #fff; border-top: 1px solid #eeeaf3; }
.ls-foot:has(.ls-start) { flex: 1 1 auto; overflow: auto; border-top: 0; }
.ls-start { gap: 14px; padding: 4px 4px 2px; }
.ls-start-lead { margin: 0 0 2px; color: #6b6478; font-size: 13px; line-height: 1.4; }
.ls-field { display: grid; gap: 6px; }
.ls-field span { color: #1c1428; font-size: 13px; font-weight: 650; }
.ls-field i { color: #c81e3b; font-style: normal; }
.ls-field input {
  height: 42px;
  border: 1px solid #e4deee;
  border-radius: 10px;
  background: #fafafa;
  color: #1c1428 !important;
  -webkit-text-fill-color: #1c1428 !important;
  caret-color: #1c1428;
  padding: 0 12px;
}
.ls-field input:focus { border-color: #6d28d9; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(109, 40, 217, .12); }
#ls-root .ls-field input,
#ls-root .ls-compose textarea {
  color: #1c1428 !important;
  -webkit-text-fill-color: #1c1428 !important;
  caret-color: #1c1428;
}
.ls-addr { margin: 0; color: #6b6478; font-size: 13px; }
.ls-addr a { color: #6d28d9; font-weight: 650; text-decoration: none; }
.ls-addr.in-chat { margin: 0 2px 12px; }
.ls-btn.block {
  background: #6d28d9;
  border-radius: 10px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 650;
  box-shadow: none;
}
.ls-card {
  background: #fff;
  border: 1px solid #ece8f2;
  border-radius: 12px;
  padding: 10px 12px 6px;
  margin-bottom: 8px;
}
.ls-card-row { display: flex; justify-content: space-between; gap: 12px; margin: 0; padding: 7px 0; font-size: 13px; border-bottom: 1px solid #f3f0f6; }
.ls-card-row:last-of-type { border-bottom: 0; }
.ls-card-row span { color: #8b8498; }
.ls-card-row b { font-weight: 600; color: #1c1428; text-align: right; }
.ls-more {
  display: block;
  width: 100%;
  margin: 2px 0 4px;
  padding: 6px 0 2px;
  border: 0;
  background: transparent;
  color: #6d28d9;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 650;
}
.ls-letter { display: grid; place-items: center; width: 100%; height: 100%; color: #6d28d9; font-size: 12px; font-weight: 700; }
.ls-compose {
  background: #fafafa;
  border: 1px solid #e4deee;
  border-radius: 12px;
  box-shadow: none;
}
.ls-compose textarea { color: #1c1428; }
.ls-compose textarea::placeholder { color: #9a93a8; }
.ls-send { background: #6d28d9; border-radius: 10px; }
.ls-link { color: #8b8498; }
.ls-confirm { background: #fafafa; border: 1px solid #eeeaf3; border-radius: 10px; }

@media (max-width: 760px) {
  .ls-root.open {
    inset: 0;
    width: auto;
    height: auto;
  }
  .ls-root.open .ls-panel {
    position: fixed;
    inset: 0;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--ls-vh, 100dvh);
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .ls-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .ls-foot { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .ls-compose textarea,
  .ls-field input { font-size: 16px; }
}

