/* New Kontrast AI assistant widget */
.nk-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99980;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: #EE1C25;
  color: #fff;
  box-shadow: 0 10px 28px rgba(238, 28, 37, 0.45);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.nk-fab:hover { background: #c9161e; transform: scale(1.04); }
.nk-fab svg { width: 24px; height: 24px; }

.nk-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 99981;
  width: min(400px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 110px));
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: Rubik, system-ui, sans-serif;
}
.nk-panel[hidden] { display: none !important; }

.nk-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #111;
  color: #fff;
}
.nk-panel-head strong { display: block; font-size: 15px; }
.nk-panel-head p { margin: 4px 0 0; font-size: 12px; opacity: 0.75; line-height: 1.35; }
.nk-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.nk-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: #fafafa;
}
.nk-welcome { font-size: 14px; color: #333; line-height: 1.45; margin-bottom: 10px; }
.nk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nk-chip {
  border: 1px solid #EE1C25;
  color: #EE1C25;
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
.nk-chip:hover { background: #fff1f1; }
.nk-chip:disabled { opacity: 0.5; cursor: default; }

.nk-msg { margin: 0 0 10px; max-width: 92%; }
.nk-msg-user { margin-left: auto; }
.nk-bubble {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.nk-msg-user .nk-bubble { background: #EE1C25; color: #fff; border-bottom-right-radius: 4px; }
.nk-msg-assistant .nk-bubble { background: #fff; border: 1px solid #e8e8e8; color: #111; border-bottom-left-radius: 4px; }
.nk-typing { opacity: 0.7; font-style: italic; }

.nk-error {
  margin: 0;
  padding: 0 14px 8px;
  color: #EE1C25;
  font-size: 12px;
}

.nk-gate {
  padding: 8px 14px;
  border-top: 1px solid #eee;
  background: #fff;
  font-size: 12px;
  color: #444;
}
.nk-gate label { display: flex; gap: 8px; align-items: flex-start; line-height: 1.35; cursor: pointer; }
.nk-gate a { color: #1757ff; }
.nk-gate altcha-widget { display: block; margin-top: 8px; }

.nk-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #eee;
  background: #fff;
}
.nk-form input[type="text"] {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}
.nk-form input[type="text"]:focus { border-color: #EE1C25; }
.nk-send {
  border: 0;
  border-radius: 10px;
  background: #EE1C25;
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.nk-send:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 480px) {
  .nk-panel { right: 12px; bottom: 80px; height: min(70vh, 520px); }
  .nk-fab { right: 14px; bottom: 14px; }
}
