.chat-launcher {
  position: fixed;
  bottom: 1.6875rem;
  right: 1.8125rem;
  width: 3.375rem;
  height: 3.375rem;
  border-radius: 0.1875rem;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  box-shadow:
    0 0.5rem 2.1875rem #9be4c530,
    0 0.1875rem 0.9375rem #0003;
  border: 0.0625rem solid #ffffff20;
  z-index: 80;
  transition:
    transform 0.2s,
    background 0.2s;
}
.chat-launcher:hover {
  transform: translateY(-0.25rem);
  background: var(--accent-hover);
}
.chat-launcher > .icon {
  width: 1.5rem;
  height: 1.5rem;
}
.launcher-dot {
  position: absolute;
  right: 0.625rem;
  top: 0.625rem;
  width: 0.3125rem;
  height: 0.3125rem;
  border-radius: 50%;
  background: #fff;
  border: 0.0625rem solid var(--accent);
}
.chat-launcher[aria-expanded="true"] {
  transform: scale(0.8);
  opacity: 0;
  pointer-events: none;
}
.support-panel {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 23.875rem;
  height: min(38.125rem, calc(100dvh - 7.1875rem));
  display: flex;
  flex-direction: column;
  border: 0.0625rem solid var(--line-strong);
  border-radius: 0.1875rem;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1.5625rem 6.25rem #0007;
  z-index: 85;
  animation: chat-in 0.22s ease-out;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 1.1875rem 1.3125rem;
  border-bottom: 0.0625rem solid var(--line);
  background: var(--surface-2);
}
.chat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent);
  border-radius: 0.1875rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  font-style: italic;
}
.chat-avatar > span {
  position: absolute;
  bottom: -0.125rem;
  right: -0.125rem;
  border: 0.125rem solid var(--surface-2);
  width: 0.5625rem;
  height: 0.5625rem;
  background: var(--subtle);
  border-radius: 50%;
}
.chat-header h2 {
  font-size: 0.8125rem;
  letter-spacing: -0.0125rem;
}
.chat-header p {
  font-size: 0.5625rem;
  margin-top: 0.25rem;
}
.chat-header > .icon-button {
  margin-left: auto;
  width: 1.75rem;
  height: 1.75rem;
}
.chat-header > .icon-button > .icon {
  width: 1.0625rem;
  height: 1.0625rem;
}
.chat-messages {
  overflow-y: auto;
  flex: 1;
  padding: 1.5rem 1.3125rem;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}
.chat-welcome-icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  background: #9be4c510;
  border: 0.0625rem solid #9be4c51d;
  border-radius: 0.1875rem;
  color: var(--accent);
  margin-bottom: 0.9375rem;
}
.chat-welcome-icon > .icon {
  width: 1.125rem;
  height: 1.125rem;
}
.chat-welcome h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.625rem;
}
.chat-welcome p {
  font-size: 0.6875rem;
  line-height: 1.9;
}
.chat-message {
  margin-top: 1.3125rem;
  padding: 0.875rem 0.9375rem;
  border: 0.0625rem solid var(--line-strong);
  border-radius: 0.1875rem 0.625rem 0.125rem 0.625rem;
  background: var(--surface-2);
  margin-left: 1.375rem;
  overflow-wrap: anywhere;
}
.chat-message .message-category {
  font-size: 0.5rem;
  letter-spacing: 0.01875rem;
  color: var(--accent);
  font-weight: 700;
}
.chat-message p {
  font-size: 0.75rem;
  line-height: 1.8;
  margin-top: 0.3125rem;
  white-space: pre-wrap;
  color: var(--text);
}
.chat-message small {
  display: block;
  text-align: right;
  font-size: 0.4375rem;
  color: var(--subtle);
  margin-top: 0.5625rem;
}
.chat-composer {
  padding: 0 1.0625rem 0.8125rem;
  flex-shrink: 0;
}
.chat-categories {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  padding-block: 0.8125rem;
}
.chat-categories > button {
  border: 0.0625rem solid var(--line-strong);
  border-radius: 0.3125rem;
  font-size: 0.5625rem;
  padding: 0.375rem 0.5625rem;
  color: var(--muted);
}
.chat-categories > button.active {
  background: #9be4c50e;
  color: var(--accent);
  border-color: #9be4c540;
}
.chat-categories > button:hover {
  border-color: var(--accent);
}
#chat-form {
  position: relative;
  border: 0.0625rem solid var(--line-strong);
  border-radius: 0.1875rem;
  background: var(--bg);
  min-height: 4.5625rem;
}
#chat-form:focus-within {
  border-color: #9be4c560;
}
#chat-input {
  width: 100%;
  display: block;
  resize: none;
  max-height: 8.125rem;
  height: 4.8125rem;
  padding: 0.75rem 2.6875rem 0.75rem 0.8125rem;
  border: 0;
  outline: none;
  background: none;
  color: var(--text);
  font-size: 0.6875rem;
  line-height: 1.8;
}
#chat-input::placeholder {
  color: var(--subtle);
}
.chat-send {
  position: absolute;
  bottom: 0.625rem;
  right: 0.5625rem;
  width: 1.875rem;
  height: 1.875rem;
  background: var(--accent);
  border-radius: 0.375rem;
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}
.chat-send:hover {
  background: var(--accent-hover);
}
.chat-send .icon {
  width: 0.875rem;
  height: 0.875rem;
}
.chat-disclaimer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
  margin-top: 0.625rem;
  font-size: 0.4375rem;
  color: var(--subtle);
  text-align: center;
}
.chat-disclaimer .icon {
  width: 0.5625rem;
  height: 0.5625rem;
}
.chat-is-open .chat-launcher {
  pointer-events: none;
}
@keyframes chat-in {
  from {
    opacity: 0;
    transform: translateY(0.75rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 840px) {
  .chat-launcher {
    bottom: 1.1875rem;
    right: 1.1875rem;
    width: 3.0625rem;
    height: 3.0625rem;
    border-radius: 0.1875rem;
  }
  .chat-launcher > .icon {
    width: 1.375rem;
    height: 1.375rem;
  }
  .support-panel {
    bottom: 0.9375rem;
    right: 0.9375rem;
    width: min(23.875rem, calc(100% - 1.875rem));
    height: min(38.125rem, calc(100dvh - 6.5625rem));
    border-radius: 0.1875rem;
  }
  .chat-header {
    padding: 1.0625rem;
  }
  .chat-messages {
    padding: 1.375rem 1.0625rem;
  }
  .chat-welcome h3 {
    font-size: 1.125rem;
  }
  .chat-welcome p {
    font-size: 0.75rem;
  }
  .chat-categories > button {
    font-size: 0.625rem;
    padding: 0.4375rem 0.5625rem;
  }
  #chat-input {
    font-size: 1rem;
    height: 5.4375rem;
    line-height: 1.6;
  }
  #chat-input::placeholder {
    font-size: 0.75rem;
  }
  .chat-disclaimer {
    font-size: 0.4375rem;
  }
  .chat-message p {
    font-size: 0.8125rem;
  }
  .chat-message small {
    font-size: 0.5rem;
  }
}
