#july-ai-chat-button { position: fixed; right: 20px; bottom: 24px; z-index: 9998; width: 54px; height: 54px; border: 0; border-radius: 50%; padding: 0; display: flex;align-items: center;
        justify-content: center; background: #000; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.22);  }
#july-ai-chat-button span { display: block; line-height: 1.2; }
#july-ai-chat-button img { width: 40px; }
#july-ai-chat-panel { position: fixed; right: 24px; bottom: 100px; z-index: 9999; width: 360px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 140px); background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.2); overflow: hidden; display: none; flex-direction: column; }
#july-ai-chat-panel.is-open { display: flex; }
.july-ai-chat-header { padding: 18px 18px 14px; background: #111827; color: #fff; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.july-ai-chat-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.july-ai-chat-desc { font-size: 12px; color: rgba(255,255,255,.75); margin: 0; line-height: 1.4; }
.july-ai-chat-close { border: 0; background: transparent; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.july-ai-chat-body { flex: 1; padding: 16px; overflow-y: auto; background: #f9fafb; }
.july-ai-message { margin-bottom: 12px; display: flex; }
.july-ai-message.assistant { justify-content: flex-start; }
.july-ai-message.user { justify-content: flex-end; }
.july-ai-bubble { max-width: 82%; padding: 11px 13px; border-radius: 16px; font-size: 14px; line-height: 1.55; word-break: keep-all; white-space: pre-wrap; }
.july-ai-message.assistant .july-ai-bubble { background: #fff; color: #111827; border: 1px solid #e5e7eb; border-top-left-radius: 4px; }
.july-ai-message.user .july-ai-bubble { background: #111827; color: #fff; border-top-right-radius: 4px; }
.july-ai-chat-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; background: #f9fafb; }
.july-ai-quick-btn { border: 1px solid #d1d5db; background: #fff; color: #374151; border-radius: 999px; padding: 8px 11px; font-size: 12px; cursor: pointer; }
.july-ai-chat-form { display: flex; gap: 8px; padding: 14px; border-top: 1px solid #e5e7eb; background: #fff; }
#july-ai-chat-input { flex: 1; height: 42px; border: 1px solid #d1d5db; border-radius: 12px; padding: 0 12px; font-size: 14px; outline: none; }
#july-ai-chat-input:focus { border-color: #111827; }
.july-ai-chat-send { width: 64px; border: 0; border-radius: 12px; background: #111827; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
@media (max-width:768px) {
   #july-ai-chat-button { right: 20px; bottom: 20px; width: 45px; height: 45px; border-radius: 50%; padding: 0; display: flex;align-items: center;
        justify-content: center;}
   #july-ai-chat-button img { width: 30px;}
    #july-ai-chat-panel { right: 12px; bottom: 92px; width: calc(100vw - 24px); height: 70vh; }
}
.july-ai-upgrade-box { padding: 18px 16px 20px; background: #fff; border-top: 1px solid #e5e7eb; }
.july-ai-upgrade-box p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: #374151; word-break: keep-all; }
.july-ai-upgrade-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; border-radius: 12px; background: #111827; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; }
.july-ai-upgrade-btn:hover { color: #fff; text-decoration: none; }
/* AI 채팅 말풍선 텍스트 정렬 보정 */
#july-ai-chat-panel, #july-ai-chat-panel * { text-align: left; }
#july-ai-chat-panel .july-ai-chat-title, #july-ai-chat-panel .july-ai-chat-desc { text-align: left; }
#july-ai-chat-panel .july-ai-bubble { text-align: left; word-break: keep-all; overflow-wrap: break-word; white-space: pre-line; }
#july-ai-chat-panel .july-ai-message.user .july-ai-bubble { text-align: left; }
.july-ai-chat-send { text-align: center !important; }
.july-ai-typing .july-ai-bubble { color: #4b5563; }
.july-ai-typing-dots { display: inline-block; min-width: 22px; margin-left: 2px; }
.july-ai-assistant-toast { position: fixed; right: 24px; bottom: 98px; z-index: 9997; max-width: 280px; padding: 12px 14px; border-radius: 16px; background: #111827; color: #fff; font-size: 13px; line-height: 1.45; box-shadow: 0 12px 32px rgba(0,0,0,.22); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .35s ease, transform .35s ease; word-break: keep-all; }
.july-ai-assistant-toast.is-show { opacity: 1; transform: translateY(0); }
.july-ai-assistant-toast::after { content: ""; position: absolute; right: 28px; bottom: -7px; width: 14px; height: 14px; background: #111827; transform: rotate(45deg); }
@media (max-width:480px) {
    .july-ai-assistant-toast { right: 18px; bottom: 92px; max-width: calc(100vw - 80px); }
}
#july-ai-chat-button { animation: julyAiButtonFloat 2.8s ease-in-out infinite; }
@keyframes julyAiButtonFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
#july-ai-chat-button:hover { animation-play-state: paused; transform: translateY(-3px) scale(1.03); }



/* =========================================================
   JULY SHORTS - AI CHAT MOBILE SAFARI FIX
   iOS Safari / Naver App / Kakao In-app Browser 대응
========================================================= */

@supports (height:100dvh) {
  #july-ai-chat-panel { max-height: calc(100dvh - 140px); }
}
@media (max-width:768px) {
  #july-ai-chat-button { right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); }
  #july-ai-chat-panel { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); width: auto; max-width: none; height: auto; max-height: calc(100vh - 112px - env(safe-area-inset-bottom)); display: none; overflow: hidden; border-radius: 20px; -webkit-transform: translateZ(0); transform: translateZ(0); }
  @supports (height:100dvh) {
    #july-ai-chat-panel { max-height: calc(100dvh - 112px - env(safe-area-inset-bottom)); }
  }
  #july-ai-chat-panel.is-open { display: flex; }
  .july-ai-chat-header { flex: 0 0 auto; padding: 16px 16px 13px; }
  .july-ai-chat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .july-ai-chat-quick { flex: 0 0 auto; max-height: 92px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 14px 12px; }
  .july-ai-chat-form { flex: 0 0 auto; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  #july-ai-chat-input { font-size: 16px; }
}
@media (max-width:480px) {
  #july-ai-chat-panel { left: 10px; right: 10px; bottom: calc(78px + env(safe-area-inset-bottom)); max-height: calc(100vh - 100px - env(safe-area-inset-bottom)); border-radius: 18px; }
  @supports (height:100dvh) {
    #july-ai-chat-panel { max-height: calc(100dvh - 100px - env(safe-area-inset-bottom)); }
  }
  .july-ai-bubble { max-width: 88%; font-size: 14px; }
  .july-ai-chat-send { width: 58px; }
}

@media (max-width:768px) {
  .july-ai-assistant-toast { right: 16px; bottom: calc(82px + env(safe-area-inset-bottom)); max-width: min(280px, calc(100vw - 96px)); z-index: 9997; }
  .july-ai-assistant-toast::after { right: 24px; }
}
@media (max-width:480px) {
  .july-ai-assistant-toast { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); max-width: calc(100vw - 92px); }
  .july-ai-assistant-toast::after { right: 22px; }
}



