/* Sentrix AI 도우미 창 — D1 R7(2026-12-01)부터 상단바 AI 단추 아래 붙는 창(모양·자리는 d1-sxb.css). 오른쪽 아래 떠 있는 버튼은 없앴다.
 * 색은 tokens.css(--soc-*, --ui-*)와 상태 토큰(--sx-status-*)만 쓴다. 다크 모드는 토큰이 바뀌어 따라간다.
 * 스크롤: 창 안에서는 메시지 목록(.soc-support-chatbot-panel__messages)이 유일한 세로 스크롤.
 *         검토 표는 카드 안에서 가로로만 스크롤한다.
 * 아래 여백: 옛 버튼 자리(본문 아래 104 · 띠)는 없앴다 — SX-F r24가 띠(--sxa-shell-reserve)를 0으로, 여기서는 104 규칙을 지움.
 * 모바일(<768px)에서는 창을 숨긴다. */
.soc-support-chatbot-panel.hidden { display: none !important; }

.soc-support-chatbot-panel {
  position: fixed; z-index: 1150;
  right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 48px)); height: min(640px, calc(100dvh - 92px - var(--soc-topbar-height, 64px) - 12px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--soc-surface); color: var(--soc-text);
  border: 1px solid var(--soc-border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.24), 0 4px 12px rgba(15, 23, 42, 0.12);
}
.soc-support-chatbot-panel.is-wide { width: min(880px, calc(100vw - 48px)); height: min(760px, calc(100dvh - 92px - var(--soc-topbar-height, 64px) - 12px)); }
@media (max-width: 767.98px) { .soc-support-chatbot-panel { display: none !important; } }

.soc-support-chatbot-panel__head {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--soc-divider); background: var(--soc-surface);
}
.soc-support-chatbot-panel__avatar {
  flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  background: var(--ui-accent-weak); color: var(--soc-primary);
}
.soc-support-chatbot-panel__avatar svg { width: 20px; height: 20px; }
.soc-support-chatbot-panel__title { flex: 1 1 auto; min-width: 0; }
.soc-support-chatbot-panel__title h2 { margin: 0; font-size: 16px; line-height: 22px; font-weight: 700; }
.soc-support-chatbot-panel__title p { margin: 0; font-size: 12px; line-height: 17px; color: var(--soc-text-sub); word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; }
.soc-support-chatbot-panel__icon {
  flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--soc-text-sub); cursor: pointer;
}
.soc-support-chatbot-panel__icon:hover { background: var(--soc-surface-2); color: var(--soc-text); }

.soc-support-chatbot-panel__messages {
  list-style: none; margin: 0; padding: 16px; min-height: 0; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; background: var(--soc-surface-2);
}
.soc-support-chatbot__msg {
  max-width: 86%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 21px;
  word-break: keep-all; overflow-wrap: anywhere; white-space: pre-wrap;
}
/* 재디자인 도우미 말풍선(.sxa-bubble·.sxa-user-bubble)도 같은 한국어 단어 보존. 줄 꺾기(overflow-wrap: anywhere)는 재디자인 규칙 그대로 */
#supportChatbotPanel .sxa-bubble, #supportChatbotPanel .sxa-user-bubble { word-break: keep-all; }
.soc-support-chatbot__msg.is-bot { align-self: flex-start; background: var(--soc-surface); border: 1px solid var(--soc-border); border-top-left-radius: 4px; }
.soc-support-chatbot__msg.is-user { align-self: flex-end; background: var(--ui-accent-weak); border: 1px solid var(--soc-primary-soft-bg); border-top-right-radius: 4px; }
.soc-support-chatbot__msg.is-card { max-width: 100%; width: 100%; box-sizing: border-box; white-space: normal; }
.soc-support-chatbot__msg.is-question { border-color: var(--sx-status-warning-mid, var(--soc-border)); }
.soc-support-chatbot__msg.is-confirm { border-color: var(--soc-primary); }
.soc-support-chatbot__msg p { margin: 0 0 8px; }
.soc-support-chatbot__msg p:last-child { margin-bottom: 0; }
/* 선택 버튼 줄 다음 글은 바깥 초점 링(2px + 간격 2px)보다 넓게 띄운다. 위 p 규칙이 .__hint 의 위 여백을 지우던 것 보정 */
.soc-support-chatbot__msg .soc-support-chatbot__choices + p { margin-top: 8px; }
.soc-support-chatbot__msg.is-typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.soc-support-chatbot__msg.is-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--soc-text-sub); opacity: .5; }

