/*
 * KBN AI 챗봇(케비) 위젯 스타일
 * 모든 선택자를 #kbn-chatbot 하위로 스코프하여 포털 전역 스타일 누수를 차단한다.
 */
#kbn-chatbot, #kbn-chatbot * { box-sizing: border-box; }
#kbn-chatbot {
    --kbn-primary: #102F6E;
    --kbn-primary2: #008FC5;
    --kbn-accent: #00B3C4;
    /* 시선 유도 물결 색 — KBN 로고 주황(#FF6E2E). rgba() 에 쓰려고 RGB 값으로 둔다 */
    --kbn-ping-rgb: 255, 110, 46;
    /* 케비(FAB) 크기 — 뷰포트 폭 1280px 이하에서 150px(최소), 1920px 이상에서 300px(최소의 2배).
       그 사이는 폭에 비례해 커진다.  150 + 150 * (vw - 1280) / 640  →  23.44vw - 150px */
    --kbn-fab-size: clamp(150px, calc(23.44vw - 150px), 300px);
    position: fixed; right: 24px; bottom: 24px; z-index: 2147483000;
    font-family: "Pretendard", -apple-system, "Malgun Gothic", sans-serif;
}

/* 플로팅 버튼 — 화면 우측 하단 고정(패널 드래그/창 크기 변경과 무관) */
#kbn-chatbot .kbn-fab {
    position: fixed; right: 24px; bottom: 24px;
    width: var(--kbn-fab-size); height: var(--kbn-fab-size);
    border-radius: 50%; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--kbn-primary) 0%, var(--kbn-primary2) 100%);
    color: #fff; font-size: clamp(44px, calc(6.875vw - 44px), 88px); line-height: 1;
    /* 밝은 배경에서도 케비가 또렷하게 보이도록 흰 링 + 진한 그림자 */
    box-shadow: 0 0 0 5px #fff, 0 10px 30px rgba(16,47,110,0.40);
    display: flex; align-items: center; justify-content: center;
    transition: transform .24s cubic-bezier(.22,1,.36,1), opacity .18s ease, box-shadow .2s ease;
    will-change: transform, opacity;
}
#kbn-chatbot .kbn-fab:not(.kbn-fab-hide):hover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 5px #fff, 0 14px 34px rgba(16,47,110,0.50);
}
/* 패널 열림 중에는 FAB 를 숨긴다(레이아웃은 유지해 패널 위치가 흔들리지 않도록 transform 으로 처리) */
#kbn-chatbot .kbn-fab.kbn-fab-hide {
    transform: scale(.2); opacity: 0; pointer-events: none;
}
#kbn-chatbot .kbn-fab { padding: 0; overflow: hidden; }
#kbn-chatbot .kbn-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
/* 진입 시선 유도(케비 흔들림) */
#kbn-chatbot .kbn-fab.kbn-wave { animation: kbn-wave 1.4s ease-in-out 2; }
@keyframes kbn-wave {
    0%,100% { transform: rotate(0deg); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(6deg); }
}

/* ── 시선 유도 : 물결(ping) ── */
/* box-shadow 로 그리므로 .kbn-fab 의 overflow:hidden 에 잘리지 않는다 */
#kbn-chatbot .kbn-fab.kbn-ping { animation: kbn-ping 1.8s ease-out 2; }
@keyframes kbn-ping {
    0%   { box-shadow: 0 0 0 0    rgba(var(--kbn-ping-rgb), .60), 0 0 0 5px #fff, 0 10px 30px rgba(16,47,110,.40); }
    70%  { box-shadow: 0 0 0 30px rgba(var(--kbn-ping-rgb), 0),   0 0 0 5px #fff, 0 10px 30px rgba(16,47,110,.40); }
    100% { box-shadow: 0 0 0 0    rgba(var(--kbn-ping-rgb), 0),   0 0 0 5px #fff, 0 10px 30px rgba(16,47,110,.40); }
}

/* ── 시선 유도 : 말풍선 ── */
#kbn-chatbot .kbn-tip {
    position: fixed; z-index: 2147483000;
    right: calc(24px + var(--kbn-fab-size) + 14px);
    bottom: calc(24px + var(--kbn-fab-size) / 2 - 24px);
    max-width: 280px; padding: 14px 42px 14px 18px;
    background: #fff; color: var(--kbn-primary);
    border: 1px solid #dbe3f0; border-radius: 14px;
    box-shadow: 0 8px 24px rgba(16,47,110,.18);
    font-size: 18px; font-weight: 700; line-height: 1.45;
    cursor: pointer; white-space: normal; word-break: keep-all;
    opacity: 0; transform: translateX(8px); pointer-events: none;
    transition: opacity .28s ease, transform .28s cubic-bezier(.22,1,.36,1);
}
#kbn-chatbot .kbn-tip.kbn-tip-on { opacity: 1; transform: translateX(0); pointer-events: auto; }
/* 꼬리 */
#kbn-chatbot .kbn-tip::after {
    content: ""; position: absolute; right: -7px; top: 50%; margin-top: -7px;
    width: 13px; height: 13px; background: #fff;
    border-right: 1px solid #dbe3f0; border-top: 1px solid #dbe3f0;
    transform: rotate(45deg);
}
#kbn-chatbot .kbn-tip .kbn-tip-x {
    position: absolute; right: 6px; top: 50%; margin-top: -13px;
    width: 26px; height: 26px; padding: 0; line-height: 1;
    background: none; border: none; cursor: pointer;
    color: #94a3b8; font-size: 20px;
    display: flex; align-items: center; justify-content: center;
}
#kbn-chatbot .kbn-tip .kbn-tip-x:hover { color: var(--kbn-primary); }

