/* Ask Hyunnes 위젯 — 우측 하단 플로팅 버튼 + 패널 */

#ask-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border: 0; border-radius: 999px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, #f59e0b, #a855f7);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
#ask-fab:hover { filter: brightness(1.06); }
.ask-fab-star { font-size: 17px; }

#ask-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 61;
  width: min(420px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.ask-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(90deg, #fdf0d5, #ede4f8);
  cursor: move;                 /* 헤더를 잡아 패널을 옮길 수 있다 */
  user-select: none;            /* 끌 때 텍스트가 선택되지 않도록 */
  touch-action: none;           /* pointermove 가 스크롤에 먹히지 않도록 */
}
.ask-head-actions { cursor: default; }
.ask-brand { display: flex; align-items: center; gap: 9px; font-size: 16px; }
.ask-star { color: #f59e0b; font-size: 19px; }
.ask-head-actions { display: flex; gap: 6px; }
.ask-icon {
  border: 0; background: transparent; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 6px 8px; border-radius: 6px; color: #333;
}
.ask-icon:hover { background: rgba(0, 0, 0, .07); }

.ask-body { flex: 1; overflow-y: auto; padding: 22px 18px; }
.ask-h2 { text-align: center; font-size: 22px; font-weight: 700; margin: 18px 0 10px; }
.ask-sub { text-align: center; color: #666; font-size: 14px; margin-bottom: 18px; }

/* 잠금 화면 */
#ask-unlock-form { display: flex; flex-direction: column; gap: 10px; max-width: 300px; margin: 0 auto; }
#ask-password {
  padding: 11px 13px; border: 1px solid #d6d6de; border-radius: 9px; font-size: 15px;
}
#ask-password:focus { outline: 2px solid #a855f7; outline-offset: -1px; }
.ask-primary {
  padding: 11px; border: 0; border-radius: 9px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, #f59e0b, #a855f7);
}
.ask-error { color: #c0392b; font-size: 13px; text-align: center; margin-top: 12px; }

/* 추천 질문 */
.ask-suggests { display: flex; flex-direction: column; gap: 10px; }
.ask-suggest {
  padding: 13px 14px; border: 1px solid #e2c9a0; border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 14px; text-align: center; color: #222;
}
.ask-suggest:hover { border-color: #a855f7; background: #faf7ff; }

/* 대화 */
#ask-thread { display: flex; flex-direction: column; gap: 14px; }
.ask-msg { font-size: 14px; line-height: 1.65; }
.ask-msg.user {
  align-self: flex-end; max-width: 85%;
  background: #f3f0ff; padding: 10px 13px; border-radius: 12px 12px 2px 12px;
}
.ask-msg.bot { white-space: pre-wrap; word-break: break-word; }
.ask-msg.bot table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.ask-msg.bot th, .ask-msg.bot td { border: 1px solid #e5e5ea; padding: 5px 7px; text-align: left; }

/* 진행 상태 */
.ask-steps { font-size: 12.5px; color: #7a7a86; display: flex; flex-direction: column; gap: 4px; }
.ask-step::before { content: "· "; }
.ask-step.done { color: #4a9d5f; }
.ask-step.done::before { content: "✓ "; }
.ask-spin {
  display: inline-block; width: 11px; height: 11px; margin-right: 6px;
  border: 2px solid #d9d9e0; border-top-color: #a855f7; border-radius: 50%;
  animation: ask-spin .8s linear infinite; vertical-align: -1px;
}
@keyframes ask-spin { to { transform: rotate(360deg); } }

/* 입력 */
.ask-foot { border-top: 1px solid #eee; padding: 12px 14px 10px; background: #fafafa; }
#ask-form { display: flex; gap: 8px; align-items: center; }
#ask-input {
  flex: 1; padding: 11px 13px; border: 1px solid #d6d6de; border-radius: 10px; font-size: 14px;
}
#ask-input:focus { outline: 2px solid #a855f7; outline-offset: -1px; }
#ask-input:disabled { background: #f2f2f5; color: #999; }
#ask-send {
  border: 0; background: transparent; cursor: pointer; font-size: 19px; color: #8b8b96; padding: 4px 8px;
}
#ask-send:disabled { opacity: .4; cursor: default; }
.ask-disclaimer { font-size: 11.5px; color: #8a8a94; text-align: center; margin-top: 9px; line-height: 1.5; }

@media (max-width: 480px) {
  #ask-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100vh - 16px); }
  #ask-fab { right: 12px; bottom: 12px; }
}
