/* Onsites Website Widget - monochrome (ink / paper) */
/* Fonts loaded via <link> in widget HTML (avoid @import FOUC) */

body.onsites-widget {
  /* Ink / paper - black & white */
  --cw-brand: #141416;
  --cw-brand-soft: rgba(20, 20, 22, 0.08);
  --cw-brand-widget: #141416;
  --cw-brand-deep: #0a0a0b;
  --cw-ink: #141416;
  --cw-ink-2: #5c5c62;
  --cw-ink-3: #9a9aa0;
  --cw-line: #e8e8ea;
  --cw-line-strong: #d4d4d8;
  --cw-panel: #f4f4f5;
  --cw-msgs: #ffffff;
  --cw-agent-bubble: #ffffff;
  --cw-visitor-bubble: #f0f0f2;
  --cw-online: #2f9e6b;
  --cw-danger: #c23b3b;
  --cw-launcher: #141416;
  --cw-radius: 6px;
  --cw-radius-sm: 4px;
--cw-font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
 --cw-display: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
 --cw-spring: cubic-bezier(0.25, 0.6, 0.35, 1);
  --cw-spring-soft: cubic-bezier(0.25, 0.6, 0.35, 1);
  --cw-spring-pop: cubic-bezier(0.25, 0.9, 0.35, 1);
  --cw-ease: var(--cw-spring);
  --cw-duration: 0.32s;
  --cw-duration-fast: 0.18s;
  --cw-duration-press: 0.12s;
  --cw-shadow-panel: 0 12px 36px rgba(20, 20, 22, 0.12), 0 1px 0 rgba(20, 20, 22, 0.04);

  margin: 0;
  color: var(--cw-ink);
  font-family: var(--cw-font);
  font-size: 14px;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: transparent;
  color-scheme: light;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 20, 22, 0.22) transparent;
  -webkit-tap-highlight-color: transparent;
}
body.onsites-widget ::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
body.onsites-widget ::-webkit-scrollbar-track {
  background: transparent;
}
body.onsites-widget ::-webkit-scrollbar-thumb {
  background: rgba(20, 20, 22, 0.16);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
body.onsites-widget ::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 20, 22, 0.45);
  border: 2px solid transparent;
  background-clip: padding-box;
}
body.onsites-widget ::-webkit-scrollbar-corner {
  background: transparent;
}
body.onsites-widget .cw-w-msgs {
  scrollbar-color: rgba(20, 20, 22, 0.2) transparent;
}

/* —— Demo host page (standalone preview only) —— */
html.cw-widget-visitor .cw-widget-demo,
html.cw-widget-embed .cw-widget-demo {
  display: none !important;
}
html.cw-widget-embed #cw-launcher {
  display: none !important;
}

body.onsites-widget .cw-widget-demo {
  min-height: 100vh;
  padding: 56px 24px 140px;
  background:
    radial-gradient(ellipse 60% 45% at 12% 0%, rgba(20, 20, 22, 0.08), transparent 55%),
    linear-gradient(180deg, #fafafa 0%, #f0f0f2 100%);
}
body.onsites-widget .cw-widget-demo .hero-card {
  max-width: 520px;
  margin: 0 auto;
  padding: 32px 28px;
  background: #ffffff;
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  box-shadow: none;
  backdrop-filter: none;
}
body.onsites-widget .cw-widget-demo h1 {
  margin: 0 0 10px;
  font-family: var(--cw-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--cw-ink);
}
body.onsites-widget .cw-widget-demo p {
  margin: 0;
  color: var(--cw-ink-2);
  line-height: 1.65;
  font-size: 12px;
}
body.onsites-widget .cw-widget-demo a {
  color: var(--cw-brand-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 20, 22, 0.35);
}
body.onsites-widget .cw-widget-demo a:hover {
  color: #0a0a0b;
}

/* —— Launcher —— */
body.onsites-widget #cw-launcher {
  position: fixed;
  z-index: 60;
  width: 48px;
  height: 48px;
  right: 22px;
  bottom: 22px;
  border: 0;
  border-radius: var(--cw-radius);
  background: var(--cw-launcher);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(20, 20, 22, 0.16);
  transition:
    transform var(--cw-duration) var(--cw-spring),
    opacity var(--cw-duration) var(--cw-spring),
    visibility var(--cw-duration) linear,
    box-shadow var(--cw-duration) var(--cw-spring),
    background var(--cw-duration-fast) ease;
  will-change: transform, opacity;
  touch-action: manipulation;
  display: grid;
  place-items: center;
}
body.onsites-widget #cw-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(20, 20, 22, 0.2);
  background: var(--cw-brand-deep);
}
body.onsites-widget #cw-launcher:active {
  transform: translateY(0) scale(0.94);
  transition-duration: var(--cw-duration-press);
}
body.onsites-widget #cw-launcher[aria-expanded="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px) scale(0.92);
}
body.onsites-widget #cw-launcher .cw-launcher-icon {
  width: 23px;
  height: 23px;
  display: block;
  fill: none;
}