/* 모션 최소화 설정 사용자는 흔들림·물결 없이 말풍선만 */
@media (prefers-reduced-motion: reduce) {
    #kbn-chatbot .kbn-fab.kbn-wave,
    #kbn-chatbot .kbn-fab.kbn-ping { animation: none; }
    #kbn-chatbot .kbn-tip { transition: none; }
}

/* 채팅 패널 */
#kbn-chatbot .kbn-panel {
    position: absolute; right: 0; bottom: 0; width: 500px; max-width: calc(100vw - 48px);
    height: 700px; max-height: calc(100vh - 36px);
    min-width: 320px; min-height: 420px;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(16,47,110,0.28);
    display: none; flex-direction: column; border: 1px solid #e2e8f0;
    /* 지니 애니메이션 기준점 = FAB 중심(패널 우하단에서 FAB 반지름만큼 안쪽).
       패널을 드래그해 옮긴 경우에는 widget.js 가 실제 FAB 중심으로 다시 계산한다. */
    transform-origin: calc(100% - var(--kbn-fab-size) / 2) calc(100% - var(--kbn-fab-size) / 2);
}
#kbn-chatbot .kbn-panel.kbn-open { display: flex; }

/* ── 지니 애니메이션 — FAB 자리에서 펼쳐지고, 닫을 때 다시 빨려 들어간다 ── */
#kbn-chatbot .kbn-panel.kbn-genie-in  { animation: kbn-genie-in .40s cubic-bezier(.16,.84,.30,1) both; }
#kbn-chatbot .kbn-panel.kbn-genie-out { animation: kbn-genie-out .26s cubic-bezier(.40,0,.75,.35) both; }
/* border-radius·box-shadow 를 키프레임에서 바꾸면 매 프레임 리페인트가 일어나 끊긴다.
   transform/opacity 만 움직여 합성(compositing)만으로 처리되게 한다. */
#kbn-chatbot .kbn-panel.kbn-genie-in,
#kbn-chatbot .kbn-panel.kbn-genie-out {
    will-change: transform, opacity; backface-visibility: hidden;
}
/* 시작 크기 = 실제 FAB 크기 / 실제 패널 크기.
   FAB 가 반응형이고 패널은 사용자가 크기를 조절할 수 있어, widget.js 가 열고 닫을 때마다
   --kbn-gsx / --kbn-gsy 를 다시 계산해 넣는다. (fallback 은 150x150 FAB, 500x700 패널 기준) */
@keyframes kbn-genie-in {
    0%   { opacity: 0; transform: scale(var(--kbn-gsx, .30), var(--kbn-gsy, .21)); }
    18%  { opacity: 1; transform: scale(calc(var(--kbn-gsx, .30) * 1.4), calc(var(--kbn-gsy, .21) * 1.29)); }
    100% { opacity: 1; transform: scale(1, 1); }
}
@keyframes kbn-genie-out {
    0%   { opacity: 1; transform: scale(1, 1); }
    72%  { opacity: 1; transform: scale(calc(var(--kbn-gsx, .30) * 1.53), calc(var(--kbn-gsy, .21) * 1.38)); }
    100% { opacity: 0; transform: scale(var(--kbn-gsx, .30), var(--kbn-gsy, .21)); }
}
/* 모션 최소화 설정 사용자는 애니메이션 없이 즉시 표시/숨김 */
@media (prefers-reduced-motion: reduce) {
    #kbn-chatbot .kbn-panel.kbn-genie-in,
    #kbn-chatbot .kbn-panel.kbn-genie-out { animation: none; }
    #kbn-chatbot .kbn-fab { transition: none; }
}

