/* =========================
   RESET
========================= */
#ad b-wrap, /* typo-safe no-op if minifier strips? intentionally harmless selector won't match */
.adb-wrap,
.adb-wrap * {
  box-sizing: border-box;
}

.adb-wrap a {
  text-decoration: none;
}

.adb-wrap button,
.adb-wrap input {
  font: inherit;
}

/* =========================
   WRAP / FLOATING
========================= */
.adb-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
}

.adb-float-msg {
  position: absolute;
  right: 6px;
  bottom: 74px;
  max-width: 240px;
  padding: 11px 14px;
  border: 1px solid #d9dee8;
  border-radius: 14px;
  background: #fff;
  color: #333;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  white-space: normal;
  word-break: keep-all;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.adb-float-msg::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -7px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid #d9dee8;
  border-bottom: 1px solid #d9dee8;
  transform: rotate(45deg);
}

.adb-float-msg.is-hide {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}

.adb-toggle {
  width: 60px;
  height: 60px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #4d8cff 0%, #2f6df6 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(47, 109, 246, 0.35);
  cursor: pointer;
  position: relative;
  z-index: 2;
}

.adb-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}

.adb-toggle.is-active {
  transform: scale(0.98);
}

/* =========================
   PANEL
========================= */
.adb-panel {
  position: fixed;
  right: 5px;
  bottom: 92px;
  width: 350px;
  max-width: calc(100vw - 24px);
  height: 850px;
  max-height: calc(100vh - 118px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
  z-index: 999999;
}

.adb-panel.is-open {
  display: flex;
}

/* =========================
   HEADER
========================= */
.adb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, #3d82ff 0%, #2f6df6 100%);
  color: #fff;
}

.adb-header-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.adb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 12px;
  font-weight: 700;
}

.adb-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.adb-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

/* =========================
   QUICK MENU
========================= */
.chatbot-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 10px;
  background: #f8f9fc;
  border-bottom: 1px solid #eef1f6;
}

.chatbot-menu-btn {
  border: 1px solid #dce2ec;
  background: #fff;
  color: #333;
  border-radius: 10px;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

/* =========================
   BODY
========================= */
.adb-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: #f5f7fb;
  -webkit-overflow-scrolling: touch;
}

/* =========================
   WELCOME
========================= */
.adb-welcome {
  padding: 20px 16px;
  border: 1px solid #e7ebf3;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  color: #333;
}

.adb-bot-avatar {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: #edf3ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.adb-welcome h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #222;
}

.adb-welcome p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: #555;
  word-break: keep-all;
}

/* =========================
   MESSAGE ROW
========================= */
.adb-msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.55;
}

.adb-msg-bot {
  justify-content: flex-start;
}

.adb-msg-user {
  justify-content: flex-end;
}

.adb-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e9eef8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex: 0 0 34px;
}

.adb-msg-content {
  max-width: calc(100% - 44px);
  min-width: 0;
}

.adb-msg-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  word-break: keep-all;
  overflow-wrap: break-word;
  white-space: normal;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.adb-msg-bot .adb-msg-bubble {
  background: #fff;
  color: #222;
  border-top-left-radius: 6px;
  border: 1px solid #e9edf5;
}

.adb-msg-user .adb-msg-bubble {
  background: linear-gradient(180deg, #4d8cff 0%, #2f6df6 100%);
  color: #fff;
  border-top-right-radius: 6px;
}

.adb-msg-time {
  margin-top: 5px;
  font-size: 11px;
  color: #8b93a5;
}

/* =========================
   BOT REPLY TEXT
========================= */
.adb-reply-text {
  line-height: 1.65;
}

/* =========================
   CTA BUTTONS
========================= */
.adb-msg-bot .adb-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.adb-msg-bot .adb-cta-wrap a {
  text-decoration: none !important;
}

.adb-msg-bot .adb-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
  border: 1px solid transparent;
  white-space: nowrap;
}

.adb-msg-bot .adb-cta-call {
  background: #2f6df6;
  border-color: #2f6df6;
  color: #fff !important;
}

.adb-msg-bot .adb-cta-reserve {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff !important;
}

.adb-msg-bot .adb-cta-kakao {
  background: #fee500;
  border-color: #e5d200;
  color: #222 !important;
}

.adb-msg-bot .adb-cta-btn:hover {
  opacity: 0.92;
  text-decoration: none !important;
}

/* =========================
   LOADING
========================= */
.adb-loading-bubble {
  min-width: 64px;
  text-align: center;
}

.adb-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: #96a0b5;
  animation: adbBlink 1.2s infinite;
}

.adb-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.adb-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes adbBlink {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* =========================
   FOOTER NOTE / POLICY
========================= */
.adb-footer-note {
  padding: 10px 14px 6px;
  background: #fff;
  color: #666;
  font-size: 12px;
  line-height: 1.55;
  border-top: 1px solid #eef1f6;
}

.adb-form {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  flex: 0 0 auto;
}

.adb-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d8deea;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  color: #222;
  outline: none;
}

