/* Sohbet asistanı (yalnızca panelden açıldığında yüklenir) */
.chat-fab { position: fixed; right: 24px; bottom: 24px; z-index: 36; width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(var(--brand-rgb), .4); cursor: pointer; transition: transform .2s; }
.chat-fab:hover { transform: scale(1.06); }
.chat-fab i { position: absolute; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--wa); border: 2px solid #fff; }
.chat-box { position: fixed; right: 24px; bottom: 96px; z-index: 60; width: 380px; max-width: calc(100vw - 24px); height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-lg); overflow: hidden; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s, transform .18s; }
.chat-box.open { opacity: 1; transform: none; pointer-events: auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: var(--brand); color: #fff; }
.chat-head .av { flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; }
.chat-head b { display: block; font-size: 15px; line-height: 1.2; }
.chat-head small { display: block; font-size: 11.5px; opacity: .85; }
.chat-head .x { margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.chat-head .x:hover { background: rgba(255, 255, 255, .15); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); overscroll-behavior: contain; }
.chat-msg { max-width: 86%; margin: 0 0 10px; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-line; word-wrap: break-word; }
.chat-msg.b { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.chat-msg.u { margin-left: auto; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg a { color: var(--brand); text-decoration: underline; word-break: break-all; }
.chat-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .4; animation: chatdot 1s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatdot { 50% { opacity: 1; } }
.chat-cards { display: grid; gap: 8px; margin: -2px 0 12px; max-width: 92%; }
.chat-card { display: flex; gap: 10px; align-items: center; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.chat-card:hover { border-color: var(--brand); }
.chat-card img { flex: none; width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; }
.chat-card b { display: block; font-size: 13px; line-height: 1.3; font-weight: 600; }
.chat-card span { font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.chat-card s { margin-left: 5px; font-size: 12px; color: var(--muted); font-weight: 400; }
.chat-card em { display: block; font-style: normal; font-size: 11.5px; color: var(--danger); }
.chat-wa { display: inline-flex; align-items: center; gap: 7px; margin: -2px 0 12px; padding: 8px 13px; border-radius: 999px; background: var(--wa); color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chat-chips button { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.chat-chips button:hover { border-color: var(--brand); color: var(--brand); }
.chat-foot { border-top: 1px solid var(--line); background: var(--surface); }
.chat-live { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; background: #ecfdf3; color: #15803d; font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.chat-live:hover { background: #dcfce7; }
.chat-form { display: flex; gap: 8px; padding: 10px; }
.chat-form textarea { flex: 1; min-height: 42px; max-height: 110px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 14px; resize: none; color: var(--ink); background: var(--surface); }
.chat-form textarea:focus { outline: none; border-color: var(--brand); }
.chat-form button { flex: none; width: 44px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.chat-form button[disabled] { opacity: .5; cursor: default; }
.chat-note { padding: 0 12px 9px; margin: -2px 0 0; font-size: 11px; color: var(--muted); text-align: center; }
@media (max-width: 991px) {
  .chat-box { right: 0; left: 0; bottom: 0; width: auto; max-width: none; height: calc(100% - 40px); height: calc(100dvh - 40px); border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  body.chat-locked { overflow: hidden; }
}