/* ── 크기 조절 핸들 ──
   패널이 우하단(FAB 기준)에 고정이라 좌측·상단·좌상단 모서리를 잡아 늘린다. */
#kbn-chatbot .kbn-rz { position: absolute; z-index: 6; }
/* 패널이 overflow:hidden 이므로 핸들은 패널 안쪽에 둔다(바깥에 두면 잘려서 잡히지 않음) */
#kbn-chatbot .kbn-rz-l  { left: 0; top: 18px; bottom: 18px; width: 8px; cursor: ew-resize; }
#kbn-chatbot .kbn-rz-t  { top: 0; left: 18px; right: 18px; height: 8px; cursor: ns-resize; }
#kbn-chatbot .kbn-rz-tl { left: 0; top: 0; width: 20px; height: 20px; cursor: nwse-resize; }
#kbn-chatbot .kbn-rz-tl::after {
    content: ""; position: absolute; left: 6px; top: 6px; width: 8px; height: 8px;
    border-left: 2px solid rgba(255,255,255,.6); border-top: 2px solid rgba(255,255,255,.6);
    border-radius: 4px 0 0 0; opacity: 0; transition: opacity .15s;
}
#kbn-chatbot .kbn-panel:hover .kbn-rz-tl::after { opacity: 1; }
/* 크기 조절 중에는 텍스트 선택·애니메이션을 끈다 */
#kbn-chatbot.kbn-resizing, #kbn-chatbot.kbn-resizing * { user-select: none !important; }
#kbn-chatbot.kbn-resizing .kbn-panel { transition: none; }

/* ── 폭이 좁아지면(사용자가 줄였을 때) 내부 여백·폭 비율을 조정 ── */
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-hint { display: none; }
/* 안내문구가 숨으면 닫기 버튼을 밀어주던 여백이 사라지므로 직접 오른쪽 끝으로 */
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-close { margin-left: auto; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-header { padding: 12px 12px; gap: 8px; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-htitle { font-size: 19px; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-body { padding: 12px 10px; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-col { max-width: 92%; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-msg.kbn-bot .kbn-col .kbn-bubble { max-width: 94%; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-col-wide { max-width: 100%; }
#kbn-chatbot .kbn-panel.kbn-narrow .kbn-steps-labels { font-size: 11.5px; }

/* 헤더 */
#kbn-chatbot .kbn-header {
    background: linear-gradient(135deg, var(--kbn-primary) 0%, var(--kbn-primary2) 100%);
    color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px;
    cursor: move; user-select: none;
}
#kbn-chatbot .kbn-header .kbn-ava {
    width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
#kbn-chatbot .kbn-header .kbn-ava img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
#kbn-chatbot .kbn-htitle { font-size: 22px; font-weight: 700; line-height: 1.2; }
#kbn-chatbot .kbn-hsub { font-size: 13px; opacity: .8; }
#kbn-chatbot .kbn-hint { font-size: 17px; opacity: .7; margin-left: auto; margin-right: 6px; white-space: nowrap; }
#kbn-chatbot .kbn-close {
    background: none; border: none; color: #fff; font-size: 30px; cursor: pointer;
    width: 34px; height: 34px; border-radius: 6px; flex-shrink: 0;
    /* × 글리프가 아래로 치우치지 않도록 flex 로 상하좌우 중앙 정렬 */
    display: flex; align-items: center; justify-content: center;
    padding: 0; line-height: 1;
}
#kbn-chatbot .kbn-close:hover { background: rgba(255,255,255,.15); }

/* 대화 영역 */
/* position: relative — 새 메시지 위치 계산(offsetTop)의 기준을 이 영역으로 고정 */
#kbn-chatbot .kbn-body { flex: 1; overflow-y: auto; padding: 16px 14px; background: #fff; position: relative; }

/* 메시지 등장 애니메이션 — 말풍선이 먼저, 본문 블록이 차례로 부드럽게 나타난다 */
#kbn-chatbot .kbn-msg.kbn-anim {
    animation: kbn-msg-in .30s cubic-bezier(.22,.68,.32,1) both;
}
#kbn-chatbot .kbn-msg.kbn-anim .kbn-bubble > *,
#kbn-chatbot .kbn-msg.kbn-anim .kbn-qr {
    animation: kbn-part-in .34s cubic-bezier(.22,.68,.32,1) both;
}
@keyframes kbn-msg-in {
    from { opacity: 0; transform: translateY(9px) scale(.985); }
    to   { opacity: 1; transform: none; }
}
@keyframes kbn-part-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}
/* 모션 최소화 설정 사용자는 애니메이션 없이 즉시 표시 */
@media (prefers-reduced-motion: reduce) {
    #kbn-chatbot .kbn-msg.kbn-anim,
    #kbn-chatbot .kbn-msg.kbn-anim .kbn-bubble > *,
    #kbn-chatbot .kbn-msg.kbn-anim .kbn-qr { animation: none; }
}

/* 메시지 행 */
#kbn-chatbot .kbn-msg { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 14px; }
#kbn-chatbot .kbn-msg.kbn-user { justify-content: flex-end; }
#kbn-chatbot .kbn-bavatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    background: var(--kbn-primary); display: flex; align-items: center; justify-content: center;
    font-size: 19px;
}
#kbn-chatbot .kbn-bavatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

