/* Chat28 — site chatbot widget (shared front asset, v845).
 * Theme through the --chat28-* properties (set them in the site's
 * sections.css on `.chat28`); the defaults read the 28x design tokens with
 * plain fallbacks so the widget is usable on a site that has none. */
.chat28 {
  --chat28-accent: var(--color-accent, #16a07f);
  --chat28-accent-contrast: var(--color-accent-contrast, #ffffff);
  --chat28-bg: var(--color-bg, #ffffff);
  --chat28-bg-alt: var(--color-bg-alt, #f5f6f8);
  --chat28-text: var(--color-text, #363d45);
  --chat28-muted: var(--color-muted, #6b7480);
  --chat28-border: var(--color-border, #e4e7ec);
  --chat28-radius: 16px;
  --chat28-font: var(--font-body, system-ui, -apple-system, 'Segoe UI', sans-serif);
  --chat28-offset: 20px;
  --chat28-z: 1050;
  position: fixed;
  right: var(--chat28-offset);
  bottom: var(--chat28-offset);
  z-index: var(--chat28-z);
  font-family: var(--chat28-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--chat28-text);
}
.chat28[hidden] { display: none; }

/* toggle */
.chat28__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.1rem 0.75rem 0.9rem;
  background: var(--chat28-accent);
  color: var(--chat28-accent-contrast);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.chat28__toggle:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22); }
.chat28__toggle:focus-visible { outline: 3px solid rgba(0, 0, 0, 0.25); outline-offset: 2px; }
.chat28.is-open .chat28__toggle { display: none; }

/* panel */
.chat28__panel {
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 2 * var(--chat28-offset)));
  height: min(600px, calc(100vh - 2 * var(--chat28-offset)));
  background: var(--chat28-bg);
  border: 1px solid var(--chat28-border);
  border-radius: var(--chat28-radius);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.chat28__panel[hidden] { display: none; }

.chat28__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  background: var(--chat28-accent);
  color: var(--chat28-accent-contrast);
}
.chat28__title { flex: 1; font-weight: 600; }
.chat28__new,
.chat28__close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
}
.chat28__new { font-size: 0.8125rem; padding: 0.3rem 0.7rem; }
.chat28__close { width: 2rem; height: 2rem; font-size: 1.4rem; line-height: 1; }
.chat28__new:hover, .chat28__close:hover { background: rgba(255, 255, 255, 0.3); }

/* log */
.chat28__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--chat28-bg-alt);
  overscroll-behavior: contain;
}
.chat28__msg {
  max-width: 88%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat28__msg p { margin: 0; }
.chat28__msg p + p { margin-top: 0.4rem; }
.chat28__msg ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.chat28__msg li + li { margin-top: 0.2rem; }
.chat28__msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.chat28__msg--bot {
  align-self: flex-start;
  background: var(--chat28-bg);
  border: 1px solid var(--chat28-border);
  border-bottom-left-radius: 4px;
}
.chat28__msg--bot a { color: var(--chat28-accent); }
.chat28__msg--user {
  align-self: flex-end;
  background: var(--chat28-accent);
  color: var(--chat28-accent-contrast);
  border-bottom-right-radius: 4px;
}
.chat28__msg--error { color: var(--chat28-muted); font-style: italic; }
.chat28__msg--typing { color: var(--chat28-muted); }
.chat28__msg--typing p::after {
  content: '';
  display: inline-block;
  width: 0.5em;
  margin-left: 0.2em;
  animation: chat28-dots 1.2s steps(4, end) infinite;
  overflow: hidden;
  vertical-align: bottom;
}
@keyframes chat28-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* composer */
.chat28__composer {
  padding: 0.6rem 0.75rem 0.4rem;
  border-top: 1px solid var(--chat28-border);
  background: var(--chat28-bg);
}
.chat28__turnstile { margin: 0 0 0.5rem; }
.chat28__turnstile[hidden] { display: none; }
.chat28__row { display: flex; align-items: flex-end; gap: 0.5rem; }
.chat28__input {
  flex: 1;
  min-height: 2.6rem;
  max-height: 120px;
  resize: none;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--chat28-border);
  border-radius: 12px;
  background: var(--chat28-bg);
  color: var(--chat28-text);
  font: inherit;
  line-height: 1.4;
}
.chat28__input:focus { outline: 2px solid var(--chat28-accent); outline-offset: 0; border-color: transparent; }
.chat28__input:disabled { background: var(--chat28-bg-alt); color: var(--chat28-muted); }
.chat28__send {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 12px;
  background: var(--chat28-accent);
  color: var(--chat28-accent-contrast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat28__send:disabled { opacity: 0.5; cursor: default; }
.chat28__note { margin: 0.4rem 0 0; font-size: 0.8125rem; color: var(--chat28-muted); }
.chat28__note[hidden] { display: none; }

.chat28__foot {
  padding: 0.35rem 0.9rem 0.55rem;
  font-size: 0.75rem;
  color: var(--chat28-muted);
  background: var(--chat28-bg);
  text-align: center;
}
.chat28__foot a { color: inherit; }

/* phones: the panel becomes a full-screen sheet */
@media (max-width: 575.98px) {
  .chat28.is-open { inset: 0; right: 0; bottom: 0; }
  .chat28__panel {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat28__toggle { transition: none; }
  .chat28__msg--typing p::after { animation: none; content: '…'; }
}
