/* ---------- site guide ---------- */
.chat-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 150;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px 11px 14px; border: 0; border-radius: 999px;
  background: #052427; color: #fbf7ee;
  box-shadow: 0 12px 30px rgba(2, 32, 34, 0.3);
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 9px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), background 0.2s ease;
}
.chat-launch:hover { transform: translateY(-2px); background: #0d4a4c; }
.chat-launch svg { width: 19px; height: 19px; }
.chat-launch[aria-expanded="true"] { background: #0d4a4c; }

.chat-panel {
  position: fixed; right: 22px; bottom: 82px; z-index: 150;
  display: flex; flex-direction: column;
  width: min(390px, calc(100vw - 44px));
  max-height: min(620px, calc(100vh - 120px));
  border: 1px solid rgba(8,43,45,0.14); border-radius: 18px;
  background: #fbf7ee; box-shadow: 0 28px 70px rgba(2, 32, 34, 0.3);
  overflow: hidden;
  animation: chatIn 0.22s cubic-bezier(0.22,1,0.36,1);
}
@keyframes chatIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 16px 13px; border-bottom: 1px solid rgba(8,43,45,0.14); background: #fffdf8; }
.chat-head h2 { font-size: 24px; margin-top: 2px; }
.chat-kicker { font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 8px; letter-spacing: 0.15em; text-transform: uppercase; color: #8a6824; }
.chat-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.chat-clear { border: 0; background: transparent; color: #082b2d; opacity: 0.6; font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; padding: 6px 4px; cursor: pointer; }
.chat-clear:hover { opacity: 1; text-decoration: underline; }
.chat-close { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(8,43,45,0.14); border-radius: 50%; background: transparent; flex: 0 0 auto; }
.chat-close:hover { border-color: #082b2d; }
.chat-close svg { width: 14px; height: 14px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 120px; }
.chat-msg { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.chat-user { align-items: flex-end; }
.chat-bubble {
  max-width: 90%; padding: 10px 12px; border-radius: 13px;
  background: #fffdf8; border: 1px solid rgba(8,43,45,0.14);
  font-size: 12.5px; line-height: 1.6; color: #082b2d;
  white-space: pre-line; overflow-wrap: anywhere;
}
.chat-user .chat-bubble { background: #052427; border-color: #052427; color: #fbf7ee; border-bottom-right-radius: 4px; }
.chat-assistant .chat-bubble { border-bottom-left-radius: 4px; }
.chat-links { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 2px; }
.chat-link {
  padding: 5px 9px; border: 1px solid rgba(8,43,45,0.14); border-radius: 999px;
  background: #f4ecdd; font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 8.5px;
  letter-spacing: 0.05em; color: #052427;
}
.chat-link:hover { border-color: #0d4a4c; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 12px; }
.chat-chips:empty { display: none; }
.chat-chip {
  padding: 6px 10px; border: 1px solid rgba(8,43,45,0.14); border-radius: 999px;
  background: transparent; color: #566c68; font-size: 10.5px; text-align: left;
}
.chat-chip:hover { border-color: #0d4a4c; color: #082b2d; }
.chat-form { display: flex; gap: 8px; padding: 12px 14px 8px; border-top: 1px solid rgba(8,43,45,0.14); background: #fffdf8; }
.chat-input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid rgba(8,43,45,0.14);
  border-radius: 999px; background: #fbf7ee; font-size: 13px; outline: none;
}
.chat-input:focus { border-color: #0d4a4c; }
.chat-send {
  padding: 0 16px; border: 0; border-radius: 999px;
  background: #052427; color: #fbf7ee;
  font-family: ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase;
}
.chat-send:disabled { opacity: 0.55; cursor: wait; }
.chat-note { padding: 0 16px 12px; font-size: 9.5px; line-height: 1.5; color: #566c68; background: #fffdf8; }
.chat-note a { text-decoration: underline; text-underline-offset: 3px; }
.chat-dot {
  display: inline-block; width: 5px; height: 5px; margin: 0 2px; border-radius: 50%;
  background: #566c68; animation: chatDot 1s infinite ease-in-out;
}
.chat-dot:nth-child(2) { animation-delay: 0.15s; }
.chat-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

@media (max-width: 860px) {
  .chat-launch { right: 14px; bottom: 84px; padding: 10px 14px; }
  .chat-panel {
    right: 10px; left: 10px; bottom: 10px; width: auto;
    max-height: calc(100vh - 20px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-panel { animation: none; }
  .chat-dot { animation: none; opacity: 0.6; }
}

