.x-chat-open { position: fixed; inset-inline-end: 18px; bottom: 86px; z-index: 65; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--ink); color: #fff; font: 500 15px/1 var(--font); cursor: pointer; box-shadow: 0 8px 24px rgba(17, 17, 19, 0.25); }
.x-chat-open svg { width: 18px; height: 18px; }
.x-chat-open:focus-visible, .x-chat button:focus-visible, .x-chat textarea:focus-visible, .x-chat a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.has-calc-bar .x-chat-open { bottom: 154px; }
.x-chat-is-open .x-chat-open { display: none; }
.x-chat { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 70; width: min(380px, calc(100vw - 24px)); max-height: min(620px, calc(100dvh - 36px)); display: flex; flex-direction: column; border-radius: 16px; background: var(--paper); color: var(--ink); box-shadow: 0 18px 48px rgba(17, 17, 19, 0.3); overflow: hidden; }
.x-chat[hidden] { display: none; }
/* Only the message log shrinks and scrolls; the header, chips, WhatsApp bar, form and footer keep their height. */
.x-chat > :not(.x-chat__log) { flex-shrink: 0; }
.x-chat__bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--dark); color: var(--on-dark); }
.x-chat__t { margin: 0; font-weight: 600; }
.x-chat__s { margin: 2px 0 0; font-size: 13px; color: var(--on-dark-muted); }
.x-chat__x { flex: none; width: 44px; height: 44px; margin: -8px; border: 0; background: none; color: inherit; font-size: 16px; cursor: pointer; }
.x-chat__log { flex: 1 1 auto; min-height: 96px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.x-chat__m { margin: 0; max-width: 88%; padding: 10px 12px; border-radius: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.x-chat__m--bot { align-self: flex-start; background: #fff; border: 1px solid var(--rule); }
.x-chat__m--you { align-self: flex-end; background: var(--ink); color: #fff; }
.x-chat__m.is-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.x-chat__dots { display: inline-flex; gap: 4px; }
.x-chat__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: x-chat-dot 1.2s infinite ease-in-out; }
.x-chat__dots i:nth-child(2) { animation-delay: 0.15s; }
.x-chat__dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes x-chat-dot { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .x-chat__dots i { animation: none; opacity: 0.6; } }
.x-chat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.x-chat__next { display: flex; flex-wrap: wrap; gap: 8px; }
.x-chat__hint { display: flex; flex-direction: column; gap: 8px; }
.x-chat__chip--link { display: inline-flex; align-items: center; text-decoration: none; }
.x-chat__chip--ghost { border-style: dashed; color: var(--ink-2); }
.x-chat__wabar { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 10px 16px 0; padding: 8px 14px; border-radius: 12px; background: #25d366; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.3; text-decoration: none; text-align: center; text-wrap: balance; }
.x-chat__wabar[hidden] { display: none; }
.x-chat__wabar .ico, .x-chat__wa .ico { width: 20px; height: 20px; flex: none; }
.x-chat__wa { gap: 8px; }
.x-chat__wa { align-self: flex-start; }
.x-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; max-height: min(148px, 22dvh); overflow-y: auto; padding: 10px 16px 12px; border-top: 1px solid var(--rule); }
.x-chat__faqh { flex-basis: 100%; margin: 0; font: 500 11px/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
[dir="rtl"] .x-chat__faqh { font-family: var(--font); font-size: 13px; text-transform: none; letter-spacing: 0; }
.x-chat__chips[hidden], .x-chat__form[hidden] { display: none; }
.x-chat__chip { min-height: 36px; padding: 6px 12px; text-align: start; border: 1px solid var(--rule-strong); border-radius: 18px; background: transparent; color: var(--ink); font: 14px/1.3 var(--font); cursor: pointer; }
.x-chat__form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px 8px; border-top: 1px solid var(--rule); }
.x-chat__lab { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.x-chat__form textarea { flex: 1; min-width: 0; resize: none; max-height: 120px; padding: 10px 12px; border: 1px solid var(--rule-strong); border-radius: 12px; background: #fff; color: var(--ink); font: 16px/1.4 var(--font); }
.x-chat__send { flex: none; }
.x-chat__send:disabled { opacity: 0.5; }
.x-chat__foot { margin: 0; padding: 0 16px 12px; font-size: 12px; color: var(--muted); text-wrap: pretty; }
.x-chat__ts { padding: 0 16px 8px; }
@media (max-width: 767px) {
  .x-chat { inset-inline: 8px; bottom: 8px; width: auto; max-height: calc(100dvh - 16px); }
  .x-bar-on .x-chat-open { bottom: 78px; }
  /* Hidden while the hero buttons are on screen (chat.js), so it never covers them. */
  .x-chat-open { transition: opacity 0.25s, transform 0.25s, visibility 0.25s; }
  .x-chat-open.is-away { opacity: 0; visibility: hidden; transform: translateY(12px); pointer-events: none; }
}