.cw-launcher-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--cw-danger);
  color: #ffffff;
  font: 700 12px/9px var(--cw-font);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #f4f4f5;
  box-sizing: border-box;
  animation: cw-badge-pop 0.36s var(--cw-spring) both;
}
.cw-launcher-badge[hidden] {
  display: none !important;
}
@keyframes cw-badge-pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* —— Panel —— */
body.onsites-widget #cw-panel {
  display: flex;
  flex-direction: column;
  right: 22px;
  bottom: 22px;
  width: min(380px, calc(100vw - 28px));
  height: min(600px, calc(100vh - 48px));
  background: var(--cw-panel);
  border: 1px solid var(--cw-line-strong);
  border-radius: var(--cw-radius);
  box-shadow: var(--cw-shadow-panel);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 18px, 0);
  transform-origin: bottom right;
  transition:
    opacity var(--cw-duration) var(--cw-spring),
    transform var(--cw-duration) var(--cw-spring),
    visibility var(--cw-duration) linear,
    box-shadow var(--cw-duration) var(--cw-spring);
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
body.onsites-widget #cw-panel.on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
}

/* —— Header —— */
body.onsites-widget .cw-w-head {
  display: flex;
  align-items: center;
  padding: 16px 18px 14px;
  gap: 12px;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--cw-line);
  color: var(--cw-ink);
  position: relative;
  flex-shrink: 0;
}
body.onsites-widget .cw-w-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--cw-radius-sm);
  background: var(--cw-brand);
  color: #ffffff;
  transition: transform var(--cw-duration-fast) var(--cw-spring);
}
body.onsites-widget .cw-w-mark svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
}
body.onsites-widget .cw-w-mark {
  overflow: hidden;
}
body.onsites-widget .cw-w-mark.has-logo {
  background: #ffffff;
  color: var(--cw-ink);
  padding: 5px;
  box-sizing: border-box;
  border: 1px solid var(--cw-line);
}
body.onsites-widget .cw-w-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
body.onsites-widget #cw-panel.on .cw-w-mark {
  animation: cw-mark-in 0.4s var(--cw-spring) both;
}
@keyframes cw-mark-in {
  0% { transform: translateY(6px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
body.onsites-widget .cw-w-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  margin-left: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--cw-ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background var(--cw-duration-fast) ease,
    color var(--cw-duration-fast) ease,
    transform var(--cw-duration-fast) var(--cw-spring);
  touch-action: manipulation;
}
body.onsites-widget .cw-w-close:hover {
  background: #eeeeef;
  color: var(--cw-ink);
}
body.onsites-widget .cw-w-close:active {
  transform: scale(0.92);
}
body.onsites-widget .cw-w-head .titles {
  min-width: 0;
  flex: 1;
}
body.onsites-widget .cw-w-head .t-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
body.onsites-widget .cw-w-head .titles .t {
  font-family: var(--cw-display);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: -0.035em;
  color: var(--cw-ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.onsites-widget .cw-w-head .titles .s {
  margin-top: 3px;
  font-size: 12px;
  color: var(--cw-ink-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
/* Human online mark — CSS only; never on AI phases */
body.onsites-widget .cw-w-head[data-phase="human"] .titles .s::before,
body.onsites-widget .cw-w-head:not([data-phase]) .titles .s::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cw-online);
  box-shadow: 0 0 0 3px rgba(110, 127, 97, 0.18);
  flex-shrink: 0;
}
body.onsites-widget .cw-w-head.is-ai .titles .s::before,
body.onsites-widget .cw-w-head[data-phase="aiIdle"] .titles .s::before,
body.onsites-widget .cw-w-head[data-phase="aiThinking"] .titles .s::before,
body.onsites-widget .cw-w-head[data-phase="aiStreaming"] .titles .s::before {
  content: none !important;
  display: none !important;
}
body.onsites-widget .cw-w-status-dot,
body.onsites-widget .cw-w-ai-wave {
  display: none !important;
}
body.onsites-widget .cw-w-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
body.onsites-widget .cw-w-status-text.is-fading {
  opacity: 0;
}

/* —— AI Morph Island (only .cw-w-head.is-ai) —— */
body.onsites-widget .cw-w-island {
  display: contents;
}
body.onsites-widget .cw-w-island-shine {
  display: none;
  pointer-events: none;
}
body.onsites-widget .cw-w-head.is-ai {
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 12px 44px;
  min-height: 72px;
  box-sizing: border-box;
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom-color: var(--cw-line);
}
body.onsites-widget .cw-w-head.is-ai .cw-w-close {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  margin: 0;
  z-index: 2;
  color: var(--cw-ink-3);
}
body.onsites-widget .cw-w-head.is-ai .cw-w-close:hover {
  color: var(--cw-ink);
  background: #eeeeef;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-close:active {
  transform: translateY(-50%) scale(0.92);
}
body.onsites-widget .cw-w-head.is-ai .cw-w-island {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  max-width: min(180px, calc(100% - 52px));
  padding: 9px 16px 9px 9px;
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: none;
  border: 1px solid var(--cw-line-strong);
  animation: cw-island-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition:
    max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark {
  position: relative;
  display: grid !important;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  place-items: center;
  background: var(--cw-brand);
  color: #ffffff;
  box-shadow: none;
  padding: 0;
  z-index: 1;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark::before {
  content: none;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark:not(.has-logo) svg {
  display: block;
  width: 15px;
  height: 15px;
  overflow: visible;
  fill: currentColor;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark:not(.has-logo) svg path {
  fill: currentColor;
  stroke: none;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark .cw-w-ai-star-sm {
  opacity: 0.72;
  transform-origin: 18.6px 6.2px;
  animation: cw-star-twinkle 2.8s ease-in-out infinite;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark.has-logo {
  background: #ffffff;
  padding: 0;
  box-shadow: none;
  border: 1px solid var(--cw-line);
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark.has-logo img {
  border-radius: 50%;
  object-fit: cover;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-mark::after {
  display: none !important;
}
body.onsites-widget .cw-w-head.is-ai .titles {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 118px;
  text-align: left;
  padding-right: 2px;
  z-index: 1;
  transition: max-width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
body.onsites-widget .cw-w-head.is-ai .t-row {
  justify-content: flex-start;
}
body.onsites-widget .cw-w-head.is-ai .titles .t {
  font-family: var(--cw-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  max-height: 1.2rem;
  color: var(--cw-ink);
}
body.onsites-widget .cw-w-head.is-ai .titles .s {
  margin-top: 3px;
  justify-content: flex-start;
  gap: 5px;
  font-family: var(--cw-font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  max-height: 1.15rem;
  color: var(--cw-ink);
  opacity: 0.55;
  transition: opacity 0.35s ease;
}
body.onsites-widget .cw-w-ai-presence {
  display: none;
  flex-shrink: 0;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
  color: var(--cw-ink-2);
}
body.onsites-widget .cw-w-ai-presence[hidden] {
  display: none !important;
}
body.onsites-widget .cw-w-ai-presence i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom center;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence:not([hidden]) {
  display: inline-flex;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i {
  animation: cw-presence-bars 1.15s ease-in-out infinite;
}
body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i:nth-child(1) { animation-delay: 0s; }
body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i:nth-child(2) { animation-delay: 0.14s; }
body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i:nth-child(3) { animation-delay: 0.28s; }
body.onsites-widget .cw-w-head.is-ai .cw-w-status-text {
  opacity: inherit;
}

/* Thinking — widen + inset breathe ring on mark */
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .cw-w-island {
  max-width: min(210px, calc(100% - 52px));
  padding: 9px 18px 9px 9px;
  box-shadow:
    0 0 0 1px rgba(18, 18, 20, 0.06),
    0 2px 4px rgba(18, 18, 20, 0.03),
    0 14px 32px rgba(18, 18, 20, 0.09);
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .titles {
  max-width: 140px;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .titles .s {
  opacity: 0.62;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .cw-w-ai-presence {
  color: color-mix(in srgb, var(--cw-brand-widget, #141416) 65%, #141416);
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .cw-w-ai-presence i {
  animation-duration: 0.75s;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .cw-w-mark::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--cw-brand-widget, #141416) 55%, #fff);
  opacity: 0.35;
  pointer-events: none;
  z-index: 2;
  animation: cw-mark-breathe 1.6s ease-in-out infinite;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .cw-w-ai-star-sm {
  animation-duration: 1.1s;
}

/* Streaming — wider + right-edge shine sweep */
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .cw-w-island {
  max-width: min(228px, calc(100% - 52px));
  padding: 9px 20px 9px 9px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--cw-brand-widget, #141416) 18%, rgba(18, 18, 20, 0.06)),
    0 2px 4px rgba(18, 18, 20, 0.03),
    0 14px 32px rgba(18, 18, 20, 0.09);
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .titles {
  max-width: 150px;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .titles .s {
  opacity: 0.62;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .cw-w-ai-presence {
  color: color-mix(in srgb, var(--cw-brand-widget, #141416) 55%, #141416);
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .cw-w-ai-presence i {
  animation-duration: 0.55s;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .cw-w-island-shine {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 42%;
  z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    color-mix(in srgb, var(--cw-brand-widget, #141416) 14%, transparent) 45%,
    transparent 78%
  );
  transform: translateX(110%);
  animation: cw-island-shine 1.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .cw-w-ai-star-sm {
  animation-duration: 0.9s;
}

@keyframes cw-island-in {
  0% { opacity: 0; transform: translateY(8px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}
@keyframes cw-star-twinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
@keyframes cw-mark-breathe {
  0%, 100% { opacity: 0.22; transform: scale(0.92); }
  50% { opacity: 0.7; transform: scale(1); }
}
@keyframes cw-island-shine {
  0% { transform: translateX(110%); opacity: 0; }
  12% { opacity: 1; }
  55% { opacity: 1; }
  100% { transform: translateX(-160%); opacity: 0; }
}
@keyframes cw-presence-bars {
  0%, 100% { height: 3px; opacity: 0.4; }
  50% { height: 10px; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body.onsites-widget .cw-w-head.is-ai .cw-w-island,
  body.onsites-widget .cw-w-head.is-ai .cw-w-ai-star-sm,
  body.onsites-widget .cw-w-head.is-ai .cw-w-island-shine,
  body.onsites-widget .cw-w-head.is-ai .cw-w-mark::before,
  body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i {
    animation: none !important;
  }
  body.onsites-widget .cw-w-head.is-ai .cw-w-island,
  body.onsites-widget .cw-w-head.is-ai .titles {
    transition: none !important;
  }
  body.onsites-widget .cw-w-head.is-ai[data-phase="aiStreaming"] .cw-w-island-shine {
    display: none !important;
  }
  body.onsites-widget .cw-w-head.is-ai[data-phase="aiThinking"] .cw-w-mark::before {
    opacity: 0.45;
    transform: none;
  }
  body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i:nth-child(1) { height: 5px; }
  body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i:nth-child(2) { height: 9px; }
  body.onsites-widget .cw-w-head.is-ai .cw-w-ai-presence i:nth-child(3) { height: 6px; }
}

body.onsites-widget .cw-w-powered {
  flex-shrink: 0;
  padding: 2px 14px 12px;
  text-align: center;
  background: transparent;
  border-top: 0;
}
body.onsites-widget .cw-w-powered-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 520;
  font-family: var(--cw-font);
  letter-spacing: 0.01em;
  color: rgba(18, 18, 20, 0.38);
  text-decoration: none;
  transition: color var(--cw-duration-fast) ease, opacity var(--cw-duration-fast) ease;
}
body.onsites-widget .cw-w-powered-link:hover {
  color: rgba(18, 18, 20, 0.68);
}
body.onsites-widget .cw-w-powered-prefix,
body.onsites-widget .cw-w-powered-suffix {
  font-weight: 520;
}
body.onsites-widget .cw-w-powered-brand {
  font-family: var(--cw-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(18, 18, 20, 0.52);
}
body.onsites-widget .cw-w-powered-link:hover .cw-w-powered-brand {
  color: rgba(18, 18, 20, 0.78);
}
body.onsites-widget .cw-w-powered-logo {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
  color: inherit;
}

/* —— Messages / bubbles —— */
body.onsites-widget .cw-w-msgs {
  flex: 1;
  overflow: auto;
  padding: 18px 16px 22px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.onsites-widget .cw-day-sep {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 14px;
}
body.onsites-widget .cw-day-sep span {
  background: transparent;
  color: var(--cw-ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 8px;
}

.cw-bubble-row {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  margin: 4px 0;
  will-change: transform, opacity;
}
.cw-bubble-row.is-agent { align-self: flex-start; align-items: flex-start; }
.cw-bubble-row.is-visitor { align-self: flex-end; align-items: flex-end; }
.cw-bubble-row.is-pending { opacity: 0.72; }

/* AI assistant — quiet distinguish, no accent rail */
.cw-bubble-row.is-ai .cw-bubble-meta.is-ai {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(28, 36, 48, 0.45);
  font-weight: 550;
}
.cw-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 15px;
  padding: 0 5px;
  border-radius: 4px;
  font: 650 0.56rem/1 var(--cw-font);
  letter-spacing: 0.06em;
  color: rgba(28, 36, 48, 0.55);
  background: rgba(18, 24, 36, 0.06);
  border: 0;
}
.cw-bubble.cw-bubble--ai {
  background: #eef1f5;
  border: 1px solid rgba(18, 18, 20, 0.05);
  box-shadow: none;
  color: #1c2430;
  position: relative;
}
.cw-bubble.cw-bubble--ai::before {
  content: none;
  display: none;
}
.cw-bubble.cw-bubble--ai.is-streaming,
.cw-bubble-row.is-streaming .cw-bubble--ai {
  min-height: 1.4em;
}
.cw-bubble.cw-stream-plain,
.cw-post-bubble.cw-stream-plain {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.cw-bubble.cw-md,
.cw-post-bubble.cw-md {
  white-space: normal;
}
.cw-md .cw-md-p {
  margin: 0 0 0.55em;
}
.cw-md .cw-md-p:last-child {
  margin-bottom: 0;
}
.cw-md .cw-md-lead {
  margin-bottom: 0.4em;
}
.cw-md .cw-md-ul,
.cw-md .cw-md-ol {
  margin: 0.35em 0 0.55em;
  padding-left: 1.25em;
}
.cw-md .cw-md-ul:last-child,
.cw-md .cw-md-ol:last-child {
  margin-bottom: 0;
}
.cw-md .cw-md-ul li,
.cw-md .cw-md-ol li {
  margin: 0.2em 0;
}
.cw-md .cw-md-h {
  margin: 0.15em 0 0.4em;
  font-size: 1.02em;
  font-weight: 700;
  line-height: 1.35;
}
.cw-md .cw-md-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.08em 0.28em;
  border-radius: 4px;
  background: rgba(18, 40, 70, 0.07);
}
.cw-md .cw-md-pre {
  margin: 0.4em 0 0.55em;
  padding: 8px 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.86em;
  line-height: 1.45;
  background: rgba(18, 40, 70, 0.06);
  border: 1px solid rgba(18, 40, 70, 0.08);
}
.cw-md .cw-md-pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}
.cw-md .cw-md-a {
  color: #2a6aa8;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cw-md .cw-md-hr {
  border: 0;
  border-top: 1px solid rgba(18, 40, 70, 0.12);
  margin: 0.55em 0;
}
.cw-stream-cursor {
  display: inline-block;
  width: 1.5px;
  height: 0.92em;
  margin-left: 2px;
  vertical-align: -0.1em;
  border-radius: 1px;
  background: rgba(28, 36, 48, 0.35);
  animation: cw-stream-blink 1s ease-in-out infinite;
}
@keyframes cw-stream-blink {
  0%, 40% { opacity: 1; }
  60%, 100% { opacity: 0.15; }
}
.cw-receipt {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 2px;
  vertical-align: -1px;
  color: rgba(24, 24, 27, 0.42);
  line-height: 1;
}
.cw-receipt.is-sent {
  color: rgba(24, 24, 27, 0.45);
}
.cw-receipt.is-read {
  color: var(--cw-brand-widget, var(--cw-brand));
}
.cw-receipt svg {
  display: block;
  margin-left: -4px;
}
.cw-receipt svg:first-child {
  margin-left: 0;
}
.cw-bubble-row.is-read .cw-bubble-meta {
  opacity: 0.92;
}

.cw-bubble-meta {
  font-size: 12px;
  font-weight: 550;
  color: var(--cw-ink-3);
  margin: 0 6px 5px;
  letter-spacing: 0.01em;
}

.cw-bubble {
  padding: 10px 13px;
  border-radius: var(--cw-radius);
  font-size: 12px;
  line-height: 1.48;
  letter-spacing: -0.015em;
  word-break: break-word;
  box-shadow: none;
  transform-origin: left bottom;
}
.cw-bubble-row.is-visitor .cw-bubble {
  transform-origin: right bottom;
}
.cw-bubble-row.is-agent .cw-bubble {
  background: var(--cw-agent-bubble);
  color: var(--cw-ink);
  border: 1px solid var(--cw-line);
  border-bottom-left-radius: 2px;
}
.cw-bubble-row.is-visitor .cw-bubble {
  background: var(--cw-visitor-bubble);
  color: var(--cw-ink);
  border: 1px solid var(--cw-line);
  border-bottom-right-radius: 2px;
}
.cw-bubble-row.is-agent .cw-bubble.is-mid,
.cw-bubble-row.is-agent .cw-bubble.is-end {
  border-top-left-radius: 4px;
}
.cw-bubble-row.is-visitor .cw-bubble.is-mid,
.cw-bubble-row.is-visitor .cw-bubble.is-end {
  border-top-right-radius: 4px;
}

.cw-bubble-sys {
  align-self: center;
  max-width: 92%;
  margin: 12px 0;
  padding: 8px 12px;
  border-radius: var(--cw-radius-sm);
  background: transparent;
  border: 0;
  color: var(--cw-ink-3);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 1.45;
}

.cw-bubble-row--in {
  animation: cw-bubble-in 0.44s var(--cw-spring-soft) both;
}
.cw-bubble-row.is-visitor.cw-bubble-row--in {
  animation-name: cw-bubble-in-visitor;
}
.cw-bubble-sys.cw-bubble-row--in {
  animation-name: cw-bubble-in-sys;
  animation-duration: 0.36s;
}
@keyframes cw-bubble-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes cw-bubble-in-visitor {
  0% {
    opacity: 0;
    transform: translate3d(10px, 8px, 0) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}
@keyframes cw-bubble-in-sys {
  0% {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cw-bubble-row--in,
  .cw-bubble-sys.cw-bubble-row--in {
    animation: none;
  }
  body.onsites-widget .cw-w-msgs {
    scroll-behavior: auto;
  }
}

body.onsites-widget .cw-bubble .cw-attach {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  word-break: break-all;
}
body.onsites-widget .cw-bubble-row.is-agent .cw-attach {
  color: var(--cw-brand-deep);
}
body.onsites-widget .cw-bubble-row.is-visitor .cw-attach {
  color: var(--cw-brand-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.onsites-widget .cw-bubble img.cw-img {
  display: block;
  max-width: min(220px, 70vw);
  max-height: 180px;
  border-radius: 8px;
  margin-top: 6px;
}

/* —— Composer (AI-era prompt bar) —— */
body.onsites-widget .cw-w-foot {
  position: relative;
  padding: 8px 14px 4px;
  background: transparent;
  border-top: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.onsites-widget .cw-w-input {
  gap: 4px;
  border: 1px solid var(--cw-line-strong);
  border-radius: var(--cw-radius);
  padding: 5px 5px 5px 6px;
  background: #ffffff;
  box-shadow: none;
  transition:
    border-color var(--cw-duration-fast) var(--cw-spring-soft),
    box-shadow var(--cw-duration-fast) var(--cw-spring),
    background var(--cw-duration-fast) ease;
}
body.onsites-widget .cw-w-input:focus-within {
  background: #ffffff;
  border-color: var(--cw-brand);
  box-shadow: 0 0 0 3px var(--cw-brand-soft);
  transform: none;
}
body.onsites-widget .cw-w-input input#input {
  min-width: 0;
  height: 36px;
  padding: 0 4px;
  font-family: var(--cw-font);
  font-size: 12px;
  letter-spacing: -0.015em;
  color: var(--cw-ink);
}
body.onsites-widget .cw-w-input input#input::placeholder {
  color: var(--cw-ink-3);
}
body.onsites-widget .cw-w-send {
  width: 34px;
  height: 34px;
  border-radius: var(--cw-radius-sm);
  background: var(--cw-brand);
  color: #ffffff;
  position: relative;
  overflow: visible;
  transition:
    transform var(--cw-duration-fast) var(--cw-spring),
    background var(--cw-duration-fast) ease,
    opacity var(--cw-duration-fast) ease,
    box-shadow 0.35s ease;
  touch-action: manipulation;
}
body.onsites-widget .cw-w-send-ico {
  display: grid;
  place-items: center;
  line-height: 0;
  transform-origin: 50% 55%;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
body.onsites-widget .cw-w-send-ico svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  display: block;
}
body.onsites-widget .cw-w-send.is-awaiting-plane .cw-w-send-ico {
  opacity: 0;
  transform: scale(0.2) rotate(-28deg) translate(-4px, 3px);
}
body.onsites-widget .cw-w-send.is-plane-in {
  box-shadow: 0 0 0 0 rgba(20, 20, 22, 0.2);
  animation: cw-send-catch-ring 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
body.onsites-widget .cw-w-send.is-plane-in .cw-w-send-ico {
  animation: cw-send-catch-plane 0.62s cubic-bezier(0.22, 1.4, 0.36, 1) both;
}
@keyframes cw-send-catch-plane {
  0% {
    opacity: 0;
    transform: scale(0.12) rotate(-48deg) translate(-10px, 8px);
  }
  55% {
    opacity: 1;
    transform: scale(1.22) rotate(10deg) translate(0, 0);
  }
  78% {
    transform: scale(0.94) rotate(-3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}
@keyframes cw-send-catch-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 20, 22, 0.28);
  }
  40% {
    box-shadow: 0 0 0 10px rgba(20, 20, 22, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 20, 22, 0);
  }
}
body.onsites-widget .cw-w-send:hover {
  background: var(--cw-brand-deep);
  transform: none;
}
body.onsites-widget .cw-w-send:active {
  transform: scale(0.94);
  transition-duration: var(--cw-duration-press);
}
body.onsites-widget .cw-file-btn {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: var(--cw-ink-3);
  cursor: pointer;
  line-height: 0;
  transition:
    color var(--cw-duration-fast) ease,
    background var(--cw-duration-fast) ease,
    transform var(--cw-duration-fast) var(--cw-spring);
  touch-action: manipulation;
}
body.onsites-widget .cw-file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
body.onsites-widget .cw-file-btn:hover {
  color: var(--cw-brand-deep);
  background: rgba(20, 20, 22, 0.1);
}
body.onsites-widget .cw-file-btn:active {
  transform: scale(0.88);
}
body.onsites-widget .cw-emoji-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cw-ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    color var(--cw-duration-fast) ease,
    background var(--cw-duration-fast) ease,
    transform var(--cw-duration-fast) var(--cw-spring);
  touch-action: manipulation;
}
body.onsites-widget .cw-emoji-btn svg {
  display: block;
  transition: transform var(--cw-duration) var(--cw-spring-pop);
}
body.onsites-widget .cw-emoji-btn:hover,
body.onsites-widget .cw-emoji-btn.is-open {
  color: var(--cw-brand-deep);
  background: rgba(20, 20, 22, 0.12);
}
body.onsites-widget .cw-emoji-btn.is-open svg {
  transform: scale(1.08) rotate(-8deg);
}
body.onsites-widget .cw-emoji-btn:active {
  transform: scale(0.88);
}
body.onsites-widget .cw-emoji-picker {
  order: -1;
  margin: 0;
  padding: 10px 10px 8px;
  border-radius: var(--cw-radius);
  background: #fff;
  border: 1px solid rgba(18, 18, 20, 0.08);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transform-origin: bottom center;
  animation: cw-tray-in 0.32s var(--cw-spring) both;
}
body.onsites-widget .cw-emoji-picker[hidden] {
  display: none !important;
}
@keyframes cw-tray-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
body.onsites-widget .cw-emoji-quick {
  display: flex;
  gap: 2px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(18, 18, 20, 0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
body.onsites-widget .cw-emoji-quick::-webkit-scrollbar {
  display: none;
}
body.onsites-widget .cw-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  max-height: 148px;
  overflow: auto;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}
body.onsites-widget .cw-emoji-item {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background 0.16s ease,
    transform var(--cw-duration-fast) var(--cw-spring-pop);
  touch-action: manipulation;
}
body.onsites-widget .cw-emoji-quick .cw-emoji-item {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  aspect-ratio: auto;
  font-size: 12px;
  background: rgba(18, 18, 20, 0.03);
}
body.onsites-widget .cw-emoji-item:hover {
  background: rgba(20, 20, 22, 0.14);
  transform: scale(1.14);
}
body.onsites-widget .cw-emoji-item:active {
  transform: scale(0.86);
  transition-duration: var(--cw-duration-press);
}
body.onsites-widget #fileHint {
  font-size: 12px;
  color: var(--cw-ink-3);
  padding: 0 4px;
  min-height: 0;
}
body.onsites-widget #fileHint:empty {
  display: none;
}

/* —— Prechat (assistant entry) —— */
body.onsites-widget .cw-prechat {
  padding: 28px 22px 20px;
  gap: 22px;
  background: transparent;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
body.onsites-widget .cw-prechat-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
body.onsites-widget .cw-prechat-hero h3 {
  margin: 0;
  font-family: var(--cw-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--cw-ink);
  line-height: 1.15;
}
body.onsites-widget .cw-prechat-hero p {
  margin: 0;
  max-width: 26ch;
  color: var(--cw-ink-2);
  font-size: 12px;
  line-height: 1.45;
}
body.onsites-widget .cw-prechat .cw-input[hidden],
body.onsites-widget .cw-leave .cw-input[hidden] {
  display: none !important;
}
body.onsites-widget .cw-prechat .cw-input {
  height: 42px;
  border-radius: var(--cw-radius-sm);
  border: 1px solid rgba(18, 18, 20, 0.1);
  background: #fff;
  padding: 0 12px;
  font-size: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
body.onsites-widget .cw-prechat .cw-input--quiet {
  border-color: transparent;
  background: rgba(18, 18, 20, 0.04);
  color: var(--cw-ink-2);
}
body.onsites-widget .cw-prechat .cw-input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(18, 18, 20, 0.28);
  box-shadow: 0 0 0 3px var(--cw-brand-soft);
}
body.onsites-widget .cw-prechat .cw-btn {
  margin-top: 2px;
  height: 42px;
  border-radius: var(--cw-radius-sm);
  border: 0;
  font-family: var(--cw-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  color: #fff;
  background: #141416;
  transition:
    transform var(--cw-duration-fast) var(--cw-spring),
    background var(--cw-duration-fast) ease;
  touch-action: manipulation;
}
body.onsites-widget .cw-prechat .cw-btn:hover {
  background: #2a2a2e;
  filter: none;
  transform: none;
}
body.onsites-widget .cw-prechat .cw-btn:active {
  transform: scale(0.98);
  transition-duration: var(--cw-duration-press);
}
body.onsites-widget .cw-prechat-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body.onsites-widget .cw-prechat-form .cw-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.onsites-widget .cw-prechat-form .cw-field[hidden] {
  display: none !important;
}
body.onsites-widget .cw-field-error {
  margin: 0;
  padding: 0 2px;
  font-size: 11px;
  line-height: 1.35;
  color: #b42318;
}
body.onsites-widget .cw-field-error[hidden] {
  display: none !important;
}
body.onsites-widget .cw-prechat .cw-input.is-invalid,
body.onsites-widget .cw-leave .cw-input.is-invalid {
  border-color: rgba(180, 35, 24, 0.55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}
body.onsites-widget .cw-prechat .cw-input--quiet.is-invalid {
  border-color: rgba(180, 35, 24, 0.4);
  background: rgba(180, 35, 24, 0.06);
}

body.onsites-widget .cw-widget-token-error {
  margin: 0 0 14px;
  padding: 12px 12px;
  border: 1px solid rgba(220, 80, 80, 0.35);
  background: rgba(220, 80, 80, 0.08);
  color: #7a2e2e;
  font-size: 12px;
  line-height: 1.45;
  border-radius: 10px;
}
body.onsites-widget .cw-widget-token-error strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}
body.onsites-widget .cw-widget-token-error p {
  margin: 4px 0 0;
}
body.onsites-widget .cw-widget-token-error .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

/* —— CSAT —— */
body.onsites-widget .cw-csat {
  margin: 0 14px 8px;
  padding: 16px 14px 14px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(18, 18, 20, 0.06);
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  animation: cw-bubble-in 0.3s var(--cw-ease) both;
}
body.onsites-widget .cw-csat-title {
  font-family: var(--cw-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cw-ink);
  margin-bottom: 10px;
}
body.onsites-widget .cw-csat-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
}
body.onsites-widget .cw-csat-stars button {
  border: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1;
  color: rgba(18, 18, 20, 0.18);
  cursor: pointer;
  padding: 4px 5px;
  transition: color 0.15s ease, transform 0.18s var(--cw-ease);
}
body.onsites-widget .cw-csat-stars button:hover {
  transform: translateY(-2px) scale(1.08);
  color: #e8a317;
}
body.onsites-widget .cw-csat-stars button.on {
  color: #e8a317;
}
body.onsites-widget .cw-csat-skip {
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--cw-ink-3);
  font-size: 12px;
  font-family: var(--cw-font);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.onsites-widget .cw-typing {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 2px 16px 4px;
  padding: 6px 2px;
  align-self: flex-start;
  max-width: 86%;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: rgba(28, 36, 48, 0.42);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  animation: none;
}
body.onsites-widget .cw-typing[hidden] {
  display: none !important;
}
body.onsites-widget .cw-typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
body.onsites-widget .cw-typing-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(28, 36, 48, 0.35);
  opacity: 0.55;
  animation: cw-typing-bounce 1.15s ease-in-out infinite;
}
body.onsites-widget .cw-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
body.onsites-widget .cw-typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes cw-typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
  40% { transform: translateY(-2px); opacity: 0.85; }
}

body.onsites-widget .cw-leave-badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 8px;
  border-radius: 999px;
  font: 600 12px/1.2 var(--cw-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a1a1aa;
  background: rgba(24, 24, 27, 0.06);
}
body.onsites-widget .cw-leave-msg {
  min-height: 88px;
  resize: vertical;
  line-height: 1.45;
}
body.onsites-widget .cw-leave-ok {
  margin: 10px 0 0;
  font: 500 12px/1.4 var(--cw-font);
  color: var(--cw-brand-widget, var(--cw-brand));
}
body.onsites-widget #leaveForm[hidden] {
  display: none !important;
}

/* Prechat / chat enter */
body.onsites-widget #chatUi {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  animation: cw-view-in 0.48s var(--cw-spring) both;
}
body.onsites-widget .cw-prechat {
  animation: cw-view-in 0.55s var(--cw-spring) both;
}
body.onsites-widget .cw-prechat-hero {
  animation: cw-view-in 0.6s var(--cw-spring) both;
}
body.onsites-widget .cw-prechat-form {
  animation: cw-view-in 0.68s var(--cw-spring) both;
  animation-delay: 0.06s;
}
@keyframes cw-view-in {
  0% {
    opacity: 0;
    transform: translate3d(0, 18px, 0) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (max-width: 520px) {
  body.onsites-widget #cw-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 12px 12px 0 0;
    border: none;
    transform: translate3d(0, 100%, 0);
    transform-origin: bottom center;
    box-shadow: 0 -8px 40px rgba(15, 23, 42, 0.18);
  }
  body.onsites-widget #cw-panel.on {
    transform: translate3d(0, 0, 0);
  }
  body.onsites-widget #cw-launcher {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
  }
  body.onsites-widget .cw-w-foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  body.onsites-widget *,
  body.onsites-widget *::before,
  body.onsites-widget *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Larger touch targets for in-widget image viewer */
body.onsites-widget .cw-img-viewer-btn {
  height: 40px;
  padding: 0 14px;
  font-size: 12px;
}
body.onsites-widget .cw-img-viewer-btn--icon {
  width: 40px;
  font-size: 12px;
}
body.onsites-widget .cw-img-viewer-nav {
  width: 44px;
  height: 64px;
  font-size: 32px;
}
body.onsites-widget img.cw-img {
  cursor: zoom-in;
}
