:root {
  --saa-z: 90;
  --saa-text: #f7f8f3;
  --saa-answer-text: rgba(247, 248, 243, 0.96);
  --saa-muted: rgba(247, 248, 243, 0.72);
  --saa-line: rgba(247, 248, 243, 0.18);
  --saa-lime: #b9ff4f;
  --saa-red: #ff4d3d;
  --saa-bg: rgba(7, 10, 12, 0.42);
  --saa-card: rgba(7, 10, 12, 0.76);
  --saa-user: rgba(247, 248, 243, 0.9);
  --saa-radius: 26px;
  --saa-radius-sm: 16px;
  --saa-duration: 220ms;
  --saa-ease: cubic-bezier(.2, 0, .18, 1);
  --viewport-safe-height: 100svh;
}

.saa-root,
.saa-root *,
.saa-root *::before,
.saa-root *::after {
  min-width: 0;
  box-sizing: border-box;
}

html.static-answer-assistant-locked,
html.static-answer-assistant-locked body,
body.static-answer-assistant-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.static-answer-assistant-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  min-height: 100%;
}

.saa-root {
  position: relative;
  z-index: var(--saa-z);
  color: var(--saa-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.saa-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: calc(var(--saa-z) + 1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 17px;
  border: 1px solid rgba(247, 248, 243, 0.24);
  border-radius: 999px;
  background: rgba(7, 10, 12, 0.58);
  color: var(--saa-text);
  box-shadow: 0 18px 64px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  transition: transform var(--saa-duration) var(--saa-ease), border-color var(--saa-duration) var(--saa-ease), background var(--saa-duration) var(--saa-ease);
}

.saa-launcher:hover,
.saa-launcher:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(185, 255, 79, 0.66);
  outline: none;
}

.saa-launcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--saa-lime);
  box-shadow: 0 0 18px rgba(185, 255, 79, 0.56);
}

.saa-backdrop {
  position: fixed;
  inset: var(--saa-viewport-top, 0px) 0 auto 0;
  height: var(--saa-viewport-height, 100dvh);
  z-index: var(--saa-z);
  pointer-events: none;
  opacity: 0;
  background: rgba(2, 4, 5, 0.22);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity var(--saa-duration) var(--saa-ease);
}

.saa-panel {
  position: fixed;
  inset: var(--saa-viewport-top, 0px) 0 auto 0;
  z-index: calc(var(--saa-z) + 2);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: var(--saa-viewport-height, var(--viewport-safe-height));
  min-height: var(--saa-viewport-height, var(--viewport-safe-height));
  max-height: var(--saa-viewport-height, var(--viewport-safe-height));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: auto;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(7, 10, 12, 0.52), rgba(7, 10, 12, 0.24)),
    linear-gradient(90deg, rgba(185, 255, 79, 0.06), transparent 40%, rgba(255, 77, 61, 0.04)),
    rgba(7, 10, 12, 0.26);
  box-shadow: none;
  backdrop-filter: blur(28px) saturate(1.45);
  -webkit-backdrop-filter: blur(28px) saturate(1.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--saa-duration) var(--saa-ease), transform var(--saa-duration) var(--saa-ease);
}

.saa-root.is-open .saa-backdrop,
.saa-root.is-open .saa-panel {
  opacity: 1;
  pointer-events: auto;
}

.saa-root.is-open {
  position: fixed;
  inset: var(--saa-viewport-top, 0px) 0 auto 0;
  z-index: var(--saa-z);
  width: 100%;
  max-width: 100%;
  height: var(--saa-viewport-height, var(--viewport-safe-height));
  overflow: hidden;
  overscroll-behavior: contain;
}

.saa-root.is-open .saa-panel {
  transform: translateY(0);
}

.saa-root.is-open .saa-launcher {
  opacity: 0;
  pointer-events: none;
}

.saa-header {
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: calc(20px + env(safe-area-inset-top)) 0 14px;
  border-bottom: 1px solid var(--saa-line);
}

