/* Nova Presswire chat widget — floating bubble + slide-up panel.
   Vanilla CSS, no build step. Scoped with .npw-chat prefix so it can't collide
   with site styles. */

.npw-chat-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4), 0 2px 6px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.npw-chat-fab:hover { transform: scale(1.05); }
.npw-chat-fab:focus-visible { outline: 3px solid #60a5fa; outline-offset: 2px; }
.npw-chat-fab svg { width: 26px; height: 26px; }

.npw-chat-fab-pulse {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.35);
  animation: npw-chat-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes npw-chat-pulse {
  0%   { transform: scale(1);   opacity: 0.7; }
  80%  { transform: scale(1.6); opacity: 0; }
  100% { transform: scale(1.6); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .npw-chat-fab-pulse { animation: none; display: none; }
  .npw-chat-fab { transition: none; }
}

.npw-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  height: 560px;
  max-height: calc(100vh - 7rem);
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2), 0 2px 8px rgba(15, 23, 42, 0.08);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: #0f172a;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.npw-chat-panel.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.npw-chat-header {
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.npw-chat-header-title { font-weight: 600; font-size: 0.95rem; }
.npw-chat-header-sub { font-size: 0.75rem; opacity: 0.9; }
.npw-chat-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.npw-chat-close:hover { background: rgba(255, 255, 255, 0.15); }
.npw-chat-close svg { width: 18px; height: 18px; }

.npw-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.npw-chat-msg {
  max-width: 85%;
  padding: 0.6rem 0.85rem;
  border-radius: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.npw-chat-msg-assistant {
  align-self: flex-start;
  background: white;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.npw-chat-msg-user {
  align-self: flex-end;
  background: #2563eb;
  color: white;
  border-bottom-right-radius: 4px;
}
.npw-chat-msg-system {
  align-self: center;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
}

.npw-chat-msg-typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 0.6rem 0.85rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}
.npw-chat-msg-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #94a3b8;
  animation: npw-chat-bounce 1.2s infinite ease-in-out;
}
.npw-chat-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.npw-chat-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes npw-chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.npw-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1rem 0.5rem;
  background: #f8fafc;
}
.npw-chat-suggestion {
  background: white;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.npw-chat-suggestion:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.npw-chat-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: white;
}
.npw-chat-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.npw-chat-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.npw-chat-send {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.npw-chat-send:hover { background: #1d4ed8; }
.npw-chat-send:disabled { background: #94a3b8; cursor: not-allowed; }

.npw-chat-footer {
  text-align: center;
  font-size: 0.7rem;
  color: #94a3b8;
  padding: 0.4rem;
  background: white;
  border-top: 1px solid #f1f5f9;
}

/* Contextual product tiles — full-width, inside the messages column */
.npw-chat-tile {
  align-self: stretch;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.npw-chat-tile-head { display: flex; flex-direction: column; gap: 0.15rem; }
.npw-chat-tile-title { font-weight: 700; font-size: 0.95rem; color: #0f172a; }
.npw-chat-tile-sub { font-size: 0.75rem; color: #64748b; }
.npw-chat-tile-body {
  margin: 0;
  font-size: 0.825rem;
  color: #334155;
  line-height: 1.5;
}

.npw-chat-tile-items { display: flex; flex-direction: column; gap: 0; border-top: 1px solid #f1f5f9; }
.npw-chat-tile-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9;
}
.npw-chat-tile-item:last-child { border-bottom: none; padding-bottom: 0; }
.npw-chat-tile-item-main { min-width: 0; }
.npw-chat-tile-item-label { font-weight: 600; font-size: 0.82rem; color: #0f172a; }
.npw-chat-tile-item-sub { font-size: 0.72rem; color: #64748b; margin-top: 0.1rem; }
.npw-chat-tile-item-value {
  flex-shrink: 0; font-weight: 600; font-size: 0.82rem; color: #1d4ed8;
  background: #eff6ff; padding: 0.15rem 0.5rem; border-radius: 9999px; white-space: nowrap;
}

.npw-chat-tile-ctas { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.2rem; }
.npw-chat-tile-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1; border-radius: 8px;
  background: white; color: #1e293b;
  font-size: 0.8rem; font-weight: 500; text-decoration: none; cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.npw-chat-tile-cta:hover { background: #f8fafc; border-color: #94a3b8; }
.npw-chat-tile-cta.primary {
  background: #2563eb; color: white; border-color: #2563eb;
}
.npw-chat-tile-cta.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

.npw-chat-escalate {
  align-self: stretch;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  font-size: 0.8rem;
  max-width: 100%;
}
.npw-chat-lead-title {
  font-weight: 600; color: #1e3a8a; margin-bottom: 0.25rem; text-align: left;
}
.npw-chat-rep-tag {
  font-size: 0.65rem; font-weight: 700; color: #065f46; text-transform: uppercase;
  letter-spacing: 0.03em; margin-bottom: 0.2rem;
}
.npw-chat-msg-assistant .npw-chat-rep-tag + div { color: #0f172a; }

@media (max-width: 480px) {
  .npw-chat-panel {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 5rem;
    width: auto;
    max-width: none;
  }
  .npw-chat-fab {
    bottom: 1rem;
    right: 1rem;
  }
}