#kbn-chatbot .kbn-col { display: flex; flex-direction: column; gap: 8px; max-width: 80%; }
#kbn-chatbot .kbn-msg.kbn-user .kbn-col { align-items: flex-end; }

/* 봇 메시지 열은 가로를 가득 쓰고(키워드 버튼이 말풍선 폭에 갇혀 줄바꿈되지 않도록),
   폭 제한은 말풍선에만 건다. 말풍선은 내용만큼만 커진다(align-items: flex-start). */
#kbn-chatbot .kbn-msg.kbn-bot .kbn-col {
    max-width: 100%; flex: 1 1 auto; min-width: 0; align-items: flex-start;
}
#kbn-chatbot .kbn-msg.kbn-bot .kbn-col .kbn-bubble { max-width: 86%; }
#kbn-chatbot .kbn-msg.kbn-bot .kbn-col.kbn-col-wide .kbn-bubble { max-width: 100%; }

#kbn-chatbot .kbn-bubble {
    padding: 11px 14px; border-radius: 16px; font-size: 17px; line-height: 1.65;
    white-space: normal; word-break: keep-all; overflow-wrap: break-word;
}
#kbn-chatbot .kbn-bot .kbn-bubble { background: #eef1f8; color: #1e293b; border-top-left-radius: 4px; }
#kbn-chatbot .kbn-user .kbn-bubble { background: var(--kbn-primary); color: #fff; border-top-right-radius: 4px; }
#kbn-chatbot .kbn-bubble a { color: var(--kbn-primary2); text-decoration: underline; }
#kbn-chatbot .kbn-user .kbn-bubble a { color: #cfe8ff; }
#kbn-chatbot .kbn-bubble p { margin: 0 0 9px; }
#kbn-chatbot .kbn-bubble p:last-child { margin-bottom: 0; }
#kbn-chatbot .kbn-bubble ul, #kbn-chatbot .kbn-bubble ol { margin: 6px 0; padding-left: 16px; }
#kbn-chatbot .kbn-bubble li { margin: 3px 0; padding-left: 2px; line-height: 1.55; }
#kbn-chatbot .kbn-bubble li::marker { color: var(--kbn-primary2); }
/* 응답 대기 표시(점 3개 애니메이션) */
/* 답변 본문 서식(구획 제목 / 번호 목록 / 글머리 목록) */
#kbn-chatbot .kbn-bubble .kbn-h {
    display: flex; align-items: center; gap: 7px;
    font-size: 16.5px; font-weight: 800; color: #0f2350;
    margin: 15px 0 8px;
}
#kbn-chatbot .kbn-bubble .kbn-h:first-child { margin-top: 2px; }
#kbn-chatbot .kbn-bubble .kbn-h::before {
    content: ""; width: 3px; height: 14px; border-radius: 2px;
    background: var(--kbn-accent); flex-shrink: 0;
}
#kbn-chatbot .kbn-bubble strong { color: var(--kbn-primary); font-weight: 700; }

