/* Site chat widget (js/chat.js). Uses the palette in app.css :root */
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 10000; font-family: var(--font-sans); }
.chat-toggle {
  background: var(--color-bay); color: #fff; border: 0; border-radius: 999px;
  padding: 12px 18px; font: 500 .95rem var(--font-sans); cursor: pointer;
  box-shadow: 0 4px 14px rgba(27, 73, 101, .3);
}
.chat-toggle:hover { background: #163c54; }
.chat-panel {
  width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; background: var(--color-shore);
  border: 1px solid var(--color-border); border-radius: 10px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--color-bay); color: #fff; padding: 10px 14px;
  font: 600 1rem var(--font-serif);
}
.chat-close { background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg {
  margin: 0; padding: 9px 12px; border-radius: 10px; max-width: 85%;
  font-size: .92rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere;
}
.chat-assistant { background: #fff; border: 1px solid var(--color-border); color: var(--color-text); align-self: flex-start; }
.chat-user { background: var(--color-marsh); color: #fff; align-self: flex-end; }
.chat-msg a { color: var(--color-bay); text-decoration: underline; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--color-border); background: #fff; }
.chat-form textarea {
  flex: 1; resize: none; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 8px; font: 16px var(--font-sans); /* 16px stops iPhone zooming in */
}
.chat-form .btn { align-self: flex-end; }
.chat-form button:disabled { opacity: .6; }
.chat-note { margin: 0; padding: 4px 10px 8px; font-size: .75rem; color: var(--color-muted); background: #fff; }
.chat-note a { color: var(--color-muted); }
.chat-sr { position: absolute; left: -9999px; }
@media (max-width: 480px) {
  .chat { right: 8px; bottom: 8px; }
  .chat-panel { height: 70vh; }
}
@media print { .chat { display: none; } }