.saa-eyebrow {
  margin: 0 0 4px;
  color: var(--saa-lime);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.saa-title {
  margin: 0;
  color: var(--saa-text);
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.saa-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(247, 248, 243, 0.18);
  border-radius: 999px;
  background: rgba(7, 10, 12, 0.48);
  color: var(--saa-text);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.saa-messages {
  width: min(880px, calc(100% - 40px));
  min-height: 300px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
  padding: 22px 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.saa-message {
  max-width: min(760px, 92%);
  border-radius: var(--saa-radius-sm);
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.44;
}

.saa-message.assistant {
  justify-self: start;
  background:
    linear-gradient(135deg, rgba(7, 10, 12, 0.92), rgba(7, 10, 12, 0.78)),
    rgba(7, 10, 12, 0.88);
  border: 1px solid rgba(247, 248, 243, 0.18);
  color: var(--saa-answer-text);
  -webkit-text-fill-color: var(--saa-answer-text);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.42);
}

.saa-message.saa-welcome {
  max-width: min(620px, 100%);
  padding: 18px;
  background: rgba(7, 10, 12, 0.38);
  border-color: rgba(247, 248, 243, 0.1);
}

.saa-welcome-kicker {
  margin: 0 0 6px;
  color: rgba(185, 255, 79, 0.92);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.saa-message.user {
  justify-self: end;
  background: var(--saa-user);
  color: #091006;
}

.saa-answer-title {
  margin: 0 0 8px;
  color: var(--saa-lime);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.saa-response-line {
  margin: 0 0 10px;
  color: var(--saa-answer-text);
  -webkit-text-fill-color: var(--saa-answer-text);
}

.saa-stream-text {
  color: var(--saa-answer-text);
  -webkit-text-fill-color: var(--saa-answer-text);
}

.saa-response-line:last-of-type {
  margin-bottom: 0;
}

.saa-message.is-pending {
  min-width: 82px;
}

.saa-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.saa-typing span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(185, 255, 79, 0.82);
  opacity: 0.42;
  animation: saaTypingPulse 920ms var(--saa-ease) infinite;
}

.saa-typing span:nth-child(2) {
  animation-delay: 120ms;
}

.saa-typing span:nth-child(3) {
  animation-delay: 240ms;
}

.saa-stream-text.is-active::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 2px;
  border-right: 2px solid rgba(185, 255, 79, 0.82);
  transform: translateY(2px);
  animation: saaCaretBlink 680ms steps(2, start) infinite;
}

.saa-links,
.saa-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.saa-link,
.saa-chip {
  border: 1px solid rgba(247, 248, 243, 0.18);
  border-radius: 999px;
  background: rgba(247, 248, 243, 0.08);
  color: var(--saa-text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  padding: 9px 10px;
  text-transform: uppercase;
}

.saa-link {
  text-decoration: none;
}

.saa-link:hover,
.saa-chip:hover,
.saa-link:focus-visible,
.saa-chip:focus-visible {
  border-color: rgba(185, 255, 79, 0.56);
  outline: none;
}

.saa-faq-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.saa-faq-label {
  margin: 0;
  color: rgba(247, 248, 243, 0.52);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.saa-faq-button {
  width: 100%;
  border: 1px solid rgba(247, 248, 243, 0.12);
  border-radius: 14px;
  background: rgba(247, 248, 243, 0.07);
  color: rgba(247, 248, 243, 0.92);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
  padding: 10px 12px;
  text-align: left;
}

.saa-faq-button:hover,
.saa-faq-button:focus-visible {
  border-color: rgba(185, 255, 79, 0.5);
  background: rgba(247, 248, 243, 0.1);
  outline: none;
}

.saa-form {
  width: min(880px, calc(100% - 40px));
  display: grid;
  gap: 8px;
  margin: 0 auto;
  padding: 14px 0 calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--saa-line);
  background: transparent;
  overscroll-behavior: contain;
}

.saa-composer {
  display: grid;
  gap: 10px;
  min-height: 112px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(247, 248, 243, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(247, 248, 243, 0.09), rgba(247, 248, 243, 0.035)),
    rgba(7, 10, 12, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(247, 248, 243, 0.1),
    0 14px 42px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
}

.saa-input {
  min-width: 0;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--saa-text);
  padding: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  outline: none;
  resize: none;
}

.saa-input::placeholder {
  color: rgba(247, 248, 243, 0.36);
}

.saa-composer:focus-within {
  border-color: rgba(185, 255, 79, 0.42);
  background:
    linear-gradient(135deg, rgba(185, 255, 79, 0.07), rgba(247, 248, 243, 0.04)),
    rgba(7, 10, 12, 0.5);
}

.saa-composer-actions {
  display: flex;
  align-items: center;
}

.saa-composer-actions {
  justify-content: flex-end;
  gap: 12px;
}

.saa-submit {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(247, 248, 243, 0.2);
  border-radius: 999px;
  background: rgba(247, 248, 243, 0.12);
  color: rgba(247, 248, 243, 0.88);
  cursor: pointer;
  font-size: 22px;
  font-weight: 450;
  line-height: 1;
  padding: 0 0 2px;
  transition: background var(--saa-duration) var(--saa-ease), border-color var(--saa-duration) var(--saa-ease), color var(--saa-duration) var(--saa-ease), transform var(--saa-duration) var(--saa-ease);
}

.saa-submit:hover,
.saa-submit:focus-visible {
  border-color: rgba(185, 255, 79, 0.62);
  background: rgba(185, 255, 79, 0.18);
  color: var(--saa-lime);
  outline: none;
  transform: translateY(-1px);
}

.saa-note {
  display: none;
  color: var(--saa-muted);
  font-size: 11px;
  font-weight: 650;
}

.saa-error {
  color: #ffd8d3;
}

@media (max-width: 720px) {
  .saa-launcher {
    right: 14px;
    bottom: 14px;
    min-height: 46px;
  }

  .saa-panel {
    inset: var(--saa-viewport-top, 0px) 0 auto 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: var(--saa-viewport-height, var(--viewport-safe-height));
    min-height: var(--saa-viewport-height, var(--viewport-safe-height));
    max-height: var(--saa-viewport-height, var(--viewport-safe-height));
    border-radius: 0;
  }

  .saa-header,
  .saa-messages,
  .saa-form {
    width: min(100% - 28px, 680px);
  }

  .saa-messages {
    min-height: 0;
    padding: 16px 0;
  }

  .saa-form {
    padding: 12px 0 16px;
  }

  .saa-message {
    max-width: 100%;
  }

  .saa-composer {
    min-height: 106px;
    padding: 16px 16px 12px;
    border-radius: 22px;
  }

  .saa-input {
    font-size: 16px;
  }

  .saa-submit {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  .saa-faq-button {
    font-size: 12px;
    padding: 9px 10px;
  }
}

@supports (height: 100dvh) {
  :root {
    --viewport-safe-height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .saa-launcher,
  .saa-backdrop,
  .saa-panel,
  .saa-link,
  .saa-chip,
  .saa-faq-button,
  .saa-submit,
  .saa-typing span,
  .saa-stream-text.is-active::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

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

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

@keyframes saaCaretBlink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}
