/* MY JDA Assistant - chat bubble (black + gold) */
#jdai-btn{position:fixed;right:24px;bottom:24px;width:62px;height:62px;border-radius:50%;border:2px solid #d4af37;
  background:#0b0b0b;box-shadow:0 6px 22px rgba(0,0,0,.45);cursor:pointer;z-index:2147483000;display:flex;align-items:center;
  justify-content:center;padding:0;transition:transform .15s}
#jdai-btn:hover{transform:scale(1.06)}
#jdai-btn img{width:40px;height:40px;border-radius:50%;object-fit:cover}
#jdai-btn svg{width:30px;height:30px;fill:#d4af37}
#jdai-box{position:fixed;right:24px;bottom:98px;width:370px;max-width:calc(100vw - 24px);height:560px;max-height:calc(100vh - 130px);
  background:#0e0e0e;border:1px solid #3a3221;border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.55);z-index:2147483000;
  display:none;flex-direction:column;overflow:hidden;font-family:inherit;color:#d8cfbe}
#jdai-box.open{display:flex}
#jdai-head{display:flex;align-items:center;gap:10px;padding:12px 14px;background:linear-gradient(135deg,#171307,#0b0b0b);
  border-bottom:1px solid #3a3221}
#jdai-head img{width:34px;height:34px;border-radius:50%;border:1px solid #d4af37}
#jdai-head b{display:block;color:#e8c35a;font-size:15px;letter-spacing:.3px}
#jdai-head small{color:#9d927d;font-size:12px}
#jdai-x{margin-left:auto;background:none;border:0;color:#9d927d;font-size:22px;cursor:pointer;line-height:1}
#jdai-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:#0e0e0e}
.jdai-m{max-width:85%;padding:9px 12px;border-radius:14px;font-size:14px;line-height:1.45;white-space:pre-wrap;word-wrap:break-word}
.jdai-m a{color:#e8c35a;text-decoration:underline;word-break:break-all}
.jdai-bot{align-self:flex-start;background:#1b1810;border:1px solid #2e2716;color:#d8cfbe;border-bottom-left-radius:4px}
.jdai-me{align-self:flex-end;background:linear-gradient(135deg,#d4af37,#b8902f);color:#111;border-bottom-right-radius:4px}
.jdai-typing{align-self:flex-start;color:#9d927d;font-size:13px;padding:2px 4px}
#jdai-wa{display:none;margin:0 14px 8px;padding:8px;border:1px solid #2e7d32;border-radius:10px;color:#7bd88f;text-align:center;
  font-size:13px;text-decoration:none}
#jdai-form{display:flex;gap:8px;padding:10px;border-top:1px solid #2a2418;background:#0b0b0b}
#jdai-in{flex:1;background:#171513;border:1px solid #3a3221;border-radius:10px;color:#e8dfcc;padding:9px 11px;font-size:14px;
  resize:none;height:40px;max-height:110px;font-family:inherit}
#jdai-in:focus{outline:none;border-color:#d4af37}
#jdai-send{background:linear-gradient(135deg,#d4af37,#b8902f);border:0;border-radius:10px;color:#111;font-weight:700;
  padding:0 14px;cursor:pointer}
#jdai-send:disabled{opacity:.5;cursor:default}
#jdai-foot{display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;color:#8a7f69;padding:2px 0 9px;background:#0b0b0b}
#jdai-foot img{width:22px;height:22px;border-radius:50%;object-fit:cover;display:block}
#jdai-foot b{color:#d4af37;font-weight:600}
#jdai-prev{background:#3a2c08;color:#e8c35a;font-size:11px;text-align:center;padding:3px}
@media (max-width:600px){#jdai-btn{right:22px;bottom:65px;width:56px;height:56px}
  #jdai-box{right:6px;left:6px;width:auto;bottom:130px;height:calc(100vh - 150px)}}

/* 2026-11-19: draggable bubble */
#jdai-btn{user-select:none;-webkit-user-select:none;touch-action:none}
#jdai-btn img,#jdai-btn svg{pointer-events:none;-webkit-user-drag:none}
@media (max-width:600px){#jdai-box{z-index:2147483001}}

/* 2026-11-19 (owner, iPhone app): smaller window that stays clear of the notch and the home bar; 16px text box so
   the iPhone does not zoom in when typing (that zoom pushed the window off the screen). */
@media (max-width:600px){
  #jdai-btn{bottom:calc(env(safe-area-inset-bottom,0px) + 65px)}
  #jdai-box{left:10px;right:10px;width:auto;top:auto;bottom:calc(env(safe-area-inset-bottom,0px) + 80px);
    height:min(68vh,520px);height:min(68dvh,520px);
    max-height:calc(100vh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 120px);
    max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 120px);border-radius:14px}
  #jdai-in{font-size:16px}
  .jdai-m{font-size:14px}
}
