.help-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: block;
}

.help-chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 18px 42px rgba(15, 123, 255, 0.34);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  opacity: 1;
  visibility: visible;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.help-chat-toggle svg {
  width: 22px;
  height: 22px;
}

.help-chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  width: min(380px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 112px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 26px 82px rgba(22, 32, 51, 0.22);
}

.help-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  color: #fff;
  background: var(--blue);
}

.help-chat-header strong,
.help-chat-header span {
  display: block;
}

.help-chat-header span {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.86;
}

.help-chat-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.help-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px;
  background: var(--surface);
}

.help-chat-message {
  max-width: 86%;
  border-radius: 16px;
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.45;
}

.help-chat-message.bot {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 8px 22px rgba(22, 32, 51, 0.06);
}

.help-chat-message.user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  color: #fff;
  background: var(--blue);
}

.help-chat-message strong {
  display: block;
  margin-bottom: 6px;
}

.help-chat-message ol,
.help-chat-message ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.help-chat-message li + li {
  margin-top: 6px;
}

.help-chat-feedback {
  align-self: flex-start;
}

.help-chat-feedback button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.help-chat-feedback button:hover,
.help-chat-feedback button:focus-visible {
  color: var(--blue);
  border-color: rgba(15, 123, 255, 0.35);
  outline: none;
}

.help-chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.help-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  animation: chatTyping 1s infinite ease-in-out;
}

.help-chat-typing span:nth-child(2) {
  animation-delay: 0.14s;
}

.help-chat-typing span:nth-child(3) {
  animation-delay: 0.28s;
}

@keyframes chatTyping {
  0%,
  80%,
  100% {
    opacity: 0.38;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.help-chat-suggestions {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
}

.help-chat-suggestions button {
  flex: 0 0 auto;
  max-width: 240px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--blue);
  background: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.help-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
  background: #fff;
}

.help-chat-form input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
}

.help-chat-form input:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 123, 255, 0.14);
}

.help-chat-form button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}


.help-chat [hidden] { display: none !important; }
.help-chat-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.help-chat-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.help-chat-message ol, .help-chat-message ul { white-space: normal; }
.help-chat-suggestions button, .help-chat-feedback button, .help-chat-header span { font-size: 14px; }
.help-chat-form button:disabled { opacity: .6; cursor: wait; }
.support-guides { margin-top: 36px; }
.support-guides details { padding: 16px 0; border-bottom: 1px solid var(--line); }
.support-guides summary { font-weight: 600; cursor: pointer; }
.support-guides p { white-space: pre-wrap; line-height: 1.7; }
@media (max-width: 600px) {
  .help-chat { right: 16px; bottom: 16px; }
  .help-chat-panel { position: fixed; inset: auto 12px 82px; width: auto; max-height: calc(100dvh - 104px); }
  .help-chat-messages { min-height: 0; }
}
@media (max-height: 550px) {
  .help-chat-panel { grid-template-rows: auto minmax(60px, 1fr) auto auto; max-height: calc(100dvh - 100px); }
}
@media (prefers-reduced-motion: reduce) { .help-chat-typing span { animation: none; } }
