#livechat {
  position: fixed;
  z-index: 1000;
  left: max(1rem, env(safe-area-inset-left));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(24rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  box-sizing: border-box;
  padding: 1.125rem;
  border: 1px solid #30514d;
  border-radius: 8px;
  background: #0d1b21;
  color: var(--text, #f3f6f6);
  box-shadow: 0 14px 44px #0009;
  font-size: 14px;
  color-scheme: dark;
}

#livechat .livechat-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-bottom: .875rem;
  border-bottom: 1px solid #ffffff1f;
}

#livechat img {
  border-radius: 50%;
  object-fit: cover;
}

#livechat .livechat-kicker { display: block; color: #f3d879; font-size: 10px; font-weight: 700; }
#livechat .livechat-heading strong { font-size: 17px; }
#livechat-status { margin: 14px 0; color: var(--muted, #a9b9c6); line-height: 1.55; }
#livechat label { display: block; margin-bottom: .75rem; font-weight: 600; }
#livechat .livechat-optional { color: var(--muted, #a9b9c6); font-weight: 400; }
#livechat input, #livechat textarea, #livechat select {
  display: block; width: 100%; box-sizing: border-box; margin-top: 5px;
  background: #091419; color: inherit; border: 1px solid #38504f;
  border-radius: 6px; padding: 9px 10px; font: inherit; min-height: 44px;
}
#livechat textarea { min-height: 4.5rem; resize: vertical; }
#livechat button, #livechat-open {
  min-height: 44px; border: 1px solid transparent; border-radius: 6px;
  padding: 8px 13px; background: #8de1ca; color: #09221d;
  cursor: pointer; font: inherit; font-weight: 700;
}
#livechat button:hover, #livechat-open:hover { background: #b0f4df; }
#livechat #livechat-close, #livechat #livechat-end, #livechat #livechat-skip-rating {
  background: transparent; color: #bcd1d2; border-color: #38504f;
}
#livechat #livechat-close { margin-left: auto; flex: 0 0 44px; padding: 0; font-size: 24px; }
#livechat .livechat-privacy { margin-left: .75rem; font-size: 12px; }
#livechat-messages { display: flex; flex-direction: column; gap: 8px; overflow: auto; max-height: 12rem; list-style: none; margin: 0 0 14px; padding: 0; }
#livechat-messages li { align-self: flex-start; max-width: 88%; padding: 8px 11px; border-radius: 8px; background: #1d3039; overflow-wrap: anywhere; white-space: pre-wrap; }
#livechat-messages li.from-visitor { align-self: flex-end; background: #183b34; }
#livechat-messages small { display: block; color: #a3e6dc; font-weight: 700; }
#livechat [hidden] { display: none; }
#livechat-error { color: #ffb7ad; }
#livechat-error:empty { display: none; }


#livechat-open {
  position: fixed;
  z-index: 999;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: max(1rem, env(safe-area-inset-left));
  font-size: 14px;
}

#livechat a { color: #a3e6dc; }
#livechat-rating { margin: 14px 0; padding-top: 12px; border-top: 1px solid #ffffff1f; }
#livechat-rating fieldset { border: 0; margin: 0 0 8px; padding: 0; }
#livechat-rating legend { font-weight: 700; }
.livechat-stars { display: flex; gap: 4px; }
#livechat .livechat-stars label { position: relative; margin: 0; }
#livechat .livechat-stars input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.livechat-stars span { display: grid; place-items: center; width: 38px; height: 44px; color: #b2c1c4; font-size: 24px; cursor: pointer; }
.livechat-stars label:has(input:checked) span,
.livechat-stars label:has(~ label input:checked) span { color: #f3d879; }
.livechat-stars input:focus-visible + span { outline: 2px solid #8de1ca; outline-offset: -2px; }
