/* Support chat: floating "Ask a question" button and panel (static/chat.js). */


.chat-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; align-items: center; gap: 10px;
  border: 0; cursor: pointer; background: var(--red); color: var(--white); font-family: inherit;
  font-size: 15px; font-weight: 600; line-height: 1; border-radius: 999px; padding: 7px 20px 7px 7px;
  box-shadow: 0 10px 26px rgba(8, 25, 31, 0.28);
}
.chat-launch:hover { background: var(--red-dark); }
.chat-launch-ava { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.85); }
.chat-launch[hidden] { display: none; }

.chat-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 400px; height: min(640px, calc(100vh - 36px));
  display: flex; flex-direction: column; background: var(--white); color: var(--ink);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(8, 25, 31, 0.32); overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head { background: var(--navy); color: var(--white); display: flex; align-items: center; gap: 10px; padding: 14px 12px 14px 18px; }
.chat-head-text { flex: 1; min-width: 0; }
.chat-head-ava { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--red); flex: 0 0 auto; }
.chat-panel.is-typing .chat-head-ava { animation: nina-typing 1.2s ease-in-out infinite; }
@keyframes nina-typing { 0%, 100% { box-shadow: 0 0 0 0 rgba(231, 55, 70, 0.6); } 50% { box-shadow: 0 0 0 6px rgba(231, 55, 70, 0); } }
.chat-bot-row { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 94%; }
.chat-bot-row .chat-msg { max-width: none; min-width: 0; }
.chat-bubble-ava { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; }
.chat-head strong { display: block; font-size: 15.5px; }
.chat-head span { font-size: 12.5px; color: rgba(255, 255, 255, 0.65); }
.chat-icon-btn {
  border: 0; background: rgba(255, 255, 255, 0.1); color: var(--white); width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center; font-size: 20px; line-height: 1;
}
.chat-icon-btn:hover { background: rgba(255, 255, 255, 0.2); }

.chat-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: #F7F8F9; }
.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.chat-msg p + p, .chat-msg p + ol, .chat-msg p + ul, .chat-msg ol + p, .chat-msg ul + p { margin-top: 8px; }
.chat-msg ol, .chat-msg ul { padding-left: 1.3em; }
.chat-msg li + li { margin-top: 3px; }
.chat-msg a { color: var(--red); font-weight: 500; }
.chat-bot { align-self: flex-start; background: var(--white); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-me { align-self: flex-end; background: var(--navy); color: var(--white); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.chat-error { align-self: flex-start; background: #FDEEEF; border: 1px solid #F7C6CB; color: #8A1C27; }
.chat-error button { margin-top: 6px; border: 0; background: none; color: var(--red); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.chat-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.chat-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); opacity: 0.35; animation: chat-dot 1s infinite; }
.chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-dot { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.85; } }

.chat-suggest { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.chat-suggest button {
  border: 1px solid var(--border); background: var(--white); color: var(--ink); font: inherit; font-size: 13.5px;
  text-align: left; border-radius: 12px; padding: 8px 12px; cursor: pointer;
}
.chat-suggest button:hover { border-color: var(--red); }

.chat-form { border-top: 1px solid var(--border); padding: 10px 12px 8px; background: var(--white); }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-row textarea {
  flex: 1; resize: none; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font: inherit;
  font-size: 15px; line-height: 1.4; max-height: 120px; min-height: 44px; color: var(--ink);
}
.chat-row textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: transparent; }
.chat-send {
  border: 0; background: var(--red); color: var(--white); width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; flex: 0 0 auto;
}
.chat-send:disabled { background: #E6A7AD; cursor: default; }
.chat-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 11.5px; color: var(--ink-soft); }
.chat-foot a { color: var(--ink-soft); }
.chat-email { font-weight: 600; white-space: nowrap; }
.chat-limit { text-align: center; padding: 6px 0 2px; }
.chat-limit a { display: inline-block; background: var(--red); color: var(--white); font-weight: 600; text-decoration: none; border-radius: 10px; padding: 9px 16px; }

@media (max-width: 640px) {
  .chat-launch { right: 14px; bottom: 14px; padding: 6px 16px 6px 6px; font-size: 14.5px; }
  .chat-panel { inset: 0; width: auto; height: auto; border-radius: 0; }
  .chat-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { .chat-panel.is-typing .chat-head-ava { animation: none; } }
@media print { .chat-launch, .chat-panel { display: none !important; } }
