/* PSG v23 — contextual support assistant. */
.support-assistant {
  position: fixed;
  z-index: 190;
  right: 24px;
  bottom: 104px;
  color: #eaf0f2;
  font-family: inherit;
}

body:has(#app-shell:not([hidden])) .support-assistant {
  bottom: 24px;
}

.support-assistant-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgba(231, 194, 106, 0.55);
  border-radius: 50%;
  color: #11171a;
  background: linear-gradient(145deg, #f2d98c, #bd8628);
  box-shadow: 0 15px 42px rgba(0, 0, 0, 0.32), 0 0 0 7px rgba(205, 166, 83, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.support-assistant-toggle:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 0 9px rgba(205, 166, 83, 0.11);
}

.support-assistant-toggle svg {
  width: 28px;
  height: 28px;
}

.support-assistant-badge {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 13px;
  height: 13px;
  border: 3px solid #091216;
  border-radius: 50%;
  background: #50d7a0;
  box-shadow: 0 0 13px rgba(80, 215, 160, 0.8);
}

.support-assistant.is-open .support-assistant-badge {
  display: none;
}

.support-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto auto;
  width: min(390px, calc(100vw - 32px));
  height: min(590px, calc(100svh - 150px));
  overflow: hidden;
  border: 1px solid rgba(205, 166, 83, 0.26);
  border-radius: 24px 24px 6px 24px;
  background:
    radial-gradient(circle at 90% 0, rgba(205, 166, 83, 0.14), transparent 28%),
    #0b151b;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  transform-origin: right bottom;
  animation: supportPanelIn 180ms ease-out;
}

.support-assistant-panel[hidden] {
  display: none;
}

@keyframes supportPanelIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.support-assistant-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(143, 160, 175, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.support-assistant-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(205, 166, 83, 0.3);
  border-radius: 14px;
  color: #efd17b;
  background: rgba(205, 166, 83, 0.08);
  font-size: 20px;
}

.support-assistant-avatar::after {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 9px;
  height: 9px;
  border: 2px solid #0b151b;
  border-radius: 50%;
  background: #50d7a0;
  content: "";
}

.support-assistant-title strong,
.support-assistant-title span {
  display: block;
}

.support-assistant-title strong {
  color: #f1f4f5;
  font-size: 13px;
}

.support-assistant-title span {
  margin-top: 4px;
  color: #7f929c;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.support-assistant-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(143, 160, 175, 0.15);
  border-radius: 11px;
  color: #9babb3;
  background: rgba(255, 255, 255, 0.025);
  font-size: 20px;
  cursor: pointer;
}

.support-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-height: 0;
  padding: 17px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(205, 166, 83, 0.34) transparent;
}

.support-message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-line;
}

.support-message.is-assistant {
  align-self: flex-start;
  border: 1px solid rgba(143, 160, 175, 0.13);
  border-radius: 5px 15px 15px 15px;
  color: #cbd6db;
  background: rgba(255, 255, 255, 0.045);
}

.support-message.is-user {
  align-self: flex-end;
  border-radius: 15px 5px 15px 15px;
  color: #15191a;
  background: linear-gradient(135deg, #efd582, #c99332);
}

.support-message.is-typing {
  color: #82949d;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.support-message-route {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(205, 166, 83, 0.3);
  border-radius: 10px;
  color: #e8ca74;
  background: rgba(205, 166, 83, 0.07);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.support-assistant-quick {
  display: flex;
  gap: 7px;
  padding: 0 15px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.support-assistant-quick::-webkit-scrollbar {
  display: none;
}

.support-assistant-quick button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(143, 160, 175, 0.16);
  border-radius: 999px;
  color: #aebdc4;
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.support-assistant-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(143, 160, 175, 0.14);
  background: rgba(4, 10, 13, 0.42);
}

.support-assistant-form input {
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(143, 160, 175, 0.18);
  border-radius: 13px;
  outline: none;
  color: #ecf1f3;
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
  font-size: 12px;
}

.support-assistant-form input:focus {
  border-color: rgba(205, 166, 83, 0.55);
  box-shadow: 0 0 0 3px rgba(205, 166, 83, 0.08);
}

.support-assistant-form button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: #11171a;
  background: linear-gradient(145deg, #efd582, #bd8729);
  font-size: 19px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .support-assistant {
    right: 12px;
    bottom: 80px;
  }

  body:has(#app-shell:not([hidden])) .support-assistant {
    bottom: 14px;
  }

  .support-assistant-toggle {
    width: 56px;
    height: 56px;
  }

  .support-assistant-panel {
    bottom: 68px;
    width: calc(100vw - 24px);
    height: min(590px, calc(100svh - 112px));
    border-radius: 20px 20px 5px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-assistant-panel {
    animation: none;
  }

  .support-assistant-toggle {
    transition: none;
  }
}
