/* AI 문의 플로팅 위젯 (홈페이지) */
.fab .fab-ai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4f5fc4 0%, #5867aa 55%, #3d4a8f 100%);
  box-shadow: 0 8px 24px rgba(88, 103, 170, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fab .fab-ai:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(88, 103, 170, 0.45);
}
.fab .fab-ai svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.fab .fab-ai.is-on {
  box-shadow: 0 0 0 3px rgba(88, 103, 170, 0.35);
}

.hj-ai-panel {
  position: fixed;
  right: 20px;
  bottom: 168px;
  z-index: 9998;
  width: min(400px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 200px));
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(88, 103, 170, 0.2);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  pointer-events: none;
}
.hj-ai-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.hj-ai-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e8eaf3);
  background: linear-gradient(180deg, #f6f7fc 0%, #fff 100%);
  border-radius: 16px 16px 0 0;
}
.hj-ai-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink, #1a1d2e);
}
.hj-ai-panel__sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted, #5c6378);
  font-weight: 400;
}
.hj-ai-panel__close {
  border: none;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--muted, #5c6378);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hj-ai-panel__close:hover {
  background: #eceef7;
  color: var(--brand-600, #5867aa);
}
.hj-ai-panel__status {
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.45;
  background: #eceef7;
  color: #454d73;
}
.hj-ai-panel__status.is-error {
  background: #fef2f2;
  color: #991b1b;
}
.hj-ai-panel__status.is-ok {
  background: #ecfdf5;
  color: #065f46;
}
.hj-ai-panel__log {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
  padding: 14px 12px;
  background: #fafbfd;
}
.hj-ai-panel__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line, #e8eaf3);
  background: #fff;
  border-radius: 0 0 16px 16px;
}
.hj-ai-panel__input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line, #e8eaf3);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
}
.hj-ai-panel__input:focus {
  outline: 2px solid rgba(88, 103, 170, 0.35);
  border-color: var(--brand-500, #6b78b8);
}
.hj-ai-panel__send,
.hj-ai-panel__stop {
  flex-shrink: 0;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.hj-ai-panel__send {
  background: var(--brand-600, #5867aa);
  color: #fff;
}
.hj-ai-panel__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.hj-ai-panel__stop {
  background: #fee2e2;
  color: #991b1b;
  display: none;
}
.hj-ai-panel__stop.is-on {
  display: inline-block;
}
.hj-ai-bubble-row {
  display: flex;
  margin-bottom: 12px;
}
.hj-ai-bubble-row--user {
  justify-content: flex-end;
}
.hj-ai-bubble-row--assistant {
  justify-content: flex-start;
}
.hj-ai-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.hj-ai-bubble--user {
  background: #5867aa;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.hj-ai-bubble--assistant {
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.hj-ai-think {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 10px;
  font-size: 12px;
  color: #5867aa;
}
.hj-ai-think.is-on {
  display: flex;
}
.hj-ai-think__dots span {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 1px;
  border-radius: 50%;
  background: #5867aa;
  animation: hj-ai-dot 1.2s infinite ease-in-out;
}
.hj-ai-think__dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.hj-ai-think__dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes hj-ai-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (max-width: 480px) {
  .hj-ai-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 150px;
  }
}
