.lcs-widget,
.lcs-widget * {
  box-sizing: border-box;
}

.lcs-widget {
  --lcs-theme-safe: var(--lcs-theme, #6f0d18);
  --lcs-theme-dark: #4f0810;
  --lcs-agent-bubble-safe: var(--lcs-agent-bubble, #87cefa);
  --lcs-mobile-bubble-safe: var(--lcs-mobile-bubble, #ddf3ff);
  --lcs-ink: #221719;
  --lcs-muted: #786c6f;
  --lcs-line: #ded4d6;
  --lcs-soft: #fbf3f4;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147482000;
  color: var(--lcs-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.lcs-widget[hidden] {
  display: none !important;
}

.lcs-widget button,
.lcs-widget input {
  font: inherit;
}

#lcs-support button,
#lcs-support a,
#lcs-support input,
#lcs-support select {
  -webkit-tap-highlight-color: transparent;
}

#lcs-support button:focus,
#lcs-support button:active {
  box-shadow: none !important;
  outline: none !important;
}

.lcs-launcher {
  appearance: none !important;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 132px !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 5px 12px 5px 6px !important;
  border: 1px solid var(--lcs-theme-dark) !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #85101e 0%, var(--lcs-theme-safe) 58%, #550912 100%) !important;
  color: #fff !important;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(79, 8, 16, .3), inset 0 1px 0 rgba(255,255,255,.18);
  text-align: left;
  text-decoration: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  transition: transform .18s ease, box-shadow .18s ease;
}

.lcs-launcher:hover,
.lcs-launcher:focus-visible {
  border-color: #3f060d !important;
  background: linear-gradient(135deg, #941326 0%, #770e1b 58%, #5d0914 100%) !important;
  color: #fff !important;
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(34, 23, 25, .25);
}

.lcs-launcher strong {
  color: #fff !important;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.lcs-launcher-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
}

.lcs-launcher-icon svg,
.lcs-settings-button svg,
.lcs-close svg,
.lcs-send svg,
.lcs-profile-close svg,
.lcs-transcript-close svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.lcs-widget[data-state="open"] .lcs-launcher {
  display: none;
}

.lcs-panel {
  position: relative;
  width: min(370px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid #cdbfc2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(34, 23, 25, .3), 0 4px 14px rgba(111, 13, 24, .12);
}

.lcs-panel:not([hidden]) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  animation: lcs-open .2s ease-out;
}

.lcs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 11px 12px 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(135deg, #84101f 0%, var(--lcs-theme-safe) 62%, var(--lcs-theme-dark) 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.13);
}

.lcs-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.lcs-identity strong,
.lcs-identity small {
  display: block;
  max-width: 208px;
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lcs-identity strong {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.lcs-identity small {
  margin-top: 2px;
  font-size: 11px;
  opacity: .88;
}

.lcs-avatar {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  overflow: visible;
  border-radius: 50%;
  cursor: pointer;
}

.lcs-avatar img {
  width: 100%;
  height: 100%;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 43%;
  box-shadow: 0 0 0 1px var(--lcs-line);
}

.lcs-avatar-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 0 0 1px var(--lcs-line);
}

.lcs-online-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #78ff38;
  box-shadow: 0 0 8px rgba(120,255,56,.9);
}

.lcs-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lcs-settings-button,
.lcs-close {
  appearance: none !important;
  display: grid;
  width: 34px !important;
  height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center;
  border: 0 !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,.08) !important;
  color: #fff !important;
  cursor: pointer;
  line-height: 1 !important;
  box-shadow: none !important;
}

.lcs-settings-button:hover,
.lcs-settings-button:focus-visible,
.lcs-settings-button:active,
.lcs-settings-button[aria-expanded="true"],
.lcs-close:hover,
.lcs-close:focus-visible,
.lcs-close:active {
  background: rgba(255,255,255,.18) !important;
  color: #fff !important;
  outline: none;
}

.lcs-settings {
  display: none;
  position: absolute;
  left: 12px;
  right: 12px;
  top: 86px;
  z-index: 4;
  padding: 14px;
  border: 1px solid #e4d7da;
  border-radius: 14px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 18px 48px rgba(34, 23, 25, .22);
}

.lcs-settings:not([hidden]) {
  display: grid;
  gap: 12px;
}

.lcs-settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 7px;
}

.lcs-settings-row > span {
  min-width: 0;
}

.lcs-settings strong {
  display: block;
  color: var(--lcs-ink);
  font-size: 13px;
}

.lcs-settings small {
  display: block;
  margin-top: 2px;
  color: var(--lcs-muted);
  font-size: 10px;
}

.lcs-bubble-color {
  width: 76px !important;
  height: 34px !important;
  padding: 1px !important;
  border: 1px solid #d1c2c5 !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.lcs-rating-select {
  width: 100%;
  min-height: 30px;
  border: 1px solid #d1c2c5;
  border-radius: 8px;
  background: #fff;
  color: var(--lcs-ink);
  font-size: 12px;
  font-weight: 700;
}

.lcs-switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
}

.lcs-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lcs-switch > span[aria-hidden="true"] {
  display: block;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #b9afb1;
  cursor: pointer;
  transition: .18s ease;
}

.lcs-switch > span[aria-hidden="true"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  content: "";
  transition: .18s ease;
}

.lcs-switch input:checked + span {
  background: var(--lcs-theme-safe);
}

.lcs-switch input:checked + span::after {
  transform: translateX(18px);
}

.lcs-save,
.lcs-settings-close {
  appearance: none !important;
  width: 100% !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 1px solid rgba(111,13,24,.24) !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: var(--lcs-theme-safe) !important;
  cursor: pointer;
  font-size: 13px !important;
  font-weight: 750 !important;
  box-shadow: none !important;
}

.lcs-settings-close {
  background: var(--lcs-theme-safe) !important;
  color: #fff !important;
  margin-top: 2px !important;
}

.lcs-save:hover,
.lcs-save:focus-visible,
.lcs-settings-close:hover,
.lcs-settings-close:focus-visible {
  background: var(--lcs-theme-dark) !important;
  color: #fff !important;
  outline: none;
}

.lcs-connecting,
.lcs-messages {
  grid-row: 2;
  min-height: 0;
}

.lcs-connecting {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 34px 20px;
  background: linear-gradient(180deg, #fff 0%, #fdfafb 100%);
  color: var(--lcs-ink);
  text-align: center;
}

.lcs-connecting strong {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}

.lcs-connecting small {
  color: var(--lcs-muted);
  font-size: 12px;
}

.lcs-connecting-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 58px;
  height: 58px;
  border: 1px solid #e1d5d7;
  border-radius: 50%;
  background: var(--lcs-soft);
}

.lcs-connecting-icon span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lcs-theme-safe);
  animation: lcs-dot 1.1s infinite ease-in-out;
}

