:root {
  --nkw-ai-ink: #082f2a;
  --nkw-ai-paper: #fffdf8;
  --nkw-ai-line: #d7e2dc;
  --nkw-ai-accent: #e8792e;
  --nkw-ai-user: #123f37;
}

.nkw-ai-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--nkw-ai-ink);
  box-shadow: 0 16px 38px rgba(8, 47, 42, .24);
  font: 700 14px/1.1 inherit;
  cursor: pointer;
}

.nkw-ai-launcher:hover { transform: translateY(-2px); }
.nkw-ai-launcher svg { width: 22px; height: 22px; }

.nkw-ai-panel {
  position: fixed;
  right: 22px;
  bottom: 88px;
  z-index: 2147483001;
  display: none;
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100dvh - 112px));
  overflow: hidden;
  border: 1px solid var(--nkw-ai-line);
  border-radius: 22px;
  color: var(--nkw-ai-ink);
  background: var(--nkw-ai-paper);
  box-shadow: 0 24px 70px rgba(8, 47, 42, .24);
  font-family: Inter, Arial, sans-serif;
}

.nkw-ai-panel.is-open { display: grid; grid-template-rows: auto 1fr auto; }

.nkw-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  color: #fff;
  background: var(--nkw-ai-ink);
}

.nkw-ai-heading { min-width: 0; }
.nkw-ai-heading strong { display: block; font-size: 16px; }
.nkw-ai-heading span { display: block; margin-top: 3px; color: #cfe3dc; font-size: 12px; }

.nkw-ai-close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  color: #fff;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.nkw-ai-messages {
  overflow-y: auto;
  padding: 18px;
  background: linear-gradient(180deg, #f4f7f2 0%, #fffdf8 45%);
}

.nkw-ai-message { display: flex; margin: 0 0 14px; }
.nkw-ai-message.is-user { justify-content: flex-end; }
.nkw-ai-bubble {
  max-width: 88%;
  padding: 11px 13px;
  border: 1px solid var(--nkw-ai-line);
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nkw-ai-message.is-user .nkw-ai-bubble {
  border-color: var(--nkw-ai-user);
  border-radius: 16px 16px 4px 16px;
  color: #fff;
  background: var(--nkw-ai-user);
}

.nkw-ai-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nkw-ai-typing { color: #58716a; font-style: italic; }

.nkw-ai-compose {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--nkw-ai-line);
  background: #fff;
}

.nkw-ai-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.nkw-ai-input {
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #b9cbc4;
  border-radius: 12px;
  color: var(--nkw-ai-ink);
  background: #fff;
  font: 14px/1.4 inherit;
}

.nkw-ai-input:focus { outline: 3px solid rgba(232,121,46,.18); border-color: var(--nkw-ai-accent); }
.nkw-ai-send {
  min-width: 72px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--nkw-ai-accent);
  font: 800 13px/1 inherit;
  cursor: pointer;
}
.nkw-ai-send:disabled { opacity: .55; cursor: wait; }
.nkw-ai-note { margin: 8px 2px 0; color: #657b74; font-size: 10px; line-height: 1.35; }
.nkw-ai-note a { color: inherit; }

@media (max-width: 520px) {
  .nkw-ai-launcher { right: 14px; bottom: 14px; min-height: 50px; padding: 0 15px; }
  .nkw-ai-panel { right: 7px; bottom: 72px; width: calc(100vw - 14px); height: min(620px, calc(100dvh - 86px)); border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .nkw-ai-launcher { transition: none; }
}
