@charset "utf-8";
/* ==========================================================================
   대성테크놀로지 — 상담 챗봇 위젯 (토큰은 common.css)
   ========================================================================== */

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 105; }   /* 헤더(100) 위, 모바일 메뉴(110·120) 아래 */
.totop { bottom: 86px; }                        /* 챗봇 버튼 위로 올린다 */

/* ---------- 여는 버튼 ---------- */
.chat-launch {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 20px 0 16px; border-radius: 26px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow-lg); transition: background .2s var(--ease);
}
.chat-launch:hover { background: var(--primary-dark); }
.chat-launch svg { width: 22px; height: 22px; flex: none; }
.chat.open .chat-launch { display: none; }

/* ---------- 창 ---------- */
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 106;
  display: flex; flex-direction: column; overflow: hidden;
  width: 380px; max-width: calc(100vw - 40px);
  height: 600px; max-height: calc(100vh - 40px);
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.chat-panel[hidden] { display: none; }

.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 12px 14px 18px; background: var(--primary); color: #fff;
}
.chat-title { font-size: 16px; line-height: 22px; font-weight: 700; }
.chat-sub { font-size: 12px; line-height: 18px; opacity: .8; }
.chat-close { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; }
.chat-close:hover { background: rgba(255, 255, 255, .14); }
.chat-close span[aria-hidden]::before, .chat-close span[aria-hidden]::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 2px; margin: -1px 0 0 -8px; background: #fff; border-radius: 2px;
}
.chat-close span[aria-hidden]::before { transform: rotate(45deg); }
.chat-close span[aria-hidden]::after  { transform: rotate(-45deg); }

/* ---------- 대화 ---------- */
.chat-log {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: 16px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface);
}
.chat-msg { display: flex; }
.chat-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 22px; white-space: pre-line;
}
.chat-bot .chat-bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.chat-user .chat-bubble { background: var(--primary); color: #fff; border-top-right-radius: 4px; }

.chat-card {
  max-width: 92%; padding: 12px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
}
.chat-card-t { font-size: 14px; line-height: 20px; font-weight: 700; }
.chat-card-p { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--gray); }
.chat-card-a { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--primary); }
.chat-card-a:hover { text-decoration: underline; }

.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chip {
  display: inline-flex; align-items: center; min-height: 34px; padding: 5px 13px; border-radius: 17px;
  background: #fff; border: 1px solid var(--primary); color: var(--primary);
  font-size: 13px; line-height: 18px; font-weight: 600; text-align: left;
  transition: background .15s var(--ease);
}
.chat-chip:hover { background: var(--primary-soft); }

/* ---------- 입력 ---------- */
.chat-form { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--line); }
.chat-inp {
  flex: 1; min-width: 0; height: 42px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 21px; font-size: 14px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.chat-inp:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11, 95, 165, .12); }
.chat-inp::placeholder { color: var(--gray-2); }
.chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; }
.chat-send:hover { background: var(--primary-dark); }
.chat-send svg { width: 18px; height: 18px; }

/* ---------- 모바일: 버튼은 아이콘만, 창은 전체 화면 ---------- */
@media (max-width: 480px) {
  .chat-launch { width: 52px; padding: 0; justify-content: center; }
  .chat-launch-txt {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .chat-panel {
    right: 0; bottom: 0; width: 100%; max-width: none;
    height: 100vh; height: 100dvh; max-height: none; border: 0; border-radius: 0;
  }
}
