html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050505;
  color: #f5f5f5;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
.chat-app {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--app-offset, 0px);
  height: var(--app-height, 100dvh);
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top, #1a2a00, #050505 46%);
}
.chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid #2a2a2a;
  background: rgba(5, 5, 5, .92);
}
.chat-head a {
  color: #c6ff00;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 8px 4px;
}
.chat-head strong {
  font-size: 16px;
  letter-spacing: .03em;
}
.chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-empty {
  margin: auto;
  text-align: center;
  color: #9a9a9a;
  font-size: 14px;
  line-height: 1.4;
  max-width: 16em;
}
.chat-msg {
  max-width: 86%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.client {
  margin-left: auto;
  background: #2a3300;
  color: #eaffb0;
}
.chat-msg.staff {
  margin-right: auto;
  background: #1a1a1a;
}
.chat-msg time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: .65;
}
.chat-form {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid #2a2a2a;
  background: #0b0b0b;
}
.chat-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.chat-form input,
.chat-form textarea,
.chat-form button {
  width: 100%;
  border-radius: 12px;
  font: inherit;
  font-size: 16px;
}
.chat-form input,
.chat-form textarea {
  border: 1px solid #2a2a2a;
  background: #121212;
  color: inherit;
  padding: 10px 12px;
}
.chat-form textarea {
  min-height: 72px;
  resize: none;
}
.chat-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
  color: #9a9a9a;
}
.chat-consent input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 1px;
  flex: 0 0 auto;
  accent-color: #c6ff00;
}
.chat-consent a { color: #c6ff00; font-weight: 700; }
.chat-form button[type="submit"] {
  border: 0;
  padding: 12px;
  background: #c6ff00;
  color: #050505;
  font-weight: 800;
}
.chat-form button[type="submit"]:disabled { opacity: .55; }
.chat-error { color: #ff8a8a; font-size: 13px; min-height: 1em; }
@media (max-width: 520px) {
  .chat-form .row { grid-template-columns: 1fr; }
}
