/* ============================================================
   ASISTEN TANYA-JAWAB — dijawab AI lokal di server DGX sendiri
   ============================================================ */
#tb-tanya-buka{
  position:fixed; right:22px; bottom:22px; z-index:80;
  display:flex; align-items:flex-end; gap:0; cursor:pointer;
  padding:0; border:0; background:transparent; box-shadow:none;
  animation:tb-apung 4.2s ease-in-out infinite;
  transition:transform .28s cubic-bezier(.34,1.4,.5,1);
}
#tb-tanya-buka:hover{ transform:translateY(-5px) scale(1.03) }
@keyframes tb-apung{ 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }

/* figur asisten tanpa latar — berdiri di atas kotak biru */
#tb-tanya-buka .figur{
  width:auto; height:176px; display:block; margin:0 -16px -14px 0;
  object-fit:contain; object-position:bottom center;
  filter:drop-shadow(0 16px 24px rgba(0,0,0,.6));
  pointer-events:none;
}

/* kotak biru ajakan */
#tb-tanya-buka .kotak{
  position:relative; overflow:hidden;
  display:flex; flex-direction:column; gap:5px; text-align:left;
  padding:17px 26px 16px; border-radius:18px;
  /* kaca tembus pandang: menyatu dengan gambar di belakangnya, warna hanya sebagai semburat */
  background:linear-gradient(135deg,rgba(34,211,238,.28),rgba(15,23,42,.42) 45%,rgba(56,189,248,.26));
  background-size:200% 100%; color:#EAF7FB;
  -webkit-backdrop-filter:blur(14px) saturate(1.4); backdrop-filter:blur(14px) saturate(1.4);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 18px 40px -18px rgba(0,0,0,.7), 0 0 28px -6px rgba(34,211,238,.45), 0 0 0 1px rgba(34,211,238,.18) inset;
  max-width:min(360px,calc(100vw - 150px));
  animation:tb-geser 7s ease-in-out infinite, tb-nafas 4.2s ease-in-out infinite;
}
@keyframes tb-nafas{ 0%,100%{box-shadow:0 18px 40px -18px rgba(0,0,0,.7), 0 0 28px -6px rgba(34,211,238,.35), 0 0 0 1px rgba(34,211,238,.18) inset}
  50%{box-shadow:0 18px 40px -18px rgba(0,0,0,.7), 0 0 38px -4px rgba(34,211,238,.6), 0 0 0 1px rgba(34,211,238,.3) inset} }
@keyframes tb-geser{ 0%,100%{background-position:0% 50%} 50%{background-position:100% 50%} }

/* kilau menyapu tiap beberapa detik */
#tb-tanya-buka .kotak::after{
  content:""; position:absolute; top:0; bottom:0; left:-60%; width:45%;
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.28),transparent);
  transform:skewX(-18deg); animation:tb-kilau 5.5s ease-in-out infinite;
}
@keyframes tb-kilau{ 0%,72%{left:-60%} 88%,100%{left:130%} }

#tb-tanya-buka .tulisan{
  font:700 15px/1.3 "Archivo",system-ui,sans-serif; letter-spacing:.01em; text-transform:none;
  position:relative; z-index:1; text-shadow:0 1px 8px rgba(0,0,0,.45);
}
#tb-tanya-buka .ajak{
  position:relative; z-index:1; display:inline-flex; align-items:center; gap:7px;
  font:700 12px/1.3 "Chakra Petch","Archivo",sans-serif; letter-spacing:.11em; text-transform:uppercase;
  color:#7EEBFF; white-space:nowrap; text-shadow:0 1px 6px rgba(0,0,0,.45);
}
#tb-tanya-buka .ajak::after{
  content:"→"; font-size:13px; transition:transform .25s ease;
  animation:tb-tunjuk 2.6s ease-in-out infinite;
}
@keyframes tb-tunjuk{ 0%,100%{transform:translateX(0)} 50%{transform:translateX(5px)} }
#tb-tanya-buka:hover .ajak::after{ transform:translateX(7px) }

/* lampu hijau "sedang siap" + denyut */
#tb-tanya-buka .titik{
  position:absolute; right:14px; bottom:54px;
  width:11px; height:11px; border-radius:50%; background:#0BDA6E;
  box-shadow:0 0 0 2px rgba(255,255,255,.25), 0 0 12px #0BDA6E; z-index:2;
}
#tb-tanya-buka .titik::before{
  content:""; position:absolute; inset:-5px; border-radius:50%;
  border:2px solid rgba(11,218,110,.55); animation:tb-denyut 2.2s ease-out infinite;
}
@keyframes tb-denyut{ 0%{transform:scale(.7);opacity:.9} 70%,100%{transform:scale(1.6);opacity:0} }

@media (prefers-reduced-motion:reduce){
  #tb-tanya-buka, #tb-tanya-buka *{ animation:none !important }
}

#tb-tanya .kepala .wajah.besar{ width:44px; height:44px; border-radius:50%; object-fit:cover;
  object-position:50% 22%; flex:none; border:2px solid rgba(56,189,248,.4) }

body.tb-tanya-terbuka #tb-tanya-buka{ opacity:0; pointer-events:none }

