/* Ask Max: the chat inside the corner panel.
   The widget script used to inject these rules with a <style> tag, which this
   site's Content-Security-Policy (style-src 'self') refuses, so the chat
   rendered as raw text and a default button. They live here instead, linked
   from every page with data-max-chat-css, which also tells the script not to
   try the injection. */

.max-chat {
  --mc-ink: var(--ink, #003E32);
  --mc-text: var(--text, #1E4A40);
  --mc-mint: var(--mint, #1DDC7C);
  --mc-soft: var(--soft, #F2F7F4);
  --mc-border: var(--border, #DCE7DF);
  --mc-muted: var(--muted, #5E7569);
  --mc-green: var(--green, #087951);
  --mc-red-ink: #8A2B1E;
  --mc-red-bg: #F3DEDA;
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  border-top: 1px solid var(--mc-border);
  padding-top: 12px;
  font-family: "Instrument Sans", Helvetica, Arial, sans-serif;
}

/* The conversation scrolls; the input stays put underneath it. */
.max-chat__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(48vh, 400px);
  overflow-y: auto;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
}

.max-chat__msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--mc-text);
}
.max-chat__msg.max { background: var(--mc-soft); align-self: flex-start; border-bottom-left-radius: 4px; }
.max-chat__msg.me { background: var(--mc-ink); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.max-chat__msg.err { background: var(--mc-red-bg); color: var(--mc-red-ink); align-self: flex-start; }
.max-chat__msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.max-chat__dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--mc-green);
  animation: maxb 1.2s infinite ease-in-out;
}
.max-chat__dots span:nth-child(2) { animation-delay: .15s; }
.max-chat__dots span:nth-child(3) { animation-delay: .3s; }
@keyframes maxb { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .max-chat__dots span { animation: none; opacity: .6; } }

.max-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 12px; }
.max-chat__chip {
  min-height: 36px;
  background: #fff;
  border: 1px solid var(--mc-border);
  color: var(--mc-green);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.max-chat__chip:hover { background: var(--mc-soft); }

.max-chat__form { display: flex; gap: 8px; margin: 0; }
.max-chat__in {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--mc-border);
  border-radius: 12px;
  padding: 10px 13px;
  font: inherit;
  font-size: 16px; /* under 16px, iOS zooms the page on focus */
  color: var(--mc-ink);
  background: #fff;
}
.max-chat__in::placeholder { color: var(--mc-muted); }
.max-chat__send {
  min-width: 64px;
  min-height: 44px;
  background: var(--mc-ink);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.max-chat__send:disabled { background: var(--mc-border); color: var(--mc-muted); cursor: default; }
.max-chat__in:focus-visible,
.max-chat__send:focus-visible,
.max-chat__chip:focus-visible { outline: 3px solid var(--mc-green); outline-offset: 2px; }

.max-chat__note { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--mc-muted); }
