/* 챗봇 위젯 (사이트의 초록 테마 변수를 그대로 사용) */
#dgt-chat-btn {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--g-800, #24521a); color: #fff; font: inherit; font-weight: 900; font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(6, 15, 7, 0.35); transition: transform .15s ease, background .2s;
}
#dgt-chat-btn:hover { transform: translateY(-2px); background: var(--g-700, #3b7d25); }
#dgt-chat-btn.open { background: var(--g-900, #060f07); }
.dgt-chat-btn-icon { font-size: 1.15rem; line-height: 1; }

#dgt-chat {
  position: fixed; right: 20px; bottom: 80px; z-index: 91; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 110px));
  display: flex; flex-direction: column; background: var(--paper, #fff); border: 1px solid var(--line, #d9ecce); border-radius: 16px;
  box-shadow: 0 16px 48px rgba(36, 82, 26, 0.28); overflow: hidden; font-family: inherit; color: var(--ink, #15241a);
  animation: dgt-pop .18s ease;
}
#dgt-chat[hidden] { display: none; } /* ID 선택자의 display:flex 가 hidden 속성을 덮지 않도록 */
@keyframes dgt-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dgt-chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--g-900, #060f07); color: #fff; }
.dgt-chat-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 0.95rem; color: var(--lime, #8ef05a); }
.dgt-chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime, #8ef05a); box-shadow: 0 0 0 3px rgba(142, 240, 90, .25); }
.dgt-chat-actions { display: flex; gap: 6px; }
.dgt-chat-actions button { background: transparent; border: 1px solid #2a5a36; color: var(--g-200, #cdeab8); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 0.75rem; cursor: pointer; }
.dgt-chat-actions button:hover { background: #163520; }
.dgt-chat-body { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--g-50, #f3faee); }
.dgt-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 0.9rem; line-height: 1.55; word-break: break-word; }
.dgt-msg p { margin: 0; }
.dgt-msg ul { margin: 4px 0 4px 18px; padding: 0; }
.dgt-msg li { margin: 2px 0; }
.dgt-msg .dgt-gap { height: 6px; }
.dgt-msg a { color: var(--g-700, #3b7d25); font-weight: 700; text-decoration: underline; text-decoration-color: var(--g-300, #a9db8a); }
.dgt-msg code { background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 4px; font-size: 0.85em; }
.dgt-msg-user { align-self: flex-end; background: var(--g-700, #3b7d25); color: #fff; border-bottom-right-radius: 4px; }
.dgt-msg-assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line, #d9ecce); border-bottom-left-radius: 4px; }
.dgt-msg-error { border-color: #e0b4b2; background: #fff4f3; color: #8a2a27; }
.dgt-msg-note { border-left: 3px solid var(--accent, #f3d85a); }
.dgt-typing { display: inline-flex; gap: 4px; align-items: center; height: 14px; }
.dgt-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--g-500, #6cbf45); animation: dgt-bounce 1s infinite; }
.dgt-typing i:nth-child(2) { animation-delay: .15s; } .dgt-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dgt-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
.dgt-chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--line, #d9ecce); background: #fff; }
.dgt-chat-form textarea { flex: 1; resize: none; border: 1.5px solid var(--g-200, #cdeab8); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 0.9rem; line-height: 1.4; max-height: 120px; outline: none; }
.dgt-chat-form textarea:focus { border-color: var(--g-500, #6cbf45); box-shadow: 0 0 0 3px rgba(108, 191, 69, .18); }
.dgt-chat-send { width: 40px; height: 40px; border: none; border-radius: 10px; background: var(--g-700, #3b7d25); color: #fff; font-size: 1rem; cursor: pointer; flex: none; }
.dgt-chat-send:disabled { opacity: .5; cursor: default; }
.dgt-chat-foot { padding: 6px 12px 8px; font-size: 0.7rem; color: var(--muted, #6b8070); background: #fff; text-align: center; }
@media (max-width: 480px) {
  #dgt-chat { right: 8px; bottom: 72px; width: calc(100vw - 16px); height: calc(100vh - 90px); border-radius: 14px; }
  #dgt-chat-btn { right: 12px; bottom: 12px; padding: 11px 14px; }
}
