/* ==========================================================================
   Chatbot "Juru Tutur Daha"
   ========================================================================== */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 180; display: inline-flex; align-items: center; gap: 10px; height: 58px; padding: 0 22px 0 18px; border-radius: 999px; border: 0; cursor: pointer; color: #241705; font-family: var(--f-ui); font-weight: 700; font-size: .95rem; background: linear-gradient(135deg, #f6dd96, #c98f2a); box-shadow: 0 10px 30px rgba(201, 143, 42, .5), 0 0 0 1px rgba(255, 255, 255, .25) inset; transition: transform .2s, box-shadow .3s; }
.fab::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 2px solid #f3d28a; animation: fabPulse 2.6s infinite; pointer-events: none; }
.fab:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 14px 38px rgba(230, 185, 95, .7); }
.fab:active { transform: scale(.97); }
.fab[aria-expanded="true"] { opacity: 0; visibility: hidden; transform: scale(.8); }
@keyframes fabPulse { 0% { transform: scale(1); opacity: .8; } 70%, 100% { transform: scale(1.35, 1.5); opacity: 0; } }
@media (max-width: 520px) { .fab-label { display: none; } .fab { padding: 0; width: 58px; justify-content: center; } }

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 260; width: min(410px, 100vw - 24px); height: min(640px, 100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border: 1px solid var(--gold-fill); border-radius: 22px; box-shadow: 0 24px 80px rgba(0, 0, 0, .55); overflow: hidden; animation: chatIn .35s cubic-bezier(.2, .8, .2, 1); font-family: var(--f-ui); }
.chat[hidden] { display: none; }
@keyframes chatIn { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #14262d, #0d1a20); color: #f3ead4; border-bottom: 1px solid rgba(246, 217, 138, .3); }
.chat-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat-head h2 { font-family: var(--f-display); font-size: .98rem; letter-spacing: .08em; color: #f6d98a; }
.chat-head p { margin: 2px 0 0; font-size: .72rem; opacity: .8; line-height: 1.2; }
.chat-actions { display: flex; gap: 6px; flex: none; }
.chat-head .icon-btn { width: 34px; height: 34px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; background: linear-gradient(180deg, var(--bg2), var(--surface)); }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.6; animation: fadeUp .3s; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, #f3d28a, #d5a03b); color: #241705; border-bottom-right-radius: 5px; font-weight: 500; }
.msg.refuse { background: var(--gold-soft); border: 1px dashed var(--gold-fill); }
.msg.error { background: rgba(196, 69, 45, .1); border: 1px solid rgba(196, 69, 45, .5); color: var(--ink); }
.msg p { margin: 0 0 .6em; }
.msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: .3em 0 .6em; padding-left: 1.3em; }
.msg li { margin-bottom: .25em; }
.msg strong { color: var(--gold); font-weight: 700; }
.msg.user strong { color: inherit; }
.msg em { font-style: italic; }
.msg code { font-family: ui-monospace, monospace; font-size: .85em; background: var(--gold-soft); padding: 1px 5px; border-radius: 4px; }
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-fill); animation: bounce 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }
.chat-chips { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); scrollbar-width: none; background: var(--surface); }
.chat-chips::-webkit-scrollbar { display: none; }
.chat-chips:empty { display: none; }
.chat-chips button { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--gold-fill); background: transparent; color: var(--ink2); cursor: pointer; font-size: .76rem; white-space: nowrap; transition: .2s; }
.chat-chips button:hover { background: var(--gold-soft); color: var(--gold); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 6px; background: var(--surface); }
.chat-form textarea { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: 11px 14px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: .92rem; line-height: 1.4; }
.chat-form textarea:focus { outline: none; border-color: var(--gold-fill); box-shadow: 0 0 0 4px var(--gold-soft); }
.send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #241705; background: linear-gradient(135deg, #f6dd96, #c98f2a); transition: transform .15s, opacity .2s; }
.send:hover:not(:disabled) { transform: scale(1.08); }
.send:disabled { opacity: .45; cursor: not-allowed; }
.chat-foot { margin: 0; padding: 2px 14px 10px; font-size: .68rem; color: var(--muted); text-align: center; background: var(--surface); }
@media (max-width: 560px) {
  .chat { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
}
