/* Zenquire chat widget (assets/chat.js). Uses the colour tokens from site.css, so light and dark follow the site. */
.zq-chat-launch {
  position: fixed; z-index: 30;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  font: 600 .95rem/1.2 var(--f-body); padding: .8rem 1.25rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  cursor: pointer; box-shadow: 0 10px 24px -10px var(--shadow);
}
.zq-chat-launch:hover { filter: brightness(1.08); }
.zq-chat-launch:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.zq-chat-launch[aria-expanded="true"] { background: var(--surface); color: var(--accent); }

.zq-chat {
  position: fixed; z-index: 31;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 3.6rem);
  width: min(380px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 6rem)); max-height: min(560px, calc(100dvh - 6rem));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 24px 50px -20px var(--shadow);
  overflow: hidden;
}
@media (max-width: 480px) {
  .zq-chat { left: 12px; right: 12px; width: auto; }
}
.zq-chat-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.zq-chat-head h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.zq-chat-close { font: 600 1.4rem/1 var(--f-body); background: none; border: 0; color: var(--ink); cursor: pointer; padding: .2rem .5rem; border-radius: 8px; min-width: 44px; min-height: 44px; }
.zq-chat-close:hover { color: var(--accent); }

.zq-chat-notice { padding: 1rem; display: flex; flex-direction: column; gap: .9rem; font-size: .9rem; overflow-y: auto; }
.zq-chat-start { align-self: flex-start; }

.zq-chat-log { flex: 1 1 auto; min-height: 8rem; overflow-y: auto; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem; font-size: .92rem; overscroll-behavior: contain; }
.zq-msg { max-width: 88%; padding: .55rem .8rem; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.zq-msg p { margin: 0; }
.zq-assistant { align-self: flex-start; background: var(--sunk); border-bottom-left-radius: 4px; }
.zq-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.zq-user a { color: inherit; }
.zq-note { background: var(--signal-soft); }
.zq-failed { opacity: .75; }
.zq-failed-note { display: block; font-size: .75rem; margin-top: .2rem; }
.zq-typing { letter-spacing: .2em; color: var(--muted); }

.zq-chat-status { font-size: .8rem; color: var(--muted); padding: 0 1rem; min-height: 0; }
.zq-chat-status:empty { display: none; }

.zq-chat-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; padding: .7rem 1rem .8rem; border-top: 1px solid var(--line); }
.zq-chat-form textarea {
  font: 400 1rem var(--f-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--field-line); border-radius: 10px; padding: .55rem .7rem; width: 100%; min-width: 0; resize: none; max-height: 8rem;
}
.zq-chat-send { padding: .65rem 1rem; }
.zq-chat-hint { grid-column: 1 / -1; font-size: .75rem; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .zq-chat:not([hidden]) { animation: zq-chat-in .16s ease-out; }
  @keyframes zq-chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print { .zq-chat, .zq-chat-launch { display: none !important; } }