.lcs-connecting-icon span:nth-child(2) { animation-delay: .12s; }
.lcs-connecting-icon span:nth-child(3) { animation-delay: .24s; }

.lcs-panel[data-connection="connecting"] .lcs-connecting {
  display: flex;
}

.lcs-panel[data-connection="connecting"] .lcs-messages,
.lcs-panel[data-connection="connecting"] .lcs-typing,
.lcs-panel[data-connection="connecting"] .lcs-form,
.lcs-panel[data-connection="connecting"] .lcs-footer,
.lcs-panel[data-connection="connecting"] .lcs-settings {
  display: none !important;
}

.lcs-messages {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 12px 10px;
  background: linear-gradient(180deg, #fff 0%, #fdfafb 100%);
}

.lcs-message-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 10px;
}

.lcs-message-row--visitor {
  justify-content: flex-end;
}

.lcs-message-row--agent {
  justify-content: flex-start;
}

.lcs-message {
  position: relative;
  display: inline-block;
  width: auto;
  max-width: min(270px, 82%);
  min-width: 0;
  padding: 10px 12px 7px;
  border: 1px solid rgba(34,23,25,.08);
  border-radius: 12px;
  background: var(--lcs-agent-bubble-safe);
  color: var(--lcs-agent-text, var(--lcs-ink));
  box-shadow: 0 2px 8px rgba(34, 23, 25, .08);
  overflow-wrap: anywhere;
}

