/* Live chat widget (Tawk-style) */
.livechat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--text-invert);
  border-radius: 999px;
  padding: 12px 16px 12px 14px;
  box-shadow: 0 12px 32px rgba(14, 165, 233, 0.35);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13.5px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.livechat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(14, 165, 233, 0.45); }
.livechat-launcher .icon-svg { width: 20px; height: 20px; }
.livechat-launcher .label { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .livechat-launcher .label { display: none; }
  .livechat-launcher { padding: 14px; border-radius: 50%; }
}

.livechat-panel {
  position: fixed;
  right: 22px;
  bottom: 84px;
  z-index: 121;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.livechat-panel.open { display: flex; animation: vdsReveal .35s var(--ease); }

.livechat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, #0c4a6e, #0ea5e9);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.livechat-header h3 { margin: 0; font-size: 16px; color: #fff; }
.livechat-header p { margin: 4px 0 0; font-size: 12.5px; color: #bae6fd; }
.livechat-close {
  background: transparent; border: none; color: #bae6fd; cursor: pointer; padding: 4px;
}
.livechat-close:hover { color: #fff; }
.livechat-close .icon-svg { width: 18px; height: 18px; }

.livechat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-muted);
}
.livechat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.livechat-bubble.visitor { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.livechat-bubble.admin, .livechat-bubble.system { align-self: flex-start; background: #fff; border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.livechat-bubble.system { opacity: .85; font-size: 12.5px; }
.livechat-bubble .who { display:block; font-size:11px; opacity:.75; margin-bottom:3px; }

.livechat-form { padding: 12px; border-top: 1px solid var(--border); background: var(--bg-elevated); }
.livechat-form .pre-fields { display: grid; gap: 8px; margin-bottom: 8px; }
.livechat-compose { display: flex; gap: 8px; }
.livechat-compose input[type="text"] { flex: 1; }
.livechat-compose button { flex-shrink: 0; }
.livechat-compose .icon-svg { width: 16px; height: 16px; }