.soc-support-chatbot__card-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.soc-support-chatbot__card-head strong { font-size: 14px; }
.soc-support-chatbot__card-head span { font-size: 12px; color: var(--soc-text-sub); }
.soc-support-chatbot__ask-title { font-size: 12px !important; font-weight: 700; color: var(--sx-status-warning-strong, var(--soc-text-sub)); margin-bottom: 4px !important; }
.soc-support-chatbot__msg.is-confirm .soc-support-chatbot__ask-title { color: var(--soc-text); }
.soc-support-chatbot__choices { display: flex; flex-wrap: wrap; gap: 6px; }
.soc-support-chatbot__choices .ds-btn { max-width: 100%; white-space: normal; text-align: left; }
.soc-support-chatbot__bulk { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--soc-text-sub); }
.soc-support-chatbot__bulk input[type="checkbox"] { flex: none; width: 16px; height: 16px; min-width: 0; min-height: 0; margin: 0; padding: 0; accent-color: var(--soc-primary); }
.soc-support-chatbot__hint { margin: 8px 0 0; font-size: 12px; line-height: 18px; color: var(--soc-text-sub); }
.soc-support-chatbot__summary { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 20px; }
.soc-support-chatbot__confirm-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.soc-support-chatbot__confirm-actions .soc-support-chatbot__hint { flex: 1 1 160px; margin: 0; }
.soc-support-chatbot__confirm-actions [data-action="support-chatbot-register"] { min-width: 112px; min-height: 40px; color: #fff; }
/* 다크 공용 규칙(primary 주황 !important + disabled opacity:1 !important)이 흐림을 지우므로 패널 id로 이긴다 */
#supportChatbotPanel .soc-support-chatbot__confirm-actions [data-action="support-chatbot-register"][disabled] { opacity: .45 !important; cursor: not-allowed; }

.soc-support-chatbot__notices {
  margin: 0 0 8px; padding: 6px 10px 6px 26px; font-size: 12px; line-height: 18px;
  background: var(--sx-status-warning-weak, var(--soc-surface-2)); color: var(--sx-status-warning-ink, var(--soc-text));
  border: 1px solid var(--sx-status-warning-mid, var(--soc-border)); border-radius: 8px;
}
.soc-support-chatbot__table-wrap { overflow-x: auto; overflow-y: visible; border: 1px solid var(--soc-border); border-radius: 10px; }
.soc-support-chatbot__table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 13px; }
.soc-support-chatbot__table thead th {
  text-align: left; font-weight: 700; font-size: 12px; color: var(--soc-text-sub);
  background: var(--soc-surface-2); padding: 7px 8px; border-bottom: 1px solid var(--soc-divider); white-space: nowrap;
}
.soc-support-chatbot__table td { padding: 7px 8px; border-bottom: 1px solid var(--soc-divider); vertical-align: top; line-height: 18px; }
.soc-support-chatbot__table tr:last-child td { border-bottom: 0; }
.soc-support-chatbot__table td.is-ref { width: 26%; }
.soc-support-chatbot__table td.is-aff { min-width: 88px; word-break: keep-all; overflow-wrap: anywhere; }
.soc-support-chatbot__table td.is-name { white-space: nowrap; font-weight: 600; }
.soc-support-chatbot__table td.is-phone { white-space: nowrap; font-variant-numeric: tabular-nums; }
.soc-support-chatbot__table td.is-status { white-space: nowrap; }
.soc-support-chatbot__table td.is-detail { min-width: 180px; color: var(--soc-text-sub); word-break: keep-all; overflow-wrap: anywhere; }
.soc-support-chatbot__table tr[data-status="excluded"] td { color: var(--soc-text-sub); }
.soc-support-chatbot__ref { display: inline-block; margin-right: 6px; font-weight: 700; color: var(--soc-text-sub); }
.soc-support-chatbot__source { word-break: keep-all; overflow-wrap: anywhere; }
.soc-support-chatbot__sub { display: block; font-size: 12px; font-weight: 400; color: var(--soc-text-sub); }
.soc-support-chatbot__badge {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.soc-support-chatbot__badge::before { content: ""; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.soc-support-chatbot__badge.is-ok { background: var(--sx-status-success-weak); color: var(--sx-status-success-ink); border-color: var(--sx-status-success-mid); }
.soc-support-chatbot__badge.is-warn { background: var(--sx-status-warning-weak); color: var(--sx-status-warning-ink); border-color: var(--sx-status-warning-mid); }
.soc-support-chatbot__badge.is-danger { background: var(--sx-status-danger-weak); color: var(--sx-status-danger-ink); border-color: var(--sx-status-danger-mid); }
.soc-support-chatbot__badge.is-muted { background: var(--sx-status-neutral-weak); color: var(--sx-status-neutral-ink); border-color: var(--sx-status-neutral-mid); border-style: dashed; }

/* fix3: 채팅 앱 입력부 — 첨부 칩 줄 + [클립 · 자동으로 늘어나는 입력칸 · 보내기] 한 상자. 근무 월·'엑셀 파일' 버튼 없음. */
.soc-support-chatbot-panel__composer {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; min-width: 0;
  border-top: 1px solid var(--soc-divider); background: var(--soc-surface);
}
.soc-support-chatbot-panel__box {
  display: flex; align-items: flex-end; gap: 4px; min-width: 0; padding: 4px;
  background: var(--soc-input-bg); border: 1px solid var(--soc-text-sub); border-radius: 22px;
}
.soc-support-chatbot-panel__box:focus-within { border-color: var(--soc-primary); }
.soc-support-chatbot-panel__box textarea {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box; min-height: 36px; max-height: 160px; resize: none;
  margin: 0; padding: 8px 6px; font: inherit; font-size: 14px; line-height: 20px; color: var(--soc-text);
  background: transparent; border: 0; border-radius: 0; box-shadow: none; overflow-y: auto;
}
.soc-support-chatbot-panel__box textarea:focus, .soc-support-chatbot-panel__box textarea:focus-visible { outline: none; }
.soc-support-chatbot-panel__box textarea::placeholder { color: var(--soc-text-sub); }
.soc-support-chatbot-panel__tool, .soc-support-chatbot-panel__send {
  flex: 0 0 auto; width: 36px; height: 36px; min-width: 36px; min-height: 36px; padding: 0; margin: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
}
.soc-support-chatbot-panel__tool { background: transparent; color: var(--soc-text-sub); }
.soc-support-chatbot-panel__tool:hover { background: var(--soc-surface-2); color: var(--soc-text); }
.soc-support-chatbot-panel__send { background: var(--soc-primary); color: #fff; }
.soc-support-chatbot-panel__send:hover { filter: brightness(0.95); }
.soc-support-chatbot-panel__send[disabled] { opacity: .45; cursor: not-allowed; }
.soc-support-chatbot-panel__box :focus-visible { outline: 2px solid var(--ui-focus-color, #111827); outline-offset: 1px; }
.soc-support-chatbot__attach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.soc-support-chatbot__chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px;
  padding: 4px 4px 4px 10px; font-size: 13px; font-weight: 600; color: var(--sx-status-info-ink, var(--soc-text));
  background: var(--sx-status-info-weak, var(--soc-surface-2)); border: 1px solid var(--sx-status-info-mid, var(--soc-border));
  border-radius: 999px;
}
.soc-support-chatbot__chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.soc-support-chatbot__chip.is-image { padding: 0; width: 56px; height: 56px; border-radius: 10px; overflow: visible; }
.soc-support-chatbot__chip.is-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; }
.soc-support-chatbot__chip-x {
  flex: 0 0 auto; width: 24px; height: 24px; min-width: 24px; min-height: 24px; padding: 0; margin: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: inherit;
}
.soc-support-chatbot__chip-x svg { width: 14px; height: 14px; }
.soc-support-chatbot__chip-x:hover { background: var(--soc-surface); }
.soc-support-chatbot__chip.is-image .soc-support-chatbot__chip-x {
  position: absolute; top: -8px; right: -8px; background: var(--soc-surface); color: var(--soc-text);
  border: 1px solid var(--soc-border); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
}
.soc-support-chatbot__attach .soc-support-chatbot__hint { flex-basis: 100%; margin: 0; }
.soc-support-chatbot__thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.soc-support-chatbot__thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
/* 봇 말풍선 아래 바로 가기 버튼(서버 허용 목록) */
.soc-support-chatbot__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; white-space: normal; }
.soc-support-chatbot__link { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 32px; text-align: left; white-space: normal; }
.soc-support-chatbot__link svg { flex: 0 0 auto; }
/* 끌어다 놓기 안내 */
.soc-support-chatbot-panel__drop { display: none; }
.soc-support-chatbot-panel.is-dragging .soc-support-chatbot-panel__drop {
  position: absolute; inset: 8px; z-index: 2; display: grid; place-items: center; pointer-events: none;
  border: 2px dashed var(--soc-primary); border-radius: 12px; background: var(--ui-accent-weak);
  color: var(--soc-primary-deep, var(--soc-text)); font-size: 14px; font-weight: 700;
}
#supportChatbotPanel :focus-visible { outline: 2px solid var(--soc-text) !important; outline-offset: 2px !important; }
#supportChatbotPanel #supportChatbotInput:focus-visible { outline: none !important; box-shadow: none !important; }
#supportChatbotPanel .soc-support-chatbot-panel__box:has(#supportChatbotInput:focus-visible) { border-color: var(--soc-text); box-shadow: 0 0 0 1px var(--soc-text); }

/* fix2: '무시한 줄'(인사·잡담·머리말) — 기본 접힘, 잘못 뺐으면 '이 줄 넣기' */
.soc-support-chatbot__ignored { margin: 8px 0 0; font-size: 12px; line-height: 18px; color: var(--soc-text-sub); }
.soc-support-chatbot__ignored > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.soc-support-chatbot__ignored ul { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.soc-support-chatbot__ignored li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; padding: 6px 8px;
  border: 1px dashed var(--soc-border); border-radius: 8px; background: var(--soc-surface-2); }
.soc-support-chatbot__ignored li .soc-support-chatbot__source { flex: 1 1 200px; min-width: 0; color: var(--soc-text); }
.soc-support-chatbot__ignored li .soc-support-chatbot__sub { flex-basis: 100%; }

/* 브리프4 표 양식: 검토 표 위 '읽은 행·확인 필요·무시한 행' 줄과 '이 파일만 다시 해석'. 색은 토큰만. */
.soc-support-chatbot__layout {
  margin: 0 0 8px; padding: 8px 10px; font-size: 13px; line-height: 19px;
  background: var(--soc-surface-2); border: 1px solid var(--soc-border); border-radius: 10px;
}
.soc-support-chatbot__layout-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.soc-support-chatbot__layout-counts { flex: 1 1 240px; min-width: 0; font-weight: 600; color: var(--soc-text); overflow-wrap: anywhere; }
.soc-support-chatbot__layout-row [data-action="support-chatbot-layout-relearn"] { margin-left: auto; white-space: nowrap; }
.soc-support-chatbot__layout .soc-support-chatbot__hint { margin-top: 6px; }
/* 양식 저장 체크(확인 카드) */
.soc-support-chatbot__bulk.soc-support-chatbot__save { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; color: var(--soc-text); font-weight: 600; }
.soc-support-chatbot__save input[type="checkbox"] { margin-top: 2px; }
.soc-support-chatbot__save .soc-support-chatbot__sub { margin-top: 2px; }
/* 저장된 양식(헤더 버튼 → 대화 안 카드). 세로 스크롤은 메시지 목록 하나뿐 */
.soc-support-chatbot-panel__icon.is-active { background: var(--ui-accent-weak); color: var(--soc-primary); }
.soc-support-chatbot__msg.is-templates .soc-support-chatbot__card-head { align-items: center; }
.soc-support-chatbot__msg.is-templates .soc-support-chatbot__card-head strong:focus { outline: none; }
.soc-support-chatbot__msg.is-templates .soc-support-chatbot__card-head strong:focus-visible { outline: 2px solid var(--ui-focus-color, #111827); outline-offset: 2px; }
.soc-support-chatbot__tpl-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.soc-support-chatbot__tpl-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; padding: 8px 10px;
  background: var(--soc-surface-2); border: 1px solid var(--soc-border); border-radius: 8px;
}
.soc-support-chatbot__tpl-label { flex: 1 1 200px; min-width: 0; font-size: 13px; line-height: 19px; font-weight: 600; overflow-wrap: anywhere; }
.soc-support-chatbot__tpl-confirm { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.soc-support-chatbot__tpl-confirm p { flex: 1 1 100%; margin: 0; font-size: 12px; line-height: 18px; color: var(--sx-status-danger-ink, var(--soc-text)); }
#supportChatbotPanel #supportChatbotTplConfirm {
  background: var(--soc-danger-deep) !important; border-color: var(--soc-danger-deep) !important;
  color: var(--soc-on-danger) !important; -webkit-text-fill-color: var(--soc-on-danger) !important;
}
.soc-support-chatbot__tpl-error {
  margin: 0 0 8px; padding: 6px 10px; font-size: 12px; line-height: 18px;
  color: var(--sx-status-danger-ink, var(--soc-text)); background: var(--sx-status-danger-weak, var(--soc-surface-2));
  border: 1px solid var(--sx-status-danger-mid, var(--soc-border)); border-radius: 8px;
}

