/* Chat widget for the example sites. Each site sets --cw-accent, --cw-on-accent, --cw-bg, --cw-fg, --cw-line
   (and optionally --cw-radius). The panel grows out of the button's corner; the button pulses softly. */
.cw { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 50; font: inherit; display: grid; justify-items: end; gap: 12px; }
.cw[hidden], .cw [hidden] { display: none !important; }
.cw__open { position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 18px; border-radius: 999px; border: 0; background: var(--cw-accent); color: var(--cw-on-accent); font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1; box-shadow: 0 12px 32px -10px rgb(0 0 0 / .45); cursor: pointer; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.cw__open:active { transform: scale(0.97); }
.cw__pulse { position: relative; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.cw__pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: cw-pulse 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite; }
@keyframes cw-pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
.cw.is-open .cw__open { display: none; }
.cw__panel { width: min(380px, calc(100vw - 32px)); height: min(580px, calc(100svh - 32px)); display: flex; flex-direction: column; background: var(--cw-bg); color: var(--cw-fg); border: 1px solid var(--cw-line); border-radius: var(--cw-radius, 18px); overflow: hidden; box-shadow: 0 24px 64px -20px rgb(0 0 0 / .5);
  transform-origin: bottom right; opacity: 0; transform: translateY(12px) scale(.96); transition: opacity 220ms cubic-bezier(0.23, 1, 0.32, 1), transform 260ms cubic-bezier(0.23, 1, 0.32, 1); }
.cw.is-open .cw__panel { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .cw__panel { transform: translateY(4px); } }
.cw__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--cw-accent); color: var(--cw-on-accent); }
.cw__avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .16); font-weight: 700; }
.cw__who { flex: 1; min-width: 0; }
.cw__title { margin: 0; font-weight: 600; line-height: 1.2; }
.cw__sub { margin: 2px 0 0; display: flex; align-items: center; gap: 6px; font-size: .8rem; opacity: .88; }
.cw__online { width: 7px; height: 7px; border-radius: 50%; background: #7BD88F; }
.cw__x { flex: none; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgb(255 255 255 / .16); color: inherit; font-size: 1.4rem; cursor: pointer; }
.cw__log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.cw__hello { margin: 0 0 6px; font-size: .875rem; opacity: .75; }
.cw__msg { max-width: 86%; padding: 9px 12px; border-radius: 14px; font-size: .95rem; line-height: 1.42; white-space: pre-line; transition: opacity 220ms ease, transform 220ms cubic-bezier(0.23, 1, 0.32, 1); }
.cw__msg.is-entering { opacity: 0; transform: translateY(8px); }
.cw__msg--bot { align-self: flex-start; background: color-mix(in srgb, var(--cw-fg) 7%, var(--cw-bg)); border-top-left-radius: 4px; }
.cw__msg--me { align-self: flex-end; background: color-mix(in srgb, var(--cw-accent) 16%, var(--cw-bg)); border-top-right-radius: 4px; }
.cw__msg a { color: inherit; }
.cw__ai { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; background: var(--cw-accent); color: var(--cw-on-accent); font-size: .66rem; font-weight: 700; vertical-align: 1px; }
.cw__typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 14px; border-top-left-radius: 4px; background: color-mix(in srgb, var(--cw-fg) 7%, var(--cw-bg)); }
.cw__typing span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .4; animation: cw-typing 1.1s infinite ease-in-out; }
.cw__typing span:nth-child(2) { animation-delay: .15s; } .cw__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cw-typing { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: .9; transform: translateY(-3px); } }
.cw__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.cw__chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--cw-line); background: transparent; color: inherit; font: inherit; font-size: .85rem; cursor: pointer; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms ease; }
.cw__chip:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .cw__chip:hover { border-color: var(--cw-accent); } }
.cw__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--cw-line); }
.cw__form input { flex: 1; min-width: 0; min-height: 44px; border-radius: 999px; border: 1px solid var(--cw-line); background: transparent; color: inherit; padding: 0 14px; font: inherit; font-size: 16px; }
.cw__send { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--cw-accent); color: var(--cw-on-accent); font-family: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
.cw__send:active { transform: scale(0.97); }
.cw__note { margin: 0; padding: 0 14px 12px; font-size: .75rem; opacity: .7; }
.cw__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cw :focus-visible { outline: 3px solid var(--cw-accent); outline-offset: 2px; }
.cw__head :focus-visible { outline-color: var(--cw-on-accent); }
