/* niokyar live chat widget — uses the site's existing design tokens */
.nk-chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font: 500 14px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.nk-chat-launcher:hover { background: hsl(var(--primary) / 0.9); }
.nk-chat-launcher:active { transform: scale(0.98); }
.nk-chat-launcher svg { width: 20px; height: 20px; }
.nk-chat-launcher .nk-chat-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: #4ade80; box-shadow: 0 0 0 2px hsl(var(--primary));
}

.nk-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 61;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  font: 400 14px/1.5 Inter, system-ui, sans-serif;
}
.nk-chat-panel[hidden] { display: none; }

.nk-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.nk-chat-head .nk-chat-title { font-weight: 600; font-size: 14px; }
.nk-chat-head .nk-chat-sub { font-size: 11px; opacity: 0.85; }
.nk-chat-close {
  margin-left: auto; background: transparent; border: none; cursor: pointer;
  color: inherit; font-size: 20px; line-height: 1; padding: 4px;
}

.nk-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  background: hsl(var(--background));
}
.nk-chat-msg { display: flex; margin: 8px 0; }
.nk-chat-msg .nk-b {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
}
.nk-chat-msg.visitor { justify-content: flex-start; }
.nk-chat-msg.visitor .nk-b { background: hsl(var(--secondary)); color: hsl(var(--foreground)); }
.nk-chat-msg.ai, .nk-chat-msg.agent { justify-content: flex-end; }
.nk-chat-msg.ai .nk-b { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.nk-chat-msg.agent .nk-b { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.nk-chat-time { font-size: 10px; color: hsl(var(--muted-foreground)); margin: 2px 6px; }
.nk-chat-time.right { text-align: right; }

.nk-chat-typing { font-size: 12px; color: hsl(var(--muted-foreground)); padding: 4px 8px; }

.nk-chat-lead {
  margin: 10px 0;
  padding: 12px;
  border: 1px dashed hsl(var(--border));
  border-radius: calc(var(--radius) - 4px);
  background: hsl(var(--card));
}
.nk-chat-lead p { font-size: 12.5px; margin: 0 0 8px; color: hsl(var(--muted-foreground)); }
.nk-chat-lead input {
  width: 100%; margin-bottom: 6px; padding: 8px 10px; font-size: 13px;
  border: 1px solid hsl(var(--input)); border-radius: 8px; background: hsl(var(--card));
  color: hsl(var(--foreground));
}
.nk-chat-lead button {
  width: 100%; padding: 9px; border: none; border-radius: 8px; cursor: pointer;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-weight: 500;
}

.nk-chat-foot {
  border-top: 1px solid hsl(var(--border));
  padding: 10px;
  background: hsl(var(--card));
}
.nk-chat-form { display: flex; gap: 8px; align-items: flex-end; }
.nk-chat-input {
  flex: 1; resize: none; max-height: 96px; min-height: 40px;
  padding: 10px 12px; font: inherit; font-size: 13.5px;
  border: 1px solid hsl(var(--input)); border-radius: 10px;
  background: hsl(var(--card)); color: hsl(var(--foreground));
}
.nk-chat-send {
  width: 40px; height: 40px; flex: 0 0 40px;
  border: none; border-radius: 10px; cursor: pointer;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
}
.nk-chat-send:disabled { opacity: 0.5; cursor: default; }
.nk-chat-note { font-size: 10.5px; color: hsl(var(--muted-foreground)); text-align: center; margin-top: 6px; }

@media (max-width: 480px) {
  .nk-chat-panel { right: 8px; left: 8px; bottom: 78px; width: auto; }
  .nk-chat-launcher { right: 12px; bottom: 12px; }
}

/* Lift the chat UI above the cookie-consent bar while it is visible. */
body.nk-consent-pending .nk-chat-launcher { bottom: 96px; }
body.nk-consent-pending .nk-chat-panel { bottom: 160px; }
