.support-chat {
  --chat-accent: #155b58;
  --chat-ink: #172f33;
  --chat-border: #d9e5e2;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 1200;
  color: var(--chat-ink);
  font: 14px/1.55 var(--body-face, system-ui, sans-serif);
}
.support-chat *, .support-chat *::before, .support-chat *::after { box-sizing: border-box; }
.support-chat [hidden] { display: none !important; }
.support-chat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 22px;
  padding: 2px 6px;
  margin-left: auto;
  border-radius: 999px;
  background: #f6d089;
  color: #422e0d;
  font: 700 12px/1.5 system-ui, sans-serif;
}
.support-chat-badge[hidden] { display: none; }
.support-chat-thread-unread { display: inline-block; margin-top: 4px; color: #155b58; font-size: 12px; }
.support-chat button, .support-chat textarea { font: inherit; margin: 0; }
.support-chat button { cursor: pointer; }
.support-chat button:disabled { cursor: default; opacity: .55; }
.support-chat :focus-visible { outline: 3px solid #268e87; outline-offset: 3px; }
.support-chat-launch, .support-chat-form button, .support-chat-profile button {
  border: 0;
  background: var(--chat-accent);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}
.support-chat-launch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto !important;
  padding: 12px 17px;
  border-radius: 999px;
  border: 1px solid #378a73;
  background: linear-gradient(#3a927e, #156553 55%, #124f43);
  box-shadow: inset 0 1px #b6f1cc87, 0 4px 0 #0c483b, 0 9px 22px #153f3e66;
  transition: transform .2s ease, box-shadow .2s ease;
}
.support-chat-launch:hover { transform: translateY(-2px); box-shadow: inset 0 1px #b6f1cc9c, 0 6px 0 #0c483b, 0 11px 24px #153f3e66; }
.support-chat-launch:active { transform: translateY(2px); box-shadow: inset 0 1px #b6f1cc87, 0 2px 0 #0c483b, 0 6px 15px #153f3e66; }
.support-chat-icon {
  position: relative;
  width: 18px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 5px;
}
.support-chat-icon::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 2px;
  width: 5px;
  height: 5px;
  transform: skewY(-34deg);
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: var(--chat-accent);
}
.support-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 42px));
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  box-shadow: 0 16px 44px #142f3433;
}
.support-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--chat-accent);
  color: #fff;
}
.support-chat-header h2 { color: inherit; font: 650 17px/1.4 system-ui, sans-serif; margin: 0; }
.support-chat-header button {
  width: 36px;
  height: 36px;
  border: 1px solid #ffffff70;
  border-radius: 8px;
  color: #fff;
  background: transparent;
  font-size: 25px;
}
.support-chat-profile { display: grid; gap: 10px; padding: 16px; margin: 0; overflow: auto; }
.support-chat-profile p { margin: 0; }
.support-chat-profile label { display: grid; gap: 4px; font-weight: 600; margin: 0; }
.support-chat-profile :is(input, select) {
  width: 100%; min-height: 39px; margin: 0; padding: 6px 9px; border: 1px solid #9bafad;
  border-radius: 8px; background: #fff; color: var(--chat-ink); font: inherit; font-size: 16px;
}
.support-chat-profile .support-chat-profile-hint { font-size: 12px; color: #466167; }
.support-chat-profile button { justify-self: start; padding: 9px 13px; border-radius: 8px; }
.support-chat-inbox, .support-chat-conversation { display: flex; flex-direction: column; min-height: 0; }
.support-chat-inbox ul, .support-chat-messages {
  padding: 12px;
  margin: 0;
  list-style: none;
  overflow: auto;
  overscroll-behavior: contain;
}
.support-chat-inbox ul { min-height: 72px; max-height: 360px; }
.support-chat-inbox li + li { margin-top: 6px; }
.support-chat-inbox li button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  background: #f7faf9;
  color: var(--chat-ink);
  text-align: left;
}
.support-chat-inbox li span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #466167;
}
.support-chat-pages, .support-chat-thread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--chat-border);
}
.support-chat-thread { justify-content: flex-start; }
.support-chat-session { justify-content: space-between; }
.support-chat-session button { flex: none; }
.support-chat-thread strong { overflow-wrap: anywhere; }
.support-chat-thread small { display: block; color: #466167; overflow-wrap: anywhere; }
.support-chat-thread small:empty { display: none; }
.support-chat-pages button, .support-chat-thread button, .support-chat-older {
  padding: 5px 9px;
  border: 1px solid var(--chat-border);
  border-radius: 7px;
  color: var(--chat-accent);
  background: #fff;
}
.support-chat-older { align-self: center; margin-top: 8px !important; }
.support-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: clamp(120px, 39vh, 330px);
  background: #f5f8f8;
}
.support-chat-messages:empty { display: none; }
.support-chat-messages li {
  align-self: flex-start;
  max-width: 90%;
  padding: 8px 11px;
  background: #fff;
  border: 1px solid var(--chat-border);
  border-radius: 12px 12px 12px 4px;
  overflow-wrap: anywhere;
}
.support-chat-messages .support-chat-own {
  align-self: flex-end;
  background: #e0f2eb;
  border-radius: 12px 12px 4px 12px;
}
.support-chat-messages li p { margin: 4px 0 0; white-space: pre-wrap; }
.support-chat-messages li small { color: #466167; font-size: 11px; }
.support-chat-form {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--chat-border);
}
.support-chat-form textarea {
  flex: 1;
  width: 0;
  min-height: 45px;
  padding: 7px;
  resize: vertical;
  border: 1px solid #9bafad;
  border-radius: 8px;
  font-size: 16px;
}
.support-chat-form button { padding: 9px 13px; border-radius: 8px; }
.support-chat-empty, .support-chat-status { margin: 0; padding: 9px 12px; color: #38545a; }
.support-chat-status { border-top: 1px solid var(--chat-border); }
@media (prefers-reduced-motion: reduce) {
  .support-chat-launch { transition: none; }
}
