html.support-chat-open {
  overflow: hidden;
  scrollbar-gutter: stable;
}

.support-chat {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 48px));
  height: min(820px, calc(100vh - 48px));
  height: min(820px, calc(100dvh - 48px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--glass-edge);
  border-radius: 24px;
  box-shadow: 0 32px 100px rgba(2, 6, 23, .4);
}

.support-chat::backdrop {
  background: rgba(2, 6, 23, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.support-chat-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.support-chat-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.support-chat-heading,
.support-chat-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.support-chat-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #8b5cf6, #ec4899);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
}

.support-chat-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -.3px;
}

.support-chat-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.support-chat-tools {
  flex: 0 0 auto;
  gap: 6px;
}

.support-chat-tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink2);
  background: var(--soft2);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.support-chat-tool svg {
  width: 19px;
  height: 19px;
}

.support-chat-tool:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.support-chat-tool:active {
  transform: scale(.96);
}

.support-chat-content {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #f5f5f7;
}

.support-chat-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  color-scheme: light;
}

.support-chat-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  font-size: 14px;
}

.support-chat-loading[hidden] {
  display: none;
}

.support-chat-loading a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .support-chat-tool:hover {
    color: var(--accent);
    background: var(--chip);
  }
}

@media (max-width: 600px) {
  .support-chat {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .support-chat-header {
    gap: 8px;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  }

  .support-chat-heading {
    gap: 9px;
  }

  .support-chat-title {
    font-size: 15px;
  }

  .support-chat-subtitle {
    font-size: 11px;
  }

  .support-chat-content {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-chat-tool {
    transition: none;
  }

  .support-chat-tool:active {
    transform: none;
  }
}
