/* SPINPANG Velvet Ruby-Obsidian & Burnished Rose-Gold Live AI Chat Styling */
.np-chat-fab {
  position: fixed;
  right: 12px;
  bottom: 20px;
  z-index: 9100;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.65px solid #68e1ed;
  background: radial-gradient(circle at 30% 24%, #362652 0%, #211833 100%);
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 1.5px 3px rgba(216,251,255, 0.36), 0 4px 0 rgba(0, 0, 0, 0.5), 0 10px 24px rgba(0, 0, 0, 0.6);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.np-chat-fab:active {
  transform: translateY(2px) scale(0.95);
}

.np-chat-fab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#npChatPanel[hidden] {
  display: none !important;
}

#npChatPanel {
  position: fixed;
  right: 12px;
  bottom: 80px;
  z-index: 9200;
  width: min(94vw, 376px);
  max-height: min(74dvh, 540px);
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto auto;
  border: 1.65px solid rgba(104,225,237, 0.48);
  border-radius: 14px;
  background: #211833;
  color: #f5eeff;
  font-family: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

@media (max-width: 900px) {
  .np-chat-fab {
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }
  #npChatPanel {
    bottom: calc(144px + env(safe-area-inset-bottom, 0px));
    max-height: min(460px, calc(100dvh - 164px - env(safe-area-inset-bottom, 0px)));
  }
}

#npChatPanel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1.65px solid rgba(104,225,237, 0.3);
  background: linear-gradient(145deg, #362652, #362652);
  color: #d8fbff;
}

#npChatPanel header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #d8fbff;
}

#npChatPanel .is-ghost {
  border: 1.65px solid rgba(104,225,237, 0.4);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #d8fbff;
  padding: 0.3rem 0.62rem;
  cursor: pointer;
  font: 600 0.82rem/1 "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

.np-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(104,225,237, 0.18);
  background: #211833;
}

.np-chat-chip {
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1.65px solid rgba(104,225,237, 0.36);
  background: rgba(100,67,151, 0.28);
  color: #d8fbff;
  font: 600 0.76rem/1.2 "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  cursor: pointer;
}

.np-chat-chip:hover {
  background: rgba(100,67,151, 0.58);
}

#npChatPanel [data-chat-messages] {
  list-style: none;
  margin: 0;
  padding: 0.75rem;
  overflow-y: auto;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  background: #211833;
}

#npChatPanel [data-chat-messages] li {
  max-width: 88%;
  padding: 0.55rem 0.78rem;
  border-radius: 12px;
  background: #362652;
  border: 1px solid rgba(104,225,237, 0.2);
  color: #f5eeff;
  font-size: 0.85rem;
  line-height: 1.45;
  word-break: break-word;
}

#npChatPanel [data-chat-messages] li strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
  color: #68e1ed;
}

#npChatPanel [data-chat-messages] li.chat-from-member {
  justify-self: end;
  background: linear-gradient(145deg, #644397, #362652);
  border-color: rgba(104,225,237, 0.42);
  color: #ffffff;
}

#npChatPanel [data-chat-messages] li.chat-from-member strong {
  color: #d8fbff;
}

#npChatPanel [data-chat-messages] li img {
  display: block;
  max-width: 180px;
  border-radius: 8px;
  margin-top: 0.4rem;
}

#npChatPanel [data-chat-status] {
  margin: 0;
  padding: 0 0.75rem 0.35rem;
  font-size: 0.78rem;
  color: #d6c8f0;
}

#npChatPanel [data-chat-status]:empty { display: none; }

.np-chat-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: #211833;
}

.np-chat-preview img {
  height: 48px;
  border-radius: 6px;
}

.np-chat-compose {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-top: 1.65px solid rgba(104,225,237, 0.24);
  background: #211833;
  align-items: center;
}

.np-chat-compose textarea {
  resize: none;
  min-height: 38px;
  padding: 0.45rem 0.65rem;
  border: 1.65px solid rgba(104,225,237, 0.34);
  border-radius: 10px;
  background: #211833;
  color: #f5eeff;
  font: 14px/1.3 "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

.np-chat-compose button[type="submit"] {
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  border-radius: 10px;
  border: 1.65px solid #d8fbff;
  background: linear-gradient(180deg, #d8fbff 0%, #68e1ed 58%, #3dc6de 100%);
  color: #17132a;
  font: 800 0.85rem/1 "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  cursor: pointer;
}
