.site-chat-trigger,
.site-chat-dialog {
  position: fixed;
  inset: auto max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) auto;
  margin: 0;
}

.site-chat-trigger:not([hidden]) {
  display: grid;
  place-items: center;
  z-index: 10;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 15px;
  background: var(--black);
  box-shadow: 0 6px 20px rgb(0 0 0 / 20%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.site-chat-trigger[data-arrastando] {
  cursor: grabbing;
}

.site-chat-trigger[data-chat-aberto] {
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .site-chat-trigger[data-encaixando] {
    transition: left 320ms cubic-bezier(.2, .75, .25, 1);
  }
}

.site-chat-trigger img {
  display: block;
  pointer-events: none;
}

.site-chat-dialog {
  width: min(820px, calc(100% - 24px));
  height: min(580px, calc(100dvh - 24px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.site-chat-dialog::backdrop {
  background: rgb(0 0 0 / 42%);
  backdrop-filter: blur(3px);
}

@media (prefers-reduced-motion: no-preference) {
  .site-chat-dialog[data-materializando]::backdrop {
    animation: site-chat-escurecer var(--site-chat-duracao) linear both;
  }

  .site-chat-dialog[data-materializando='fechando']::backdrop {
    animation-direction: reverse;
  }
}

@keyframes site-chat-escurecer {
  from { opacity: 0; }
  55%, to { opacity: 1; }
}

.site-chat-fragmentos {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.site-chat-fragmento {
  position: absolute;
  background: url("/assets/images/home/assistente.svg") no-repeat;
  filter: brightness(1) drop-shadow(0 0 2px rgb(0 166 181 / 55%));
}

.site-chat-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 2vh, 22px);
  height: 100%;
  padding: clamp(12px, 3vw, 26px);
  overflow: auto;
  border: 4px solid var(--black);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgb(0 0 0 / 22%);
  transform-origin: top left;
}

.site-chat-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 16px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.site-chat-heading img {
  width: clamp(38px, 7vw, 56px);
  height: auto;
}

.site-chat-identity {
  padding-left: clamp(8px, 2vw, 16px);
  border-left: 1px solid var(--accent);
}

.site-chat-heading h2 {
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  letter-spacing: -.035em;
}

.site-chat-identity p {
  margin-top: 4px;
  color: var(--muted);
  font-size: clamp(.73rem, 1.5vw, .94rem);
  line-height: 1.4;
}

.site-chat-close {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink);
  font-size: 1.45rem;
  cursor: pointer;
}

.site-chat-trigger:focus-visible,
.site-chat-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-chat-conversation {
  min-height: 0;
  overflow-y: auto;
}

.site-chat-greeting {
  width: min(100%, 540px);
  padding: 14px 16px;
  border-inline-start: 4px solid var(--accent);
  border-radius: 14px;
  background: var(--soft);
}

.site-chat-greeting h3 {
  margin-bottom: 6px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  letter-spacing: -.025em;
}

.site-chat-greeting p,
.site-chat-suggestions-label {
  color: var(--muted);
  font-size: .91rem;
}

.site-chat-suggestions-label {
  margin-top: 18px;
  font-weight: 650;
}

.site-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 9px 0 4px;
  padding: 0;
  list-style: none;
}

.site-chat-suggestions li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 12px;
  background: var(--surface);
  font-size: .83rem;
  box-shadow: 0 2px 4px var(--faint-line);
}

.site-chat-suggestions svg,
.site-chat-send svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-chat-suggestions svg {
  color: var(--accent);
}

.site-chat-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--black);
  border-radius: 16px;
  background: var(--white);
  color: var(--black);
}

.site-chat-composer textarea {
  flex: 1;
  min-width: 0;
  padding: 9px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  resize: none;
}

.site-chat-composer textarea::placeholder {
  color: #505050;
  opacity: 1;
}

.site-chat-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--black);
  color: var(--white);
}

.site-chat-send:disabled {
  cursor: not-allowed;
}

.site-chat-status {
  margin: 5px 0 0 2px;
  color: var(--muted);
  font-size: .75rem;
}