.lcs-message--media {
  width: min(276px, 86%);
  max-width: min(276px, 86%);
  padding: 8px;
  overflow: hidden;
}

.lcs-message-row--visitor .lcs-message {
  border-color: rgba(111,13,24,.18);
  background: var(--lcs-theme-safe);
  color: #fff;
}

.lcs-message--system {
  max-width: min(250px, 78%);
  border-color: #d7e0eb;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 750;
}

.lcs-message--translated .lcs-primary {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.lcs-translation-label {
  display: block;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(34,23,25,.12);
  color: rgba(34,23,25,.58);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lcs-translation {
  display: block;
  margin-top: 3px;
  color: rgba(34,23,25,.82);
  font-size: 12px;
}

.lcs-message-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid #5f0913;
  border-radius: 999px;
  background: var(--lcs-theme-safe);
  color: #fff !important;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none !important;
}

.lcs-profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #bfd7f1;
  border-radius: 6px;
  background: #f8fbff;
  color: #1e5b9e !important;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
  text-decoration: none !important;
}

.lcs-message-link:hover,
.lcs-message-link:focus-visible {
  background: #4f0810;
  color: #fff !important;
  outline: none;
}

.lcs-profile-link:hover,
.lcs-profile-link:focus-visible {
  background: #1e5b9e;
  border-color: #1e5b9e;
  color: #fff !important;
  outline: none;
}

.lcs-time {
  display: block;
  clear: both;
  margin-top: 4px;
  color: rgba(34,23,25,.55);
  font-size: 10px;
  line-height: 1.2;
  text-align: right;
}

.lcs-message-row--visitor .lcs-time {
  color: rgba(255,255,255,.72);
}

.lcs-sending {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.lcs-sending span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(34,23,25,.18);
  border-top-color: var(--lcs-theme-safe);
  border-radius: 50%;
  animation: lcs-spin .8s linear infinite;
}

.lcs-media-image,
.lcs-media-video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 190px;
  border-radius: 9px;
  background: #111827;
  object-fit: cover;
}

.lcs-media-youtube {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 9px;
  background: #111827;
}

.lcs-media-audio {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 38px;
  border-radius: 999px;
}

.lcs-selfie-caption {
  display: block;
  margin-top: 7px;
  color: var(--lcs-agent-text, rgba(34,23,25,.78));
  font-size: 12px;
  font-weight: 700;
}

.lcs-typing {
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 16px 6px;
}

.lcs-typing:not([hidden]) {
  display: flex;
}

.lcs-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(34,23,25,.42);
  animation: lcs-pulse .9s infinite ease-in-out;
}

.lcs-typing span:nth-child(2) { animation-delay: .12s; }
.lcs-typing span:nth-child(3) { animation-delay: .24s; }

.lcs-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #eadfe2;
  background: #fff;
}

.lcs-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #a7b0bf;
  border-radius: 4px;
  background: #fff;
  color: var(--lcs-ink);
  font-size: 13px;
  outline: none;
}

.lcs-input:focus {
  border-color: var(--lcs-theme-safe);
  box-shadow: 0 0 0 3px rgba(111,13,24,.12);
}

.lcs-send {
  appearance: none !important;
  display: grid;
  width: 44px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--lcs-theme-safe) !important;
  color: #fff !important;
  cursor: pointer;
  box-shadow: none !important;
}

.lcs-send:hover,
.lcs-send:focus-visible {
  background: #4f0810 !important;
  color: #fff !important;
  outline: none;
}

.lcs-footer {
  min-height: 28px;
  padding: 6px 12px 9px;
  background: #fff;
  color: rgba(34,23,25,.78);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
}

.lcs-footer small {
  color: inherit;
}

.lcs-profile,
.lcs-transcript {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 96px;
  bottom: auto;
  z-index: 8;
  width: auto;
  max-height: calc(100% - 116px);
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(111,13,24,.14);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 58px rgba(34,23,25,.28);
}

