/* Site chat widget (self-hosted, replaces Chatling) */
.cw-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  background: var(--ink); color: var(--bg);
  border: none; border-radius: 999px;
  padding: 13px 20px;
  font: 600 0.95rem var(--font-body);
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(28, 25, 22, 0.28);
  transition: transform 0.15s ease;
}
.cw-toggle:hover { transform: translateY(-2px); }
.cw-panel {
  position: fixed; right: 18px; bottom: 78px; z-index: 91;
  width: min(370px, calc(100vw - 36px));
  height: min(480px, 70vh);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(28, 25, 22, 0.3);
  overflow: hidden;
}
.cw-panel[hidden] { display: none; }
.cw-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-size: 1.05rem;
}
.cw-close { background: none; border: none; color: inherit; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.cw-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cw-msg {
  max-width: 85%; padding: 9px 13px; border-radius: 14px;
  font-size: 0.93rem; line-height: 1.45; white-space: pre-wrap;
}
.cw-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cw-bot { align-self: flex-start; background: var(--bg-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.cw-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.cw-form input {
  flex: 1; font: inherit; font-size: 0.93rem;
  padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--ink);
}
.cw-send {
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 9px 16px;
  font: 600 0.9rem var(--font-body); cursor: pointer;
}
.cw-note { margin: 0; padding: 0 12px 10px; font-size: 0.72rem; color: var(--ink-mute); text-align: center; }
@media (max-width: 480px) { .cw-panel { bottom: 74px; height: min(430px, 62vh); } }
