/* Yardım botu */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  box-shadow: 0 14px 30px -8px rgba(124, 58, 237, .8);
  transition: transform .2s;
}
.chat-fab:hover { transform: scale(1.06); }
.chat-fab svg { width: 28px; height: 28px; fill: #fff; transition: transform .25s, opacity .25s; position: absolute; }
.chat-fab .ic-close { opacity: 0; transform: rotate(-90deg); }
.chat-fab.open .ic-chat { opacity: 0; transform: rotate(90deg); }
.chat-fab.open .ic-close { opacity: 1; transform: none; }
.chat-fab .online-dot {
  position: absolute; right: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%;
  background: #22c55e; border: 2px solid var(--bg);
}
.chat-hint {
  position: fixed; right: 92px; bottom: 32px; z-index: 89;
  background: #fff; color: #1e1b4b; font-size: 14px; font-weight: 600;
  padding: 10px 14px; border-radius: 12px 12px 2px 12px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: all .3s; pointer-events: none;
}
.chat-hint.show { opacity: 1; transform: none; }

/* Yukarı çık butonu botun üstüne */
.to-top { bottom: 94px; right: 28px; }

.chat-box {
  position: fixed; right: 20px; bottom: 96px; z-index: 90;
  width: 370px; max-width: calc(100vw - 32px); height: 540px; max-height: calc(100vh - 130px);
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.97); transform-origin: bottom right;
  transition: opacity .25s, transform .25s, visibility .25s;
}
.chat-box.open { opacity: 1; visibility: visible; transform: none; }

.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--grad); }
.chat-avatar { position: relative; width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.18); display: grid; place-items: center; }
.chat-avatar img { width: 30px; height: 30px; }
.chat-avatar::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #5b4ae8; }
.chat-head h4 { font-size: 16px; line-height: 1.2; }
.chat-status { font-size: 12px; opacity: .9; display: flex; align-items: center; gap: 6px; }
.chat-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.chat-head .chat-x { margin-left: auto; font-size: 24px; width: 34px; height: 34px; border-radius: 8px; line-height: 1; }
.chat-head .chat-x:hover { background: rgba(255,255,255,.15); }

.chat-body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-2); }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; animation: fade .3s; white-space: pre-line; }
.msg.bot { align-self: flex-start; background: var(--card-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 4px; }
.msg a { color: var(--cyan); text-decoration: underline; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: -6px; }
.msg-time.u { align-self: flex-end; }

.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; border-bottom-left-radius: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; background: var(--card); }
.chip { font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(34, 211, 238, .35); color: var(--cyan); transition: background .2s; }
.chip:hover { background: rgba(34, 211, 238, .12); }

.chat-form { display: flex; gap: 8px; padding: 12px 14px 14px; background: var(--card); }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12); background: var(--bg); color: #fff; outline: none;
}
.chat-form input:focus { border-color: var(--cyan); }
.chat-form button { width: 44px; border-radius: 12px; background: var(--grad); display: grid; place-items: center; }
.chat-form button svg { width: 18px; height: 18px; fill: #fff; }

@media (max-width: 680px) {
  .chat-box { right: 16px; bottom: 90px; height: calc(100vh - 120px); }
  .chat-fab { right: 16px; bottom: 16px; }
  .chat-hint { display: none; }
}