/* 단독 링크는 버튼 형태로 강조(로그인 하러가기 등) */
#kbn-chatbot .kbn-bubble a.kbn-linkbtn,
#kbn-chatbot .kbn-bubble a.kbn-linkbtn:hover {
    display: inline-flex; align-items: center; gap: 4px;
    margin: 10px 0 2px; padding: 9px 16px;
    background: var(--kbn-primary); color: #fff;
    border-radius: 22px; text-decoration: none;
    font-size: 16px; font-weight: 700; line-height: 1.2;
    transition: background .15s, box-shadow .15s;
}
#kbn-chatbot .kbn-bubble a.kbn-linkbtn:hover {
    background: var(--kbn-primary2); box-shadow: 0 3px 10px rgba(16,47,110,.22);
}
#kbn-chatbot .kbn-bubble a.kbn-linkbtn svg { width: 15px; height: 15px; display: block; }

/* 번호 목록 — 절차·단계를 원형 배지로 */
#kbn-chatbot .kbn-bubble ol.kbn-ol {
    list-style: none; margin: 9px 0; padding: 0;
}
#kbn-chatbot .kbn-bubble ol.kbn-ol li {
    position: relative;
    padding-left: 29px; margin: 8px 0; line-height: 1.6;
}
#kbn-chatbot .kbn-bubble ol.kbn-ol li::before {
    content: attr(data-num);
    position: absolute; left: 0; top: 2px;
    width: 21px; height: 21px; border-radius: 50%;
    background: var(--kbn-primary); color: #fff;
    font-size: 14px; font-weight: 700; line-height: 21px; text-align: center;
}

/* 글머리 목록 */
#kbn-chatbot .kbn-bubble ul.kbn-ul { margin: 9px 0; padding-left: 8px; list-style: none; }
#kbn-chatbot .kbn-bubble ul.kbn-ul li {
    position: relative; padding-left: 15px; margin: 6px 0; line-height: 1.6;
}
#kbn-chatbot .kbn-bubble ul.kbn-ul li::before {
    content: ""; position: absolute; left: 0; top: 9px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--kbn-accent);
}

/* 하위 항목(들여쓴 목록) — 상위 항목에 딸린 서류명 등 */
#kbn-chatbot .kbn-bubble ul.kbn-ul li.kbn-li-sub,
#kbn-chatbot .kbn-bubble ol.kbn-ol li.kbn-li-sub {
    margin: 3px 0 3px 17px; padding-left: 14px;
    font-size: 16px; color: #475569; line-height: 1.55;
}
#kbn-chatbot .kbn-bubble ul.kbn-ul li.kbn-li-sub::before,
#kbn-chatbot .kbn-bubble ol.kbn-ol li.kbn-li-sub::before {
    content: ""; position: absolute; left: 0; top: 10px;
    width: 5px; height: 1.5px; border-radius: 1px; background: #b6c2d4;
}
/* 항목에서 이어지는 줄 — 항목 본문과 같은 들여쓰기를 유지한다 */
#kbn-chatbot .kbn-bubble li .kbn-li-cont { margin-top: 3px; }

/* 하위 항목 묶음이 끝나고 다음 상위 항목이 오면 간격을 벌려 그룹을 구분 */
#kbn-chatbot .kbn-bubble li.kbn-li-sub + li:not(.kbn-li-sub) { margin-top: 12px; }

#kbn-chatbot .kbn-typing { padding: 14px 16px; }
#kbn-chatbot .kbn-dots { display: inline-flex; align-items: center; gap: 5px; height: 8px; }
#kbn-chatbot .kbn-dots i {
    display: block; width: 7px; height: 7px; border-radius: 50%; background: #94a3b8;
    animation: kbn-dot-bounce 1.4s infinite ease-in-out both;
}
#kbn-chatbot .kbn-dots i:nth-child(2) { animation-delay: .16s; }
#kbn-chatbot .kbn-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes kbn-dot-bounce {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40%           { opacity: 1;  transform: translateY(-4px); }
}
/* 모션 최소화 설정 사용자는 위아래 움직임 없이 깜빡임만 */
@media (prefers-reduced-motion: reduce) {
    #kbn-chatbot .kbn-dots i { animation-name: kbn-dot-fade; }
    @keyframes kbn-dot-fade {
        0%, 80%, 100% { opacity: .3; }
        40%           { opacity: 1; }
    }
}

