.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: grid;
  justify-items: end;
  gap: 12px;
  font-family: inherit;
}

.chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 20px;
  border: 1px solid #171715;
  border-radius: 999px;
  background: #ffb800;
  color: #171715;
  box-shadow: 0 10px 28px rgb(23 23 21 / 18%);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgb(23 23 21 / 22%);
}

.chat-launcher:focus-visible,
.chat-close:focus-visible,
.chat-open-link:focus-visible {
  outline: 3px solid #171715;
  outline-offset: 3px;
}

.chat-launcher-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #171715;
  color: #ffb800;
  font-size: 17px;
  line-height: 1;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(380px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 112px));
  min-height: 390px;
  overflow: hidden;
  border: 1px solid rgb(23 23 21 / 14%);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(23 23 21 / 24%);
}

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

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 16px 12px 20px;
  background: #171715;
  color: #fff;
}

.chat-panel-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.chat-close {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

.chat-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.chat-open-link {
  padding: 9px 14px 11px;
  color: #595850;
  font-size: 12px;
  text-align: center;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 520px) {
  .chat-widget {
    right: 12px;
    bottom: 12px;
    gap: 10px;
  }

  .chat-panel {
    width: calc(100vw - 24px);
    height: min(75dvh, 620px);
    min-height: 340px;
    border-radius: 16px;
  }

  .chat-launcher {
    min-height: 50px;
    padding: 0 16px;
  }
}

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