.pop-home-chat {
  position: fixed;
  inset: auto max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) auto;
  z-index: 99999;
  color: #fff8ed;
  font: 15px/1.4 system-ui, sans-serif;
}
.pop-home-chat [hidden] { display: none !important; }
.pop-home-chat *, .pop-home-chat *::before { box-sizing: border-box; }
.pop-home-chat button, .pop-home-chat input { font: inherit; }
.pop-home-chat button { cursor: pointer; }
.pop-home-chat button:disabled { opacity: .6; cursor: wait; }
.pop-home-chat :focus-visible { outline: 2px solid #f4cbff; outline-offset: 3px; }
.pop-home-chat .pop-chat-launch, .pop-home-chat [type="submit"] {
  background: linear-gradient(115deg, #ffe3a1, #e8ae5c);
  color: #25150b;
  border: 1px solid #ffe5b9;
  font-weight: 800;
}
.pop-home-chat .pop-chat-launch {
  border-radius: 999px;
  min-height: 46px;
  padding: 0 17px;
  box-shadow: 0 0 20px #f2ac5455, 0 5px 20px #0009;
}
.pop-home-chat .pop-chat-launch span { color: #66318c; }
.pop-home-chat .pop-chat-panel {
  width: min(370px, calc(100vw - 28px));
  max-height: min(570px, calc(100vh - 28px));
  max-height: min(570px, calc(100dvh - 28px));
  overflow: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid #b98c5b;
  border-radius: 19px;
  background: #1c1423;
  box-shadow: 0 12px 50px #000b;
}
.pop-home-chat .pop-chat-header {
  background: linear-gradient(120deg, #3e271a, #442659);
  border-bottom: 1px solid #9b714b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}
.pop-home-chat .pop-chat-header strong { display: block; font-size: 18px; }
.pop-home-chat .pop-chat-header span { color: #eed5bd; font-size: 12px; }
.pop-home-chat .pop-chat-close, .pop-home-chat .pop-chat-topics button {
  color: #fff5e9;
  background: #30223a;
  border: 1px solid #9d7ca3;
  border-radius: 9px;
}
.pop-home-chat .pop-chat-close { min-width: 44px; min-height: 44px; font-size: 24px; }
.pop-home-chat .pop-chat-log {
  min-height: 82px;
  height: 210px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}
.pop-home-chat .pop-chat-message {
  margin: 0 18px 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: #372844;
  color: #fff8ed;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pop-home-chat .pop-chat-visitor { margin: 0 0 8px 18px; background: #563c27; }
.pop-home-chat .pop-chat-topics, .pop-home-chat .pop-chat-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 8px 12px;
}
.pop-home-chat .pop-chat-topics button { padding: 5px 8px; font-size: 12px; min-height: 32px; }
.pop-home-chat .pop-chat-form { margin: 0; padding: 4px 12px; }
.pop-home-chat .pop-chat-form label { display: block; margin-bottom: 4px; font-size: 12px; }
.pop-home-chat .pop-chat-form div { display: flex; gap: 6px; }
.pop-home-chat .pop-chat-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid #aa91b3;
  border-radius: 9px;
  padding: 6px 9px;
  background: #140d1b;
  color: #fff8ed;
  font-size: 16px;
}
.pop-home-chat [type="submit"] { border-radius: 9px; padding: 0 11px; }
.pop-home-chat .pop-chat-status { margin: 0; padding: 0 12px; color: #efd7f9; font-size: 12px; }
.pop-home-chat .pop-chat-footer { border-top: 1px solid #705e76; }
.pop-home-chat .pop-chat-footer a { color: #ffe1a7; font-size: 13px; text-decoration: underline; }
.pop-home-chat .pop-chat-footer small { width: 100%; color: #e2d3e5; font-size: 11px; }
