/* 송아퍼니처 상담 챗봇 (2026-11-03 시안) — sgc- 만 씀. 색·글꼴은 site.css 토큰(--pine-700, --stone-*, --f-serif) 그대로 */
.sgc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 떠 있는 버튼: 기존 .fab 묶음 맨 위 (전화·견적 버튼과 같은 크기·간격, 스크롤 숨김도 같이) */
.fab-chat { background: #fff; border: 2px solid var(--pine-700, #24513D); cursor: pointer; padding: 0; overflow: hidden; }
.fab-chat .sgc-face { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; transform: scale(1.06); }
.fab-chat[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(36, 81, 61, .25), 0 10px 28px rgba(12, 26, 19, .28); }
.sgc-solo .sgc-face { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sgc-solo { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 39; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--pine-700, #24513D); padding: 0; overflow: hidden;
  background: #fff; color: #fff; box-shadow: 0 10px 28px rgba(12, 26, 19, .28); display: grid; place-items: center; cursor: pointer; }
.sgc-solo svg { width: 26px; height: 26px; }

/* 창 — PC: 떠 있는 버튼 왼쪽에 붙어 뜸(버튼 안 가림) */
.sgc { position: fixed; z-index: 62; right: calc(clamp(14px, 2vw, 28px) + 72px + 16px); bottom: calc(clamp(14px, 2vw, 28px) + env(safe-area-inset-bottom));
  width: 400px; height: min(660px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; color: var(--stone-950, #1C1A17);
  border: 1px solid var(--stone-200, #E3E0DA); border-radius: 14px; box-shadow: 0 24px 64px rgba(20, 18, 15, .22); overflow: hidden;
  font-family: var(--f-serif, "Gmarket Sans", "Pretendard", sans-serif); font-size: 15px; line-height: 1.55; letter-spacing: -.01em;
  opacity: 0; transform: translateY(12px) scale(.98); transform-origin: 100% 100%; transition: opacity .2s ease, transform .24s var(--ease-out, cubic-bezier(.23, 1, .32, 1)); }
.sgc.on { opacity: 1; transform: none; }
.sgc[hidden] { display: none; }
.sgc-hd { display: flex; align-items: center; gap: 4px; padding: 14px 10px 14px 18px; background: var(--pine-700, #24513D); color: #fff; }
.sgc-ti { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sgc-ti b { font-size: 17px; font-weight: 700; }
.sgc-ti span { font-size: 12.5px; font-weight: 500; color: #E3ECE6; }
.sgc-ib { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: #fff; border-radius: 8px; cursor: pointer; }
.sgc-ib svg { width: 22px; height: 22px; }
.sgc-ib:hover { background: rgba(255, 255, 255, .12); }
.sgc-ib:focus-visible, .sgc-c:focus-visible, .sgc-in button:focus-visible { outline: 2px solid var(--pine-700, #24513D); outline-offset: 2px; }
.sgc-hd .sgc-ib:focus-visible { outline-color: #fff; }

.sgc-log { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; background: var(--stone-50, #F8F7F4); display: flex; flex-direction: column; gap: 12px; }
.sgc-m { display: flex; animation: sgcIn .22s var(--ease-out, ease-out) both; }
.sgc-m.me { justify-content: flex-end; }
.sgc-m.bot { gap: 8px; align-items: flex-start; }
.sgc-av { flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 1px solid var(--stone-200, #E3E0DA); object-fit: cover; }
.sgc-m.bot .sgc-b { min-width: 0; }
.sgc-hi { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 4px; }
.sgc-hi img { flex: 0 0 68px; width: 68px; height: auto; }
.sgc-hi p { margin: 0 0 6px !important; }
.sgc-cond { margin-top: 6px !important; font-size: 13.5px; font-weight: 700; color: var(--pine-700, #24513D); }
.sgc-b { max-width: 100%; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--stone-200, #E3E0DA); color: var(--stone-950, #1C1A17); font-weight: 500; }
.sgc-m.bot .sgc-b { width: 100%; border-top-left-radius: 4px; }
.sgc-m.me .sgc-b { max-width: 82%; background: var(--pine-700, #24513D); color: #fff; border-color: var(--pine-700, #24513D); border-top-right-radius: 4px; word-break: keep-all; overflow-wrap: anywhere; }
.sgc-b p { margin: 0; word-break: keep-all; overflow-wrap: anywhere; }
.sgc-b p + p { margin-top: 4px; }
.sgc-b b { font-weight: 700; color: var(--stone-950, #1C1A17); }
.sgc-b mark { background: #E3ECE6; color: var(--pine-800, #1B3E2F); padding: 0 2px; border-radius: 3px; font-weight: 700; }
@keyframes sgcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 버튼 칩 */
.sgc-ch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sgc-ch.grid { display: grid; grid-template-columns: 1fr 1fr; }
.sgc-ch.tail { padding-top: 12px; border-top: 1px solid var(--stone-150, #E9E6E0); }
.sgc-c { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--pine-700, #24513D);
  background: #fff; color: var(--pine-700, #24513D); font: inherit; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.3; word-break: keep-all; }
.sgc-ch.grid .sgc-c { border-radius: 10px; min-height: 48px; }
.sgc-c:hover { background: #E3ECE6; }
.sgc-c.solid { background: var(--pine-700, #24513D); color: #fff; }
.sgc-c.solid:disabled { background: var(--stone-600, #6F6A62); border-color: var(--stone-600, #6F6A62); cursor: default; }
.sgc-c.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.sgc-ch.tail .sgc-c { border-color: var(--stone-300, #CFCAC2); color: var(--stone-800, #34302B); }
.sgc-ch.tail .sgc-c:hover { background: var(--stone-100, #F2F0EC); }

/* 상담 연결(답 뒤·미답 때만) */
.sgc-cs { margin-top: 12px; padding: 12px; border-radius: 10px; background: #E3ECE6; }
.sgc-cs > p { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--pine-800, #1B3E2F); }
.sgc-cs .sgc-ch { margin-top: 8px; }
.sgc-cs > p.sgc-off { margin-top: 6px; font-size: 13px; font-weight: 600; color: #5A4A1E; line-height: 1.45; }   /* 11/4 상담시간 밖 안내 */
.sgc-cs .sgc-c:first-child { background: var(--pine-700, #24513D); color: #fff; }
.sgc-cs .sgc-c[href^="https://open.kakao.com"] { background: #FEE500; border-color: #FEE500; color: #191600; }
.sgc-ex { margin-top: 16px !important; font-size: 13px; font-weight: 700; color: var(--stone-700, #4A4640); }
.sgc-ch.ex { margin-top: 8px; }
.sgc-ch.ex .sgc-c { border-color: var(--stone-300, #CFCAC2); color: var(--stone-800, #34302B); font-weight: 600; min-height: 36px; font-size: 13.5px; }
.sgc-note { margin-top: 10px !important; padding: 10px 12px; background: var(--stone-100, #F2F0EC); border-radius: 8px; font-size: 14px; }

/* 출처 칩 */
.sgc-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px !important; font-size: 12.5px; }
.sgc-src span { font-weight: 700; color: var(--stone-700, #4A4640); }
.sgc-src a { padding: 3px 9px; border-radius: 6px; background: var(--stone-100, #F2F0EC); color: var(--stone-800, #34302B); font-weight: 600; text-decoration: none; border: 1px solid var(--stone-200, #E3E0DA); }
.sgc-src a:hover { border-color: var(--pine-700, #24513D); color: var(--pine-700, #24513D); }

/* 제품 카드 */
.sgc-cards { display: flex; gap: 10px; overflow-x: auto; margin: 12px -14px 0; padding: 0 14px 6px; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.sgc-cards.one { overflow: visible; }
.sgc-pc { flex: 0 0 236px; scroll-snap-align: start; display: flex; gap: 10px; padding: 10px; border: 1px solid var(--stone-200, #E3E0DA); border-radius: 10px; background: #fff; }
.sgc-cards.one .sgc-pc { flex: 1 1 auto; }
.sgc-pc img, .sgc-noimg { flex: 0 0 76px; width: 76px; height: 76px; object-fit: contain; background: var(--stone-100, #F2F0EC); border-radius: 8px; }
.sgc-noimg { display: grid; place-items: center; font-size: 11px; color: var(--stone-700, #4A4640); text-align: center; }
.sgc-pb { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sgc-pb > b { font-size: 14px; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.sgc-pm { font-size: 12.5px; color: var(--stone-700, #4A4640); font-weight: 500; word-break: keep-all; }
.sgc-pp { font-size: 15px; font-weight: 700; color: var(--pine-700, #24513D); }
.sgc-pp.ask { color: var(--stone-700, #4A4640); font-size: 13.5px; }
.sgc-pa { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* 입력 줄 */
.sgc-in { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--stone-200, #E3E0DA); background: #fff; }
.sgc-in input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1.5px solid var(--stone-300, #CFCAC2); border-radius: 10px; font: inherit; font-size: 16px; color: var(--stone-950, #1C1A17); background: #fff; }
.sgc-in input::placeholder { color: var(--stone-600, #6F6A62); }
.sgc-in input:focus { outline: none; border-color: var(--pine-700, #24513D); }
.sgc-in button { width: 48px; height: 48px; border: 0; border-radius: 10px; background: var(--pine-700, #24513D); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sgc-in button svg { width: 22px; height: 22px; }

.sgc-typing .sgc-b { width: auto !important; display: flex; gap: 5px; padding: 14px 16px; }
.sgc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--stone-400, #A39D93); animation: sgcDot 1s infinite ease-in-out; }
.sgc-typing i:nth-child(2) { animation-delay: .15s; } .sgc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sgcDot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

/* ═══ 11/4 REA 이식 (이케아 Billie·일룸 Letus 화면 요소를 송아 초록으로) ═══ */
.sgc-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sgc-body .sgc-log { flex: 1; min-height: 0; }
/* 맨 아래로 (이케아 autoscroll 버튼) */
.sgc-down { position: absolute; right: 14px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--pine-700, #24513D); color: #fff;
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 16px rgba(12, 26, 19, .25); animation: sgcPop .2s cubic-bezier(.4, 0, .4, 1) both; }
.sgc-down[hidden] { display: none; }
.sgc-down svg { width: 20px; height: 20px; }
@keyframes sgcPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
/* 지난 답의 단계 버튼 (이케아: 칩은 최근 답에만) */
.sgc-ch.past .sgc-c:disabled { opacity: .45; cursor: default; background: #fff; }
/* 👍👎 (답 밑, aria-pressed) */
.sgc-fb { display: flex; align-items: center; gap: 4px; margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--stone-200, #E3E0DA); font-size: 13px; font-weight: 600; color: var(--stone-700, #4A4640); }
.sgc-fb > span:first-child { margin-right: 4px; }
.sgc-fbb { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--stone-300, #CFCAC2); background: #fff; color: var(--stone-700, #4A4640); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s cubic-bezier(.23, 1, .32, 1); }
.sgc-fbb svg { width: 18px; height: 18px; }
.sgc-fbb:hover { border-color: var(--pine-700, #24513D); color: var(--pine-700, #24513D); }
.sgc-fbb:active { transform: scale(.92); }
.sgc-fbb[aria-pressed="true"] { background: var(--pine-700, #24513D); border-color: var(--pine-700, #24513D); color: #fff; }
.sgc-fbb[data-fb="down"][aria-pressed="true"] { background: var(--stone-800, #34302B); border-color: var(--stone-800, #34302B); }
.sgc-fbb:focus-visible { outline: 2px solid var(--pine-700, #24513D); outline-offset: 2px; }
.sgc-fbm { margin-left: 6px; color: var(--pine-700, #24513D); font-weight: 700; }
.sgc-why { margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--stone-100, #F2F0EC); animation: sgcIn .22s ease-out both; }
.sgc-why > p { margin: 0; font-size: 14px; font-weight: 700; }
.sgc-why .sgc-ch { margin-top: 8px; }
.sgc-why .sgc-c { background: #fff; }
.sgc-thx { font-size: 14px; }
/* 후속 버튼 줄 (PB [6인용만][비교]) */
.sgc-fu-t { margin-top: 12px !important; font-size: 12.5px; font-weight: 700; color: var(--stone-700, #4A4640); }
.sgc-ch.fu { margin-top: 6px; gap: 6px; }
.sgc-ch.fu .sgc-c { min-height: 38px; padding: 6px 12px; font-size: 13.5px; background: #F1F6F3; border-color: #9DB8AA; color: var(--pine-800, #1B3E2F); }
.sgc-ch.fu .sgc-c[data-v="fc:"], .sgc-ch.fu .sgc-c[data-v="fa:"] { background: var(--pine-700, #24513D); border-color: var(--pine-700, #24513D); color: #fff; }
.sgc-ch.fu.past .sgc-c:disabled { background: #fff; color: var(--stone-600, #6F6A62); border-color: var(--stone-300, #CFCAC2); }
/* 카드 배지 (이케아 재고 배지 자리 → 송아는 조달 등록) */
.sgc-bd { align-self: flex-start; margin-top: 2px; padding: 1px 7px; border-radius: 999px; background: #E3ECE6; color: var(--pine-800, #1B3E2F); font-size: 11.5px; font-weight: 700; }
.sgc-pp { font-size: 15.5px; font-weight: 800; }
/* 비교표 */
.sgc-cmp { margin: 12px -6px 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--stone-200, #E3E0DA); border-radius: 10px; background: #fff; }
.sgc-cmp:focus-visible { outline: 2px solid var(--pine-700, #24513D); outline-offset: 2px; }
.sgc-cmp table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.35; table-layout: fixed; min-width: 280px; }
.sgc-cmp th, .sgc-cmp td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--stone-150, #E9E6E0); vertical-align: middle; word-break: keep-all; overflow-wrap: anywhere; }
.sgc-cmp tbody th { width: 52px; text-align: left; font-size: 12px; font-weight: 700; color: var(--stone-700, #4A4640); background: var(--stone-50, #F8F7F4); }
.sgc-cmp thead td { width: 52px; background: var(--stone-50, #F8F7F4); }
.sgc-cmp thead th { font-size: 12px; font-weight: 800; color: var(--stone-950, #1C1A17); }
.sgc-cmp thead th img { display: block; width: 56px; height: 56px; margin: 0 auto 4px; object-fit: contain; background: var(--stone-100, #F2F0EC); border-radius: 6px; }
.sgc-cmp small { margin-left: 1px; font-size: 10.5px; color: var(--stone-600, #6F6A62); }
.sgc-cmp tr.pr b { color: var(--pine-700, #24513D); font-weight: 800; white-space: nowrap; }
.sgc-cmp tbody th { white-space: nowrap; }
.sgc-cmp tr.pr b.lo { background: #E3ECE6; padding: 1px 4px; border-radius: 4px; }
.sgc-cmp .ask { color: var(--stone-700, #4A4640); font-size: 12px; }
.sgc-cmp tr.id td { font-size: 12px; letter-spacing: -.02em; }
.sgc-cmp tr.act td, .sgc-cmp tr.act th { border-bottom: 0; }
.sgc-cmp tr.act .sgc-c { min-height: 34px; padding: 4px 10px; font-size: 13px; }
/* 타이핑: 이케아 enter(.4s, 0→1) 뒤 thinking(1.2s 숨쉬기) — 송아 초록 점 3개 */
.sgc-typing .sgc-b { animation: sgcEnter .4s cubic-bezier(.23, 1, .32, 1) both; }
.sgc-typing i { background: var(--pine-700, #24513D) !important; animation: sgcThink 1.2s .4s infinite ease-in-out !important; }
.sgc-typing i:nth-child(2) { animation-delay: .55s !important; } .sgc-typing i:nth-child(3) { animation-delay: .7s !important; }
@keyframes sgcEnter { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes sgcThink { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(.6); opacity: .45; } }
/* 먼저 말 걸기 말풍선 (이케아 invite: role=status, 60초 뒤 숨김, 버튼 쪽 꼬리) */
.sgc-pro { position: fixed; z-index: 61; display: flex; align-items: flex-start; gap: 10px; width: 300px; max-width: calc(100vw - 32px); padding: 14px 40px 14px 14px; border-radius: 14px;
  background: #fff; color: var(--stone-950, #1C1A17); border: 1.5px solid var(--pine-700, #24513D); box-shadow: 0 14px 36px rgba(12, 26, 19, .22);
  font-family: var(--f-serif, "Gmarket Sans", "Pretendard", sans-serif); font-size: 14.5px; line-height: 1.5; letter-spacing: -.01em;
  opacity: 0; transform: scale(.9) translateY(10px); transform-origin: 100% 100%; visibility: hidden;
  transition: opacity .3s cubic-bezier(.4, 0, .4, 1), transform .3s cubic-bezier(.4, 0, .4, 1), visibility 0s linear .3s; }
.sgc-pro.on { opacity: 1; transform: none; visibility: visible; transition: opacity .3s cubic-bezier(.4, 0, .4, 1), transform .3s cubic-bezier(.4, 0, .4, 1), visibility 0s; }
.sgc-pro.on.away { opacity: 0; transform: translateY(8px); visibility: hidden; transition: opacity .2s, transform .2s, visibility 0s linear .2s; }
.sgc-pro > img { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--stone-200, #E3E0DA); background: #fff; object-fit: cover; }
.sgc-pro-b { min-width: 0; }
.sgc-pro-b p { margin: 0; font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }
.sgc-pro-b b { color: var(--pine-700, #24513D); }
.sgc-pro-a { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sgc-pro-x { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: transparent; color: var(--stone-700, #4A4640); border-radius: 8px; cursor: pointer; }
.sgc-pro-x svg { width: 18px; height: 18px; }
.sgc-pro-x:hover { background: var(--stone-100, #F2F0EC); }
.sgc-pro-x:focus-visible, .sgc-pro .sgc-c:focus-visible { outline: 2px solid var(--pine-700, #24513D); outline-offset: 2px; }
.sgc-pro-tail { position: absolute; bottom: -8px; right: var(--tail, 20px); width: 14px; height: 14px; background: #fff; border-right: 1.5px solid var(--pine-700, #24513D); border-bottom: 1.5px solid var(--pine-700, #24513D); transform: rotate(45deg); }
.fab-chat.sgc-ping { box-shadow: 0 0 0 4px rgba(36, 81, 61, .28), 0 10px 28px rgba(12, 26, 19, .28); }
@media (max-width: 600px) {
  .sgc-pro { width: 252px; padding: 12px 36px 12px 12px; font-size: 14px; gap: 8px; }
  .sgc-pro > img { display: none; }   /* 폰: 버튼 2개가 한 줄에 들어가게 얼굴은 뺌 (챗봇 버튼이 바로 밑에 있음) */
  .sgc-pro .sgc-c.sm { min-height: 36px; padding: 6px 11px; }
  .sgc-pro-a { margin-top: 8px; }
  .sgc-cmp { margin-left: -4px; margin-right: -4px; }
  .sgc-cmp table { min-width: 0; font-size: 12.5px; }
  .sgc-cmp tbody th, .sgc-cmp thead td { width: 50px; padding-left: 5px; padding-right: 2px; font-size: 11.5px; }
  .sgc-cmp th, .sgc-cmp td { padding-left: 3px; padding-right: 3px; }
  .sgc-cmp thead th img { width: 48px; height: 48px; }
  .sgc-cmp tr.act .sgc-c { padding: 4px 8px; }
}
html.sgc-open .sgc-pro { display: none; }

/* 태블릿·좁은 PC */
@media (max-width: 860px) { .sgc { right: calc(clamp(14px, 2vw, 28px) + 48px + 12px); } }
/* 폰: 전체 화면 시트, 좌우 16px */
@media (max-width: 600px) {
  .sgc { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; transform: translateY(60px); transform-origin: 50% 100%;
    transition: opacity .2s cubic-bezier(.4, 0, .4, 1), transform .24s cubic-bezier(.23, 1, .32, 1); }   /* 11/4 이케아 폰 시트처럼 60px 아래에서 올라옴 (송아는 전체 화면 유지) */
  .sgc-hd { padding: calc(10px + env(safe-area-inset-top)) 8px 10px 16px; }
  .sgc-log { padding: 16px; }
  .sgc-in { padding-left: 16px; padding-right: 16px; }
  .sgc-cards { margin: 12px -14px 0; }
  .sgc-av { flex-basis: 28px; width: 28px; height: 28px; }
  .sgc-pc { flex-basis: 250px; }
  html.sgc-open, html.sgc-open body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sgc, .sgc-m, .sgc-pro, .sgc-why, .sgc-down, .sgc-typing .sgc-b { transition: none; animation: none; } .sgc-typing i { animation: none !important; opacity: .6; } .sgc-pro { transform: none; } }
@media print { .sgc, .fab-chat, .sgc-solo, .sgc-pro { display: none !important; } }