/* 퀵리플라이(응답 하단 클릭형 선택 버튼) */
/* 키워드 버튼 — 항상 한 줄로 유지하고, 넘치면 가로 스크롤(스크롤바는 숨김) */
#kbn-chatbot .kbn-qr {
    display: flex; flex-wrap: nowrap; gap: 7px;
    overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none; -ms-overflow-style: none;
}
#kbn-chatbot .kbn-qr::-webkit-scrollbar { display: none; }
#kbn-chatbot .kbn-qr .kbn-chip {
    flex: 0 0 auto; white-space: nowrap;
    /* 민트(--kbn-accent) 계열을 유지하되 채도를 낮춰 옅게 */
    background: #f1fbfc; border: 1px solid #bfe7ec; color: #0b7b86;
    border-radius: 20px; padding: 7px 14px; font-size: 15.5px; font-weight: 600;
    cursor: pointer; transition: background .15s, border-color .15s, color .15s; line-height: 1.3;
}
#kbn-chatbot .kbn-qr .kbn-chip:hover {
    background: #e0f6f8; border-color: #8fd6de; color: #06646d;
}

/* 신청현황 카드(16p) */
#kbn-chatbot .kbn-col-wide { max-width: 92%; }
#kbn-chatbot .kbn-cards { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
#kbn-chatbot .kbn-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 13px 15px; }
#kbn-chatbot .kbn-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
#kbn-chatbot .kbn-card-seq { font-weight: 800; color: #94a3b8; font-size: 16px; }
#kbn-chatbot .kbn-card-no { font-weight: 800; color: #0f2350; font-size: 18px; flex: 1; }
#kbn-chatbot .kbn-card-badge { font-size: 14.5px; font-weight: 700; border-radius: 12px; padding: 4px 11px; border: 1.5px solid; white-space: nowrap; }

/* ── 진행 단계별 색상 ────────────────────────────────
   카드에 kbn-st0 ~ kbn-st5 클래스가 붙고, 배지·현재 단계 라벨·진행 막대가
   --kbn-step-color 하나를 공유한다. 색을 바꾸려면 아래 값만 수정하면 된다. */
#kbn-chatbot .kbn-card.kbn-st0 { --kbn-step-color: #94a3b8; } /* 작성중   — 회색 */
#kbn-chatbot .kbn-card.kbn-st1 { --kbn-step-color: #f59e0b; } /* 신청완료 — 앰버 */
#kbn-chatbot .kbn-card.kbn-st2 { --kbn-step-color: #00B3C4; } /* 접수     — 민트 */
#kbn-chatbot .kbn-card.kbn-st3 { --kbn-step-color: #008FC5; } /* 심의     — 블루 */
#kbn-chatbot .kbn-card.kbn-st4 { --kbn-step-color: #12a06f; } /* 분양완료 — 그린 */
#kbn-chatbot .kbn-card.kbn-st5 { --kbn-step-color: #102F6E; } /* 종료     — 네이비 */

#kbn-chatbot .kbn-card .kbn-card-badge {
    color: var(--kbn-step-color); border-color: var(--kbn-step-color);
}
#kbn-chatbot .kbn-card-title { font-size: 16px; color: #334155; line-height: 1.55; margin-bottom: 9px; }
#kbn-chatbot .kbn-card-date { font-size: 15px; color: #64748b; margin-bottom: 12px; }
#kbn-chatbot .kbn-steps-labels { display: flex; justify-content: space-between; font-size: 13px; color: #94a3b8; margin-bottom: 6px; }
#kbn-chatbot .kbn-steps-labels .kbn-step { flex: 1 1 0; text-align: center; white-space: nowrap; }
/* 지나온 단계는 은은하게, 현재 단계는 해당 색으로 */
#kbn-chatbot .kbn-card .kbn-step-past { color: #b6c2d4; }
#kbn-chatbot .kbn-card .kbn-step-active { color: var(--kbn-step-color); font-weight: 700; }
#kbn-chatbot .kbn-steps-bar { height: 6px; background: #e5e9f0; border-radius: 4px; overflow: hidden; }
#kbn-chatbot .kbn-steps-fill { height: 100%; border-radius: 4px; }
/* 신청 상세 카드 은행별 표 */
#kbn-chatbot .kbn-detail-tbl-wrap { margin-top: 10px; overflow-x: auto; }
#kbn-chatbot .kbn-detail-tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
#kbn-chatbot .kbn-detail-tbl th, #kbn-chatbot .kbn-detail-tbl td { border: 1px solid #e2e8f0; padding: 5px 6px; text-align: center; vertical-align: middle; white-space: nowrap; }
#kbn-chatbot .kbn-detail-tbl th { background: #f1f5f9; color: #475569; font-weight: 600; }
#kbn-chatbot .kbn-detail-sub { color: #94a3b8; font-size: 13.5px; }
#kbn-chatbot .kbn-card .kbn-steps-fill { background: var(--kbn-step-color); transition: width .4s ease-out; }
#kbn-chatbot .kbn-card-closing { margin-top: 13px; font-size: 17px; line-height: 1.65; color: #1e293b; }

