:root {
  --nia-ink: #17120d;
  --nia-paper: #fff8ed;
  --nia-card: rgba(255, 252, 244, 0.96);
  --nia-line: rgba(61, 42, 23, 0.18);
  --nia-accent: #146b4a;
  --nia-dark: #1e150d;
}

.nia-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  background: #17120d;
  color: #fff8ed;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  font: 800 0.95rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.nia-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 81;
  width: min(390px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 110px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--nia-line);
  border-radius: 24px;
  background: var(--nia-card);
  color: var(--nia-ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  font-family: Inter, system-ui, sans-serif;
}

.nia-chat-panel[data-open="true"] { display: flex; }

.nia-chat-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--nia-line);
  background: linear-gradient(135deg, #fff9ee 0%, #f6e7ca 100%);
}

.nia-chat-kicker {
  margin: 0 0 4px;
  color: #7a6045;
  font: 800 0.72rem/1.2 JetBrains Mono, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nia-chat-head strong { display: block; font-size: 1.08rem; }
.nia-chat-head span { display: block; margin-top: 4px; color: #6b5948; font-size: 0.86rem; line-height: 1.35; }
.nia-chat-close { border: 0; background: transparent; color: var(--nia-ink); font-size: 1.5rem; cursor: pointer; }

.nia-chat-messages {
  overflow: auto;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.nia-chat-msg {
  max-width: 88%;
  padding: 11px 12px;
  border-radius: 16px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.nia-chat-msg[data-role="nia"] { background: #f0e1c7; justify-self: start; }
.nia-chat-msg[data-role="visitor"] { background: var(--nia-dark); color: #fff8ed; justify-self: end; }

.nia-chat-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--nia-line);
  background: rgba(255, 248, 237, 0.94);
}

.nia-chat-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nia-chat-inputs input,
.nia-chat-form textarea {
  width: 100%;
  border: 1px solid var(--nia-line);
  border-radius: 14px;
  background: #fffdf8;
  color: var(--nia-ink);
  padding: 10px 11px;
  font: 500 0.88rem/1.3 Inter, system-ui, sans-serif;
}

.nia-chat-form textarea { min-height: 82px; resize: vertical; grid-column: 1 / -1; }
.nia-chat-form button[type="submit"] {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--nia-accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.nia-chat-note { margin: 0; color: #725f4d; font-size: 0.75rem; line-height: 1.35; }

@media (max-width: 560px) {
  .nia-chat-launcher { right: 14px; bottom: 14px; }
  .nia-chat-panel { right: 14px; bottom: 70px; }
  .nia-chat-inputs { grid-template-columns: 1fr; }
}
