/* Druze Analytics — chatbot widget. Uses the site's brand tokens from site.css */
.dz-chat { position: fixed; right: 20px; bottom: 20px; z-index: 60; font-family: "DM Sans Variable", "DM Sans", system-ui, sans-serif; }
.dz-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dz-launcher { display: flex; align-items: center; gap: 10px; border: 0; cursor: pointer; color: #fff;
  background-image: var(--gradient-cta); border-radius: 999px; padding: 10px 18px 10px 10px;
  box-shadow: 0 10px 30px -8px hsl(202 100% 38% / .65); font: inherit; font-weight: 600; font-size: 15px;
  transition: transform .2s ease, box-shadow .2s ease; }
.dz-launcher:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px hsl(202 100% 38% / .7); }
.dz-launcher-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: rgb(255 255 255 / .18); }
.dz-chat.is-open .dz-launcher { display: none; }

.dz-panel { width: 380px; height: min(620px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: hsl(var(--card)); color: hsl(var(--card-foreground)); border: 1px solid hsl(var(--border));
  border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px -12px rgb(15 23 42 / .35);
  animation: dz-in .22s ease-out; }
.dz-panel[hidden] { display: none; }
@keyframes dz-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.dz-head { display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 16px; color: #fff; background: hsl(var(--ink)); }
.dz-avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background-image: var(--gradient-primary);
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 18px; }
.dz-head-text { flex: 1; min-width: 0; }
.dz-head h2 { margin: 0; font-family: "Space Grotesk", sans-serif; font-size: 16px; font-weight: 600; }
.dz-head p { margin: 2px 0 0; font-size: 12px; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.dz-dot { width: 7px; height: 7px; border-radius: 99px; background: #22c55e; }
.dz-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: #cbd5e1; cursor: pointer; }
.dz-icon-btn:hover { background: rgb(255 255 255 / .1); color: #fff; }

.dz-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: hsl(var(--background)); scroll-behavior: smooth; }
.dz-msg { max-width: 85%; padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: pre-line; word-wrap: break-word; animation: dz-msg .2s ease-out; }
@keyframes dz-msg { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.dz-bot { align-self: flex-start; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-bottom-left-radius: 4px; }
.dz-user { align-self: flex-end; color: #fff; background-image: var(--gradient-cta); border-bottom-right-radius: 4px; }
.dz-summary { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13.5px; }
.dz-summary li { padding: 3px 0; border-top: 1px dashed hsl(var(--border)); }
.dz-summary li:first-child { border-top: 0; }
.dz-summary b { color: hsl(var(--muted-foreground)); font-weight: 500; }
.dz-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.dz-typing i { width: 6px; height: 6px; border-radius: 99px; background: hsl(var(--muted-foreground)); animation: dz-blink 1s infinite; }
.dz-typing i:nth-child(2) { animation-delay: .15s; } .dz-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dz-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.dz-options { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px; background: hsl(var(--background)); max-height: 40%; overflow-y: auto; }
.dz-options:not(:empty) { padding: 4px 12px 12px; }
.dz-opt { border: 1px solid hsl(var(--primary) / .55); background: hsl(var(--card)); color: hsl(var(--primary-strong));
  border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.dz-opt:hover { background: hsl(var(--primary)); color: #fff; }
.dz-opt.dz-primary { background-image: var(--gradient-cta); border-color: transparent; color: #fff; }
.dz-opt.dz-muted { border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); }

.dz-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.dz-form[hidden] { display: none; }
.dz-input { flex: 1; min-width: 0; border: 1px solid hsl(var(--input)); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 15px;
  color: hsl(var(--foreground)); background: hsl(var(--background)); outline: none; }
.dz-input:focus { border-color: hsl(var(--primary)); box-shadow: 0 0 0 3px hsl(var(--primary) / .2); }
.dz-input[hidden] { display: none; }
.dz-textarea { resize: none; }
.dz-send { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; color: #fff; background-image: var(--gradient-cta); cursor: pointer; }
.dz-send:disabled { opacity: .5; cursor: not-allowed; }
.dz-hint { margin: 0; padding: 0 14px 10px; font-size: 12.5px; color: #dc2626; background: hsl(var(--card)); }
.dark .dz-hint { color: #f87171; }

@media (max-width: 520px) {
  .dz-chat { right: 12px; bottom: 12px; }
  .dz-launcher-text { display: none; }
  .dz-launcher { padding: 8px; }
  .dz-chat.is-open { inset: 0; right: 0; bottom: 0; }
  .dz-panel { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}
@media (prefers-reduced-motion: reduce) { .dz-panel, .dz-msg { animation: none; } .dz-typing i { animation: none; opacity: .6; } }