/* [2026-11-24] 청춘IP 도우미(챗봇) — chat/chat.css 디자인을 이어받음 (머리글 + 회색 대화창 + 말풍선 + 둥근 선택 버튼 + 아래 탭)
   예전·새 디자인 페이지 어디서나 같게 보이도록 필요한 값은 이 파일 안에 둠 */
.ycb { --ycb-blue: #1fb2fb; --ycb-blue-ink: #0b7fc0; --ycb-ink: #14171c; --ycb-ink-2: #3d434d; --ycb-ink-3: #6b7280; --ycb-line: #e5e7eb; --ycb-bg: #f4f5f7; --ycb-yellow: #ffd80a; --ycb-red: #e03131;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; color: var(--ycb-ink); line-height: 1.5; letter-spacing: -0.01em; }
.ycb *, .ycb *::before, .ycb *::after { box-sizing: border-box; }
.ycb__sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 떠 있는 모드 ---------- */
.ycb:not(.ycb--inline) { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: var(--ycb-bottom, 24px); z-index: 9990; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; transition: bottom .25s ease; }
.ycb__launcher { position: relative; width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: var(--ycb-blue); box-shadow: 0 8px 24px -6px rgba(0, 0, 0, .35); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.ycb__launcher img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ycb__launcher:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -6px rgba(0, 0, 0, .45); }
.ycb__launcher:focus-visible { outline: 3px solid var(--ycb-ink); outline-offset: 3px; }
.ycb__launcher-tip { position: absolute; right: 68px; top: 50%; transform: translateY(-50%); padding: 7px 12px; border-radius: 999px; background: var(--ycb-ink); color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .5); pointer-events: none; animation: ycb-tip 6s ease 1.2s both; }
.ycb__launcher-tip::after { content: ""; position: absolute; right: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; background: var(--ycb-ink); transform: rotate(45deg); }
@keyframes ycb-tip { 0% { opacity: 0; transform: translate(6px, -50%); } 8%, 88% { opacity: 1; transform: translate(0, -50%); } 100% { opacity: 0; transform: translate(0, -50%); } }
.ycb.is-open .ycb__launcher { display: none; }
.ycb:not(.ycb--inline) .ycb__win { width: 380px; height: min(620px, calc(100vh - var(--ycb-bottom, 24px) - 40px)); border-radius: 26px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .08); }
.ycb__win[hidden] { display: none !important; }
.ycb.is-open .ycb__win { animation: ycb-in .28s cubic-bezier(.16, 1, .3, 1); }
@keyframes ycb-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 대화창 ---------- */
.ycb__win { display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.ycb__head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--ycb-line); background: #fff; }
.ycb__face { flex: none; width: 44px; height: 44px; border-radius: 50%; }
.ycb__who { flex: 1; min-width: 0; }
.ycb__who strong { display: block; font-size: 17px; font-weight: 800; }
.ycb__who span { display: block; font-size: 12.5px; color: var(--ycb-ink-3); }
.ycb__x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ycb-bg); font-size: 22px; line-height: 1; color: var(--ycb-ink-2); cursor: pointer; }
.ycb__x:hover { background: #e9ebef; }
.ycb__log { position: relative; /* 답변 시작 위치 계산 기준 */ flex: 1; min-height: 0; overflow-y: auto; padding: 16px 14px 10px; background: var(--ycb-bg); scroll-behavior: smooth; }

/* 말풍선 */
.ycb__msg { display: flex; gap: 8px; margin-bottom: 12px; }
.ycb__msg--bot .ycb__bubble { max-width: 88%; padding: 12px 14px; border-radius: 4px 18px 18px 18px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); font-size: 14px; }
.ycb__msg--user { justify-content: flex-end; }
.ycb__msg--user .ycb__bubble { max-width: 80%; padding: 10px 14px; border-radius: 18px 4px 18px 18px; background: var(--ycb-blue); color: #fff; font-size: 14px; font-weight: 600; word-break: break-word; }
.ycb__bubble b { font-weight: 800; }
.ycb__typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.ycb__typing i { width: 6px; height: 6px; border-radius: 50%; background: #b3b9c2; animation: ycb-dot 1s infinite ease-in-out; }
.ycb__typing i:nth-child(2) { animation-delay: .15s; } .ycb__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ycb-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* 둥근 선택 버튼 (chat.php 의 질문 버튼 모양) */
.ycb__chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin: -2px 0 14px; }
.ycb__chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 14px; border: 1px solid #dfe3e8; border-radius: 999px; background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ycb-ink); text-decoration: none !important; cursor: pointer; transition: border-color .15s, background-color .15s; }
.ycb__chip:hover { border-color: var(--ycb-blue); background: #f0faff; }
.ycb__chip--main { border-color: var(--ycb-ink); background: var(--ycb-ink); color: #fff !important; }
.ycb__chip--main:hover { background: #2a2f37; border-color: #2a2f37; }

/* 답변 카드 */
.ycb__cards { display: grid; gap: 8px; margin: 8px 0 2px; }
.ycb__card { border: 1px solid var(--ycb-line); border-radius: 14px; background: #fff; overflow: hidden; }
.ycb__card-btn { display: block; width: 100%; padding: 11px 12px; border: 0; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.ycb__card-btn:hover { background: #f7fbff; }
.ycb__cat { display: inline-block; margin-bottom: 3px; padding: 1px 7px; border-radius: 6px; background: #e6f5fe; font-size: 11px; font-weight: 700; color: var(--ycb-blue-ink); }
.ycb__card-title { display: block; font-size: 14px; font-weight: 800; line-height: 1.4; }
.ycb__card-snip { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ycb-ink-3); }
.ycb__card.is-open .ycb__card-snip { display: none; }
.ycb__card-body { display: none; padding: 0 12px 12px; font-size: 13px; color: var(--ycb-ink-2); white-space: pre-line; }
.ycb__card.is-open .ycb__card-body { display: block; }
.ycb__card-more { display: inline-flex; align-items: center; margin-top: 10px; font-size: 14.5px; font-weight: 800; color: var(--ycb-red) !important; text-decoration: none !important; }
.ycb__hint { display: inline-block; margin-top: 4px; font-size: 13.5px; font-weight: 700; color: var(--ycb-red); }
.ycb__card-more:hover { text-decoration: underline !important; }

/* 입력칸 */
.ycb__form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--ycb-line); background: #fff; }
.ycb__form input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1.5px solid #dfe3e8; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; color: var(--ycb-ink); outline: none; }
.ycb__form input:focus { border-color: var(--ycb-blue); }
.ycb__send { flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--ycb-blue); cursor: pointer; }
.ycb__send svg { width: 20px; height: 20px; fill: #fff; }
.ycb__send:hover { background: var(--ycb-blue-ink); }

/* 아래 탭 (chat.php 의 FAQ / 1:1문의 / 원격지원 줄) */
.ycb__tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ycb-line); background: #fff; }
.ycb__tabs > * { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 10px; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ycb-ink-3) !important; text-decoration: none !important; cursor: pointer; }
.ycb__tabs > * span { font-size: 17px; line-height: 1; }
.ycb__tabs > *:hover { color: var(--ycb-blue-ink) !important; }
/* 당직 시간에 전화 탭이 '당직자 상담연결'로 바뀌어도 칸 안에 맞게 */
.ycb__tabs > a.yn-duty-call { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 2px !important; font-size: 11px; text-align: center; }

/* ---------- 1:1 문의 글쓰기 위 펼친 모드 ---------- */
.ycb--inline { margin: 0 0 18px; }
.ycb--inline .ycb__win { border: 1px solid var(--ycb-line); border-radius: 22px; }
.ycb--inline .ycb__log { max-height: 420px; min-height: 120px; }
.ycb--inline .ycb__head { padding: 14px 16px 12px; }

/* ---------- 휴대폰 ---------- */
@media (max-width: 560px) {
  .ycb:not(.ycb--inline) { right: 12px; }
  .ycb:not(.ycb--inline).is-open { left: 8px; right: 8px; }
  .ycb:not(.ycb--inline) .ycb__win { width: 100%; height: calc(100dvh - var(--ycb-bottom, 24px) - 24px); border-radius: 22px; }
  .ycb__launcher { width: 52px; height: 52px; }
  .ycb__launcher-tip { right: 60px; }
  .ycb__form input { font-size: 16px; } /* 아이폰 확대 방지 */
}
@media (prefers-reduced-motion: reduce) {
  .ycb.is-open .ycb__win { animation: none; }
  .ycb__launcher-tip { animation: none; opacity: 0; }
}
@media print { .ycb:not(.ycb--inline) { display: none; } }
