.chat-widget {
  position: fixed;
  z-index: 20;
  inset-inline-end: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 24px));
  padding: 0;
  margin: 0;
  border: 0;
  pointer-events: none;
}
.chat-widget > summary {
  display: list-item;
  width: fit-content;
  margin-inline-start: auto;
  padding: 10px 14px;
  border-radius: 9px;
  background: var(--orange);
  color: var(--orange-ink);
  font-weight: 700;
  pointer-events: auto;
}
.chat-card {
  margin-top: 6px;
  padding: 14px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 5px 22px #29150726;
  max-height: calc(100dvh - 82px);
  overflow: auto;
  pointer-events: auto;
}
.chat-hint, [data-chat-status] { margin: 0 0 8px; font-size: .875rem; }
[data-chat-status]:empty { display: none; }
.chat-history, .chat-inbox { padding: 0; margin: 0 0 12px; }
.chat-history {
  display: grid;
  gap: 8px;
  max-height: min(24rem, 36dvh);
  overflow: auto;
}
.chat-history:empty { display: none; }
.chat-history > li, .chat-inbox > li {
  list-style: none;
  padding: 8px 12px;
  margin: 0;
  border: 1px solid var(--line, var(--hairline-color));
  border-radius: 8px;
  overflow-wrap: anywhere;
}
.chat-history > li[data-operator="true"] { border-inline-start: 3px solid var(--orange); }
.chat-history strong, .chat-form label { display: block; font-size: .875rem; }
.chat-history p { margin: 2px 0 0; padding: 0; white-space: pre-wrap; }
.chat-form { display: grid; gap: 6px; }
.chat-form textarea { width: 100%; box-sizing: border-box; font-size: 16px; }
.chat-form .button { justify-self: start; }
.chat-form .button:disabled { opacity: .65; cursor: default; }
.operator-chat { max-width: 720px; }
.chat-inbox > li { margin-bottom: 8px; }
.chat-inbox time { display: block; }