#tb-tanya{
  position:fixed; right:22px; bottom:22px; z-index:81; width:min(400px,calc(100vw - 32px));
  height:min(600px,calc(100vh - 44px)); display:flex; flex-direction:column;
  background:rgba(12,17,26,.98); backdrop-filter:blur(16px);
  border:1px solid rgba(56,189,248,.26); border-radius:18px; overflow:hidden;
  box-shadow:0 34px 70px -26px rgba(0,0,0,.95);
  opacity:0; visibility:hidden; transform:translateY(14px) scale(.98);
  transition:opacity .22s ease, transform .22s ease, visibility .22s;
}
body.tb-tanya-terbuka #tb-tanya{ opacity:1; visibility:visible; transform:none }
@media(max-width:520px){ #tb-tanya{ right:8px; left:8px; bottom:8px; width:auto; height:calc(100vh - 16px) } }

#tb-tanya .kepala{ display:flex; align-items:center; gap:12px; padding:15px 16px;
  border-bottom:1px solid rgba(28,40,54,.9); background:rgba(15,22,33,.7) }

#tb-tanya .kepala b{ display:block; font:700 14px "Archivo",sans-serif; color:#EAF2FB }
#tb-tanya .kepala small{ display:block; font-size:11px; color:#8FA3B8; letter-spacing:.02em }
#tb-tanya .kepala button{ margin-left:auto; background:transparent; border:0; cursor:pointer;
  color:#8FA3B8; font-size:22px; line-height:1; padding:4px 8px; border-radius:8px }
#tb-tanya .kepala button:hover{ background:rgba(248,113,113,.14); color:#F87171 }

#tb-tanya .isi{ flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px }
#tb-tanya .isi::-webkit-scrollbar{ width:8px }
#tb-tanya .isi::-webkit-scrollbar-thumb{ background:rgba(56,189,248,.22); border-radius:8px }
.tb-pesan{ max-width:86%; padding:11px 14px; border-radius:14px; font-size:14.5px; line-height:1.62;
  white-space:pre-wrap; word-wrap:break-word }
.tb-pesan.ai{ align-self:flex-start; background:rgba(15,22,33,.95); border:1px solid rgba(28,40,54,.9); color:#EAF2FB;
  border-bottom-left-radius:5px }
.tb-pesan.saya{ align-self:flex-end; background:linear-gradient(135deg,rgba(34,211,238,.92),rgba(56,189,248,.92));
  color:#04222B; border-bottom-right-radius:5px; font-weight:500 }
.tb-pesan b{ color:#38BDF8 }
.tb-pesan.saya b{ color:#04222B }
.tb-ketik{ display:inline-flex; gap:5px; align-items:center }
.tb-ketik i{ width:6px; height:6px; border-radius:50%; background:#38BDF8; animation:tb-loncat 1.1s infinite }
.tb-ketik i:nth-child(2){ animation-delay:.15s } .tb-ketik i:nth-child(3){ animation-delay:.3s }
@keyframes tb-loncat{ 0%,60%,100%{transform:translateY(0);opacity:.35} 30%{transform:translateY(-5px);opacity:1} }

#tb-tanya .saran{ display:flex; gap:8px; flex-wrap:wrap; padding:0 16px 12px }
#tb-tanya .saran button{ cursor:pointer; padding:8px 12px; border-radius:999px;
  border:1px solid rgba(56,189,248,.3); background:rgba(15,22,33,.7); color:#8FA3B8;
  font:500 12.5px "Inter",system-ui,sans-serif; letter-spacing:0; text-transform:none }
#tb-tanya .saran button:hover{ background:rgba(56,189,248,.14); color:#EAF2FB }

#tb-tanya form{ display:flex; gap:8px; padding:12px 14px; border-top:1px solid rgba(28,40,54,.9);
  background:rgba(15,22,33,.7) }
#tb-tanya textarea{ flex:1; resize:none; max-height:110px; padding:11px 13px; border-radius:10px;
  border:1px solid rgba(28,40,54,.9); background:#0A0F17; color:#EAF2FB;
  font:15px "Inter",system-ui,sans-serif; line-height:1.5 }
#tb-tanya textarea:focus{ outline:2px solid rgba(56,189,248,.55); border-color:transparent }
#tb-tanya form button{ flex:none; width:46px; height:46px; align-self:flex-end; cursor:pointer;
  border:0; border-radius:10px; background:linear-gradient(135deg,#22D3EE,#38BDF8); color:#04222B;
  display:grid; place-items:center }
#tb-tanya form button:disabled{ opacity:.45; cursor:default }
#tb-tanya form button svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:2 }
#tb-tanya .kaki{ padding:0 16px 12px; font-size:10.5px; color:#5D7183; text-align:center; letter-spacing:.02em }

@media (max-width:520px){
  #tb-tanya-buka{ right:12px; bottom:12px }
  #tb-tanya-buka .figur{ height:132px; margin-right:-12px }
  #tb-tanya-buka .kotak{ padding:13px 17px; max-width:calc(100vw - 140px) }
  #tb-tanya-buka .tulisan{ font-size:13px }
  #tb-tanya-buka .ajak{ font-size:10.5px; letter-spacing:.1em }
  #tb-tanya-buka .titik{ right:10px; bottom:46px; width:10px; height:10px }
}