/* 페이지 안내 카드 */
#kbn-chatbot .kbn-pages { display: flex; flex-direction: column; gap: 15px; margin: 11px 0 2px; }
#kbn-chatbot .kbn-pgroup-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 16px; font-weight: 800; color: #0f2350; margin-bottom: 8px;
}
#kbn-chatbot .kbn-pgroup-title::before {
    content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--kbn-accent); flex-shrink: 0;
}
#kbn-chatbot .kbn-plist { display: flex; flex-direction: column; gap: 6px; }
#kbn-chatbot .kbn-pitem {
    display: flex; align-items: flex-start; gap: 8px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 11px 13px;
    text-decoration: none; color: inherit;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
#kbn-chatbot .kbn-pitem:hover {
    border-color: var(--kbn-primary2); background: #f8fbff;
    box-shadow: 0 2px 8px rgba(16,47,110,.08);
}
#kbn-chatbot .kbn-pbody { flex: 1 1 auto; min-width: 0; }
#kbn-chatbot .kbn-pname {
    font-size: 17px; font-weight: 700; color: var(--kbn-primary); line-height: 1.4;
    text-decoration: none;
}
#kbn-chatbot .kbn-pdesc {
    margin-top: 4px; font-size: 15.5px; color: #64748b; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#kbn-chatbot .kbn-parrow { flex-shrink: 0; width: 17px; height: 17px; margin-top: 3px; color: #cbd5e1; }
#kbn-chatbot .kbn-parrow svg { width: 100%; height: 100%; display: block; }
#kbn-chatbot .kbn-pitem:hover .kbn-parrow { color: var(--kbn-primary2); }
/* 말풍선 공통 링크 스타일(#kbn-chatbot .kbn-bubble a)의 밑줄·색상이 카드에 먹지 않도록 무력화 */
#kbn-chatbot .kbn-bubble a.kbn-pitem,
#kbn-chatbot .kbn-bubble a.kbn-pitem:hover {
    text-decoration: none; color: inherit;
}


/* 입력 영역 */
#kbn-chatbot .kbn-foot { border-top: 1px solid #e2e8f0; background: #fff; padding: 8px; display: flex; align-items: flex-end; gap: 6px; }
#kbn-chatbot .kbn-home {
    background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer;
    width: 40px; height: 40px; flex-shrink: 0; padding: 0; color: #64748b;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
#kbn-chatbot .kbn-home svg { width: 20px; height: 20px; display: block; }
#kbn-chatbot .kbn-home:hover { background: #e2e8f0; color: var(--kbn-primary); }
#kbn-chatbot .kbn-input {
    flex: 1 1 auto; min-width: 0; box-sizing: border-box;
    border: 1px solid #cbd5e1; border-radius: 18px; padding: 9px 14px; font-size: 16px;
    outline: none; resize: none; font-family: inherit; line-height: 1.4;
    min-height: 40px; max-height: 96px; overflow-y: auto;
}
#kbn-chatbot .kbn-input:focus { border-color: var(--kbn-primary2); }
#kbn-chatbot .kbn-send {
    background: var(--kbn-primary); color: #fff; border: none; border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer; flex-shrink: 0; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .1s;
}
#kbn-chatbot .kbn-send svg { width: 20px; height: 20px; display: block; }
#kbn-chatbot .kbn-send:hover:not(:disabled) { background: var(--kbn-primary2); }
#kbn-chatbot .kbn-send:active:not(:disabled) { transform: scale(.94); }
#kbn-chatbot .kbn-send:disabled { opacity: .5; cursor: default; }