.lcs-profile-close,
.lcs-transcript-close {
  appearance: none !important;
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px !important;
  height: 32px !important;
  margin: 0 !important;
  padding: 0 !important;
  place-items: center;
  border: 0 !important;
  border-radius: 50% !important;
  background: #f1f5f9 !important;
  color: #475569 !important;
  cursor: pointer;
  box-shadow: none !important;
}

.lcs-profile-close:hover,
.lcs-profile-close:focus-visible,
.lcs-transcript-close:hover,
.lcs-transcript-close:focus-visible {
  background: #e2e8f0 !important;
  color: #111827 !important;
  outline: none;
}

.lcs-profile .lcs-profile-close {
  background: rgba(255,255,255,.15) !important;
  color: #fff !important;
}

.lcs-profile .lcs-profile-close:hover,
.lcs-profile .lcs-profile-close:focus-visible {
  background: rgba(255,255,255,.26) !important;
  color: #fff !important;
}

.lcs-profile-top {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 108px;
  padding: 18px 50px 18px 18px;
  background: linear-gradient(135deg, #84101f 0%, var(--lcs-theme-safe) 62%, var(--lcs-theme-dark) 100%);
  color: #fff;
}

.lcs-profile-top img {
  width: 68px;
  height: 68px;
  border: 3px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255,255,255,.42), 0 8px 18px rgba(34,23,25,.22);
}

.lcs-profile-top strong,
.lcs-profile-top small {
  display: block;
}

.lcs-profile-top strong {
  color: #fff;
  font-size: 18px;
}

.lcs-profile-top small {
  margin-top: 2px;
  color: rgba(255,255,255,.84);
  font-size: 12px;
}

.lcs-profile-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(236,253,243,.96);
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.lcs-profile-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #39ff14;
  box-shadow: 0 0 0 2px rgba(57,255,20,.18);
  content: "";
}

.lcs-profile-body {
  margin: 0;
  padding: 14px 16px 16px;
}

.lcs-profile-body p {
  margin: 0 0 9px;
  color: #334155;
  font-size: 12.5px;
  line-height: 1.45;
}

.lcs-profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(111,13,24,.12);
}

.lcs-profile-links strong {
  flex: 0 0 100%;
  color: #174276;
  font-size: 12px;
  font-weight: 850;
}

.lcs-transcript {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.lcs-transcript strong {
  color: #111827;
  font-size: 16px;
}

.lcs-transcript textarea {
  width: 100%;
  min-height: 230px;
  padding: 10px;
  border: 1px solid rgba(15,23,42,.18);
  border-radius: 10px;
  resize: vertical;
  font: 12px/1.45 Consolas, Monaco, monospace;
}

.lcs-transcript-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.lcs-transcript-actions button {
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(111,13,24,.2);
  border-radius: 999px;
  background: #fff;
  color: var(--lcs-theme-safe);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
}

.lcs-transcript-actions button:hover,
.lcs-transcript-actions button:focus-visible {
  background: var(--lcs-theme-safe);
  color: #fff;
  outline: none;
}

.lcs-toast {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 2147483001;
  max-width: min(360px, calc(100vw - 44px));
  padding: 10px 13px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 28px rgba(15,23,42,.28);
  font: 700 13px/1.35 Arial, Helvetica, sans-serif;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

@keyframes lcs-open {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lcs-dot {
  0%,
  80%,
  100% {
    opacity: .35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes lcs-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes lcs-pulse {
  0%,
  80%,
  100% {
    opacity: .35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 520px) {
  .lcs-widget {
    right: 10px;
    bottom: 10px;
  }

  .lcs-panel {
    width: calc(100vw - 20px);
    height: min(640px, calc(100vh - 20px));
    border-radius: 16px;
  }

  .lcs-message-row--agent .lcs-message {
    background: var(--lcs-mobile-bubble-safe);
  }

  .lcs-message--media {
    width: min(258px, 88%);
    max-width: min(258px, 88%);
  }

  .lcs-media-image,
  .lcs-media-video {
    max-height: 170px;
  }

  .lcs-profile,
  .lcs-transcript {
    left: 10px;
    right: 10px;
    top: 92px;
    width: auto;
  }
}
