/* survey chat bubble */
.chat { position: fixed; right: 20px; bottom: 20px; z-index: 50; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.chat-fab {
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; cursor: pointer;
  font: 700 15px/1 var(--display, system-ui); color: #09090d; border: 0; border-radius: 999px;
  background: linear-gradient(95deg, #3ee6f5, #ff5fb4);
  box-shadow: 0 12px 34px -10px rgba(255, 95, 180, .55), 0 8px 24px -12px rgba(62, 230, 245, .6);
  transition: transform .2s, box-shadow .2s;
}
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat.open .chat-fab { display: none; }

.chat-panel {
  display: flex; flex-direction: column; width: 360px; height: min(560px, calc(100vh - 40px));
  background: #13131a; border: 1px solid #3a3a48; border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
}
.chat-panel[hidden] { display: none; }
.chat-panel header { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid #25252f; }
.chat-panel header div { display: grid; flex: 1; min-width: 0; }
.chat-panel header b { font: 700 16px/1.2 var(--display, system-ui); color: #f3f3f7; }
.chat-panel header small { color: #9d9dac; font-size: 12px; }
.chat-avatar {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px;
  font: 700 13px/1 Arial, sans-serif; color: #09090d; background: linear-gradient(135deg, #3ee6f5, #ff5fb4);
}
.chat-close {
  width: 34px; height: 34px; cursor: pointer; font-size: 22px; line-height: 1; color: #9d9dac;
  background: transparent; border: 1px solid #25252f; border-radius: 999px;
}
.chat-close:hover { color: #f3f3f7; border-color: #3a3a48; }

.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; color: #f3f3f7; overflow-wrap: anywhere; }
.chat-msg.bot { align-self: flex-start; background: #1b1b25; border-bottom-left-radius: 6px; }
.chat-msg.me { align-self: flex-end; background: #25252f; border-bottom-right-radius: 6px; }
.chat-msg.me b { color: #3ee6f5; margin-right: 4px; }
.chat-msg.good { border: 1px solid rgba(62, 230, 245, .5); }
.chat-msg.bad { border: 1px solid rgba(255, 95, 180, .5); }
.chat-count { display: block; margin-bottom: 4px; font: 500 12px/1 var(--display, system-ui); letter-spacing: .08em; color: #9d9dac; }
.chat-score {
  display: block; margin-bottom: 4px; font: 700 34px/1.1 var(--display, system-ui);
  background: linear-gradient(95deg, #3ee6f5, #ff5fb4); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.chat-actions { display: grid; gap: 6px; padding: 12px; border-top: 1px solid #25252f; }
.chat-actions:empty { display: none; }
.chat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 8px 12px; cursor: pointer; text-align: left;
  font: 500 14px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #f3f3f7;
  background: #09090d; border: 1px solid #25252f; border-radius: 12px; transition: border-color .15s, background .15s;
}
.chat-btn b { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 8px; font-size: 12px; color: #9d9dac; border: 1px solid #3a3a48; }
.chat-btn:hover:not(:disabled) { border-color: #3a3a48; background: #1b1b25; }
.chat-btn:disabled { cursor: default; opacity: .55; }
.chat-btn.right { opacity: 1; border-color: #3ee6f5; background: rgba(62, 230, 245, .1); }
.chat-btn.right b { color: #09090d; background: #3ee6f5; border-color: #3ee6f5; }
.chat-btn.wrong { opacity: 1; border-color: #ff5fb4; background: rgba(255, 95, 180, .1); }
.chat-btn.wrong b { color: #09090d; background: #ff5fb4; border-color: #ff5fb4; }
.chat-btn.primary { justify-content: center; font-weight: 600; color: #09090d; background: #f3f3f7; border-color: #f3f3f7; }
.chat-btn.primary:hover { background: #fff; }

@media (max-width: 480px) {
  .chat { right: 12px; bottom: 12px; }
  .chat-panel { position: fixed; inset: auto 8px 8px 8px; width: auto; height: min(560px, calc(100vh - 16px)); }
}
.chat-actions.multi { max-height: 52%; overflow-y: auto; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chat-chip {
  min-height: 36px; padding: 6px 12px; cursor: pointer;
  font: 500 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #f3f3f7;
  background: #09090d; border: 1px solid #3a3a48; border-radius: 999px; transition: background .15s, border-color .15s, color .15s;
}
.chat-chip:hover { border-color: #9d9dac; }
.chat-chip[aria-pressed="true"] { color: #09090d; background: linear-gradient(95deg, #3ee6f5, #ff5fb4); border-color: transparent; }
.chat-btn.primary:disabled { opacity: .35; cursor: not-allowed; }
.chat-input { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.chat-input input {
  min-width: 0; min-height: 42px; padding: 0 12px; font: 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #f3f3f7; background: #09090d; border: 1px solid #3a3a48; border-radius: 12px;
}
.chat-input input:focus { outline: none; border-color: #3ee6f5; }
.chat-input .chat-btn { width: auto; padding: 0 16px; }
.chat-msg.typing { display: flex; gap: 4px; padding: 13px 14px; }
.chat-msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9d9dac; animation: chat-dot 1s infinite; }
.chat-msg.typing i:nth-child(2) { animation-delay: .15s; }
.chat-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.chat-msg.bot b { color: #3ee6f5; }