.adb-input::placeholder {
  color: #9ca3af;
}

.adb-input:focus {
  border-color: #8bb0ff;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.08);
}

.adb-send {
  flex: 0 0 auto;
  min-width: 72px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #4d8cff 0%, #2f6df6 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  z-index: 60;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.adb-send:disabled {
  opacity: 0.6;
  cursor: default;
}

.adb-policy {
  padding: 0 14px 14px;
  background: #fff;
  font-size: 12px;
  color: #667085;
}

.adb-policy a {
  color: #4b67b2;
  text-decoration: none;
}

.adb-policy span {
  display: inline-block;
  margin: 0 6px;
  color: #b0b7c5;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {
  .adb-wrap {
    right: 12px;
    bottom: 12px;
  }

  .adb-float-msg {
    right: 4px;
    bottom: 70px;
    max-width: 220px;
    font-size: 12px;
    padding: 10px 12px;
  }

  .adb-toggle {
    width: 56px;
    height: 56px;
  }

  .adb-toggle-icon {
    font-size: 24px;
  }

  .adb-panel {
    right: 12px;
    left: 12px;
    bottom: 82px;
    width: auto;
    max-width: none;
    height: 72vh;
    max-height: 72vh;
    border-radius: 18px;
  }

  .adb-header {
    padding: 14px 14px 12px;
  }

  .adb-title {
    font-size: 16px;
  }

  .adb-badge {
    font-size: 11px;
  }

  .chatbot-menu {
    padding: 10px 12px 8px;
    gap: 6px;
  }

  .chatbot-menu-btn {
    font-size: 12px;
    min-height: 34px;
    padding: 7px 10px;
  }

  .adb-body {
    padding: 12px;
  }

  .adb-msg {
    gap: 8px;
    margin-bottom: 12px;
  }

  .adb-msg-avatar {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 15px;
  }

  .adb-msg-content {
    max-width: calc(100% - 38px);
  }

  .adb-msg-bubble {
    padding: 11px 12px;
    font-size: 14px;
  }

  .adb-msg-time {
    font-size: 10px;
  }

  .adb-msg-bot .adb-cta-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .adb-msg-bot .adb-cta-btn {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 10px;
    font-size: 13px;
  }

  .adb-footer-note {
    padding: 10px 12px 6px;
    font-size: 11px;
  }

  .adb-form {
    padding: 10px 12px;
  }

  .adb-input {
    height: 42px;
    border-radius: 11px;
    font-size: 16px;
  }

  .adb-send {
    min-width: 68px;
    height: 42px;
    border-radius: 11px;
    font-size: 14px;
    padding: 0 14px;
  }

  .adb-policy {
    padding: 0 12px 12px;
    font-size: 11px;
  }
}

/* =========================
   SMALL MOBILE
========================= */
@media (max-width: 400px) {
  .adb-panel {
    height: 74vh;
    max-height: 74vh;
  }

  .adb-msg-bot .adb-cta-wrap {
    grid-template-columns: 1fr;
  }

  .adb-msg-bot .adb-cta-btn {
    width: 100%;
  }
}

/* 퀵메뉴 높이만큼 챗봇 위로 올림 */
.adb-wrap {
  position: fixed;
  right: 20px;
  bottom: 120px !important; /* ← 여기 핵심 */
  z-index: 999999;
}
@media (max-width: 768px) {
  .adb-wrap {
    right: 12px;
    bottom: 110px !important;
  }
}
/* 퀵메뉴 */
.gip-quick-wrap {
  position: fixed;
  right: 12px;
  bottom: 20px;
  z-index: 1000;
}

/* 챗봇 전체를 퀵메뉴 왼쪽으로 이동 */
.adb-wrap {
  position: fixed;
  right: 120px;   /* 퀵메뉴 폭만큼 왼쪽 */
  bottom: 60px;
  z-index: 1100;
}

/* 챗봇 패널은 버튼 바로 위 */
.adb-panel {
  right: 0;
  bottom: 72px;
}

/* 말풍선도 퀵메뉴와 안 겹치게 왼쪽으로 */
.adb-float-msg {
  right: 20;
  bottom: 70px;
  max-width: 220px;
}

/* 모바일 */
@media (max-width: 768px) {
  .gip-quick-wrap {
    right: 15px;
    bottom: 16px;
  }

  .adb-wrap {
    right: 110px;
    bottom: 16px;
  }

  .adb-panel {
    right: -8px;
    bottom: 68px;
  }

  .adb-float-msg {
    right: -4px;
    bottom: 68px;
    max-width: 200px;
  }
}
/* 챗봇 전체 */
.adb-wrap {
  z-index: 999999 !important;
}

/* 챗봇 패널 */
.adb-panel {
  z-index: 999999 !important;
}

/* 입력창 (가장 중요) */
.adb-form {
  position: relative;
  z-index: 999999 !important;
}

/* 전송 버튼 클릭 막힘 방지 */
.adb-send {
  position: relative;
  z-index: 999999 !important;
}