#open-chat {
  position: fixed;
  z-index: 8;
  inset-inline-end: clamp(12px, 3vw, 40px);
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #0b3842;
  color: white;
  border: 1px solid #78bab7;
  border-radius: 30px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 18px #071f2930;
}

#open-chat svg {
  width: 20px;
  height: 20px;
}

#consult-chat {
  box-sizing: border-box;
  inset: auto;
  inset-inline-end: clamp(8px, 3vw, 40px);
  bottom: 12px;
  margin: 0;
  width: min(405px, calc(100vw - 16px));
  max-width: 100%;
  max-height: 90dvh;
  padding: 0;
  border: 1px solid #84b1ad;
  border-radius: 18px;
  background: #fff;
  color: #102d37;
  font: inherit;
  box-shadow: 0 18px 56px #091e2c33;
}

#consult-chat[open] {
  display: flex;
  flex-direction: column;
}

#consult-chat::backdrop {
  background: #09283144;
}

.chat-head,
.chat-form {
  padding: 14px 18px;
  flex: none;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #103741;
  color: white;
}
.chat-head h2 {
  font: inherit;
  font-size: 1.12rem;
  font-weight: 600;
  margin: 0;
}
.chat-close,
.chat-prompts button,
.chat-refer,
.chat-form button {
  font: inherit;
  cursor: pointer;
}
.chat-close {
  background: transparent;
  color: white;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.4rem;
}

.chat-history {
  overflow: auto;
  min-height: 60px;
  max-height: 42dvh;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.chat-bubble {
  margin: 0;
  background: #eff6f5;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}
.chat-bubble.visitor {
  align-self: flex-end;
  background: #184c56;
  color: #fff;
}

.chat-prompts {
  padding: 0 14px;
  display: grid;
  gap: 5px;
}
.chat-prompts[hidden] {
  display: none;
}
.chat-prompts button,
.chat-refer {
  background: white;
  border: 1px solid #96bfba;
  border-radius: 9px;
  text-align: start;
  color: #17575a;
  padding: 6px 10px;
}
.chat-refer {
  font-weight: 600;
}
.chat-form {
  display: grid;
  gap: 7px;
  border-top: 1px solid #dde8e6;
  margin-top: 10px;
}
.chat-form label {
  font-size: 0.85rem;
}
.chat-form textarea {
  font: inherit;
  border: 1px solid #6f9193;
  border-radius: 8px;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  max-height: 18dvh;
}
.chat-form button {
  justify-self: end;
  border-radius: 7px;
  border: 0;
  background: #103741;
  color: white;
  padding: 7px 18px;
}
footer {
  padding-bottom: 64px;
}
