/* Assistente de ajuda do Portal ADM ZWS. Isolado do CSS operacional. */
.zws-help-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 10px 17px 10px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #070810;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.48), 0 0 28px rgba(34, 211, 238, 0.2);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.zws-help-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 17px 42px rgba(0, 0, 0, 0.52), 0 0 34px rgba(139, 92, 246, 0.28);
}

.zws-help-launcher:focus-visible,
.zws-help-panel button:focus-visible,
.zws-help-panel input:focus-visible {
  outline: 3px solid rgba(34, 211, 238, 0.65);
  outline-offset: 2px;
}

.zws-help-launcher-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 6, 11, 0.74);
  font-size: 16px;
}

.zws-help-panel {
  position: fixed;
  right: 24px;
  bottom: 88px;
  z-index: 1201;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  width: min(410px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 116px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background: rgba(9, 11, 22, 0.97);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.64), 0 0 42px rgba(139, 92, 246, 0.14);
  backdrop-filter: blur(22px);
  transform-origin: bottom right;
  animation: zws-help-open 0.18s ease-out;
}

.zws-help-panel[hidden] { display: none; }

@keyframes zws-help-open {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.zws-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.17), rgba(34, 211, 238, 0.08));
}

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

.zws-help-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #090b14;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.zws-help-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border: 2px solid #0a0c17;
  border-radius: 50%;
  background: var(--green);
}

.zws-help-title {
  display: block;
  margin: 0 0 2px;
  color: var(--text-hi);
  font-size: 14px;
}

.zws-help-status {
  display: block;
  overflow: hidden;
  color: var(--text-mid);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zws-help-header-actions { display: flex; gap: 4px; }

.zws-help-icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-mid);
  background: transparent;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.zws-help-icon-btn:hover {
  color: var(--text-hi);
  border-color: var(--panel-border);
  background: rgba(255, 255, 255, 0.06);
}

.zws-help-messages {
  overflow-y: auto;
  padding: 16px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.zws-help-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 13px;
}

.zws-help-message.is-user { justify-content: flex-end; }

.zws-help-message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  color: #090b14;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(34, 211, 238, 0.95));
  font-size: 9px;
  font-weight: 900;
}

.zws-help-bubble {
  max-width: 86%;
  padding: 11px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 15px 15px 15px 5px;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12.5px;
  line-height: 1.52;
}

.zws-help-message.is-user .zws-help-bubble {
  border-color: rgba(139, 92, 246, 0.28);
  border-radius: 15px 15px 5px 15px;
  color: var(--text-hi);
  background: rgba(139, 92, 246, 0.16);
}

.zws-help-bubble strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-hi);
  font-size: 12.5px;
}

.zws-help-bubble p { margin: 0; }
.zws-help-bubble p + p { margin-top: 8px; }

.zws-help-bubble ol,
.zws-help-bubble ul {
  margin: 8px 0 0;
  padding-left: 19px;
}

.zws-help-bubble li { margin: 5px 0; }

.zws-help-note {
  margin-top: 9px !important;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #d9d0ff;
  font-size: 11.5px;
}

.zws-help-action {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 10px;
  color: #d8fbff;
  background: rgba(34, 211, 238, 0.08);
  font: inherit;
  font-size: 11.5px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.zws-help-action:hover { background: rgba(34, 211, 238, 0.14); }

.zws-help-topics {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 13px 8px;
  border-top: 1px solid var(--panel-border);
  scrollbar-width: thin;
}

.zws-help-topic {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.zws-help-topic:hover {
  color: var(--text-hi);
  border-color: rgba(139, 92, 246, 0.45);
  background: rgba(139, 92, 246, 0.1);
}

.zws-help-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 8px;
}

.zws-help-input {
  min-width: 0;
  flex: 1 1 auto;
  height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-hi);
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
  font-size: 12.5px;
}

.zws-help-input::placeholder { color: var(--text-low); }

.zws-help-send {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: #070810;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.zws-help-privacy {
  margin: 0;
  padding: 0 14px 11px;
  color: var(--text-low);
  font-size: 9.5px;
  line-height: 1.35;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .zws-help-panel { animation: none; }
  .zws-help-launcher { transition: none; }
  .zws-help-messages { scroll-behavior: auto; }
}

@media (max-width: 560px) {
  .zws-help-launcher {
    right: 14px;
    bottom: 14px;
  }

  .zws-help-panel {
    right: 8px;
    bottom: 76px;
    width: calc(100vw - 16px);
    height: min(720px, calc(100dvh - 88px));
    border-radius: 18px;
  }
}

@media (max-width: 380px) {
  .zws-help-launcher-label { display: none; }
  .zws-help-launcher { padding-right: 11px; }
  .zws-help-panel { bottom: 74px; }
}
