/* 웹지원센터 상담 도우미 — 사이트 테마 변수(--m-*)를 쓰고, 없으면 같은 색을 기본값으로 */
.wc {
  --wc-pri: var(--m-pri, #1285cd);
  --wc-deep: var(--m-deep, #0a4f7d);
  --wc-ink: var(--m-ink, #0f172a);
  --wc-ink2: var(--m-ink-2, #334155);
  --wc-mute: var(--m-muted, #7c8ba1);
  --wc-line: var(--m-line, #dce7f1);
  --wc-tint: var(--m-tint, #eaf4fc);
  --wc-bg: var(--m-tint-2, #f2f6fa);
  --wc-mint: var(--m-mint, #3fd9c9);
  --wc-lime: #89d822;
  font-family: var(--m-font, Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif);
}
.wc [hidden] { display: none !important; }

.wc-btn { position: fixed; right: 12px; bottom: 88px; z-index: 95; width: 88px; height: 88px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff; display: grid; place-items: center;
  background: transparent; transition: transform .2s; }
.wc-btn:hover { transform: translateY(-2px); }
.wc-i-x svg { width: 26px; height: 26px; display: block; }
.wc-i-chat { display: block; width: 100%; height: 100%; }
.wc-i-chat .rb { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(15, 23, 42, .3)); }

/* 상담 로봇 */
.rb { display: block; overflow: visible; }
.rb-ant-l { stroke: var(--wc-deep); stroke-width: 2.6; stroke-linecap: round; }
.rb-ant { fill: var(--wc-lime); transform-box: fill-box; transform-origin: center; animation: rb-glow 1.8s ease-in-out infinite; }
.rb-ear { fill: var(--wc-pri); }
.rb-head { fill: #fff; stroke: var(--wc-pri); stroke-width: 2.6; }
.rb-face { fill: #0f2f4f; }
.rb-eyes { fill: var(--wc-mint); transform-box: fill-box; transform-origin: center; animation: rb-blink 4.6s infinite; }
.rb-mouth { fill: none; stroke: var(--wc-mint); stroke-width: 1.8; stroke-linecap: round; }
.rb-cheek { fill: #ff9fb2; opacity: .75; }
.rb-body { transform-box: fill-box; transform-origin: 50% 100%; animation: rb-float 3.2s ease-in-out infinite; }
.wc-btn:hover .rb-body { animation: rb-hop .6s ease-in-out; }
.wc.is-busy .wc-ava .rb-eyes { animation: rb-look 1.2s ease-in-out infinite; }
.wc.is-busy .wc-ava .rb-ant { animation-duration: .5s; }
@keyframes rb-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-3px) rotate(-3deg); } }
@keyframes rb-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes rb-glow { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes rb-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-7px) rotate(4deg); } 70% { transform: translateY(0) rotate(-2deg); } }
@keyframes rb-look { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-2.5px); } 70% { transform: translateX(2.5px); } }
.wc-i-x { display: none; width: 56px; height: 56px; border-radius: 50%; place-items: center;
  background: linear-gradient(135deg, var(--wc-pri), var(--wc-deep)); box-shadow: 0 10px 26px rgba(15, 23, 42, .3); }
.wc.is-open .wc-i-chat { display: none; }
.wc.is-open .wc-i-x { display: grid; }
.wc-dot { position: absolute; top: 12%; right: 6%; width: 14px; height: 14px; border-radius: 50%;
  background: #d9333f; border: 2px solid #fff; }

/* 말풍선 — 가운데가 로봇 얼굴 높이에 오도록 bottom 을 얼굴 높이로 두고 절반 내린다 */
.wc-teaser { position: fixed; right: 108px; bottom: 128px; translate: 0 50%; z-index: 95; max-width: 200px; padding: 12px 30px 12px 14px;
  background: #fff; color: var(--wc-ink); border: 1px solid var(--wc-line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .16); font-size: 14.5px; font-weight: 600; line-height: 1.45; word-break: keep-all;
  cursor: pointer; animation: wc-pop .3s ease; }
.wc-teaser::after { content: ""; position: absolute; top: 50%; right: -7px; width: 12px; height: 12px; margin-top: -6px;
  background: #fff; border: solid var(--wc-line); border-width: 1px 1px 0 0; transform: rotate(45deg); }
.wc-teaser-x { position: absolute; top: 4px; right: 6px; padding: 2px 4px; border: 0; background: none;
  color: var(--wc-mute); font-size: 18px; line-height: 1; cursor: pointer; }

.wc-panel { position: fixed; right: 26px; bottom: 170px; z-index: 1100; width: 380px; max-width: calc(100vw - 32px);
  height: 600px; max-height: calc(100vh - 194px); display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); animation: wc-pop .25s ease; }
.wc-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 10px 14px 16px; color: #fff;
  background: linear-gradient(135deg, var(--wc-pri), var(--wc-deep)); }
.wc-ava { flex: none; width: 42px; height: 42px; display: grid; place-items: center; }
.wc-ava .rb { width: 42px; height: 42px; }
.wc-ht { flex: 1; min-width: 0; line-height: 1.35; }
.wc-ht strong { display: block; font-size: 16px; }
.wc-ht small { display: block; font-size: 12px; opacity: .85; }
.wc-head button { flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: #fff; display: grid; place-items: center; }
.wc-head button:hover { background: rgba(255, 255, 255, .16); }
.wc-head button svg { width: 18px; height: 18px; }

.wc-msgs { flex: 1; overflow-y: auto; padding: 16px 14px 6px; background: var(--wc-bg); overscroll-behavior: contain; }
.wc-row { display: flex; flex-direction: column; margin: 0 0 12px; }
.wc-u { align-items: flex-end; }
.wc-b { align-items: flex-start; }
.wc-bub { max-width: 86%; padding: 10px 13px; font-size: 14.5px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.wc-b .wc-bub { background: #fff; color: var(--wc-ink); border: 1px solid var(--wc-line); border-radius: 4px 14px 14px 14px; }
.wc-b .wc-bub strong { color: var(--wc-deep); }
.wc-u .wc-bub { background: var(--wc-pri); color: #fff; border-radius: 14px 4px 14px 14px; white-space: pre-wrap; }
.wc-links { display: flex; flex-wrap: wrap; gap: 6px; max-width: 86%; margin-top: 8px; }
.wc-link { display: inline-flex; align-items: center; padding: 7px 12px; border: 1px solid var(--wc-pri); border-radius: 999px;
  background: #fff; color: var(--wc-pri); font-size: 13px; font-weight: 600; line-height: 1.3; text-decoration: none; }
.wc-link:hover { background: var(--wc-tint); }
.wc-link.wc-main { background: var(--wc-pri); color: #fff; }
.wc-link.wc-main:hover { background: var(--wc-deep); border-color: var(--wc-deep); }
.wc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; animation: wc-pop .25s ease; }
.wc-chip { padding: 7px 12px; border: 1px solid var(--wc-line); border-radius: 999px; background: #fff; color: var(--wc-ink2);
  font: inherit; font-size: 13px; line-height: 1.3; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.wc-chip:hover { border-color: var(--wc-pri); color: var(--wc-pri); background: var(--wc-tint); }
.wc-cap { flex-basis: 100%; margin: 2px 0 0; padding-top: 10px; border-top: 1px dashed var(--wc-line); color: var(--wc-mute); font-size: 12.5px; }
.wc-hint { flex-basis: 100%; margin: 0; color: var(--wc-mute); font-size: 12px; }
.wc-typing { display: inline-flex; gap: 4px; padding: 5px 2px; }
.wc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--wc-mute); animation: wc-dot 1.2s infinite ease-in-out; }
.wc-typing i:nth-child(2) { animation-delay: .15s; }
.wc-typing i:nth-child(3) { animation-delay: .3s; }

.wc-form { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px 8px;
  border-top: 1px solid var(--wc-line); background: #fff; }
.wc-form textarea { flex: 1; min-width: 0; max-height: 96px; margin: 0; padding: 10px 12px; resize: none;
  border: 1px solid var(--wc-line); border-radius: 12px; background: #fff; color: var(--wc-ink);
  font: inherit; font-size: 16px; line-height: 1.4; outline: none; overflow-y: hidden; }
.wc-form textarea:focus { border-color: var(--wc-pri); }
.wc-form button { flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--wc-pri); color: #fff; display: grid; place-items: center; }
.wc-form button:disabled { opacity: .45; cursor: default; }
.wc-form button svg { width: 18px; height: 18px; }
.wc-note { flex: none; margin: 0; padding: 0 12px 10px; background: #fff; color: var(--wc-mute); font-size: 11.5px; text-align: center; }

@keyframes wc-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes wc-dot { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 768px) {
  .wc-btn { right: 8px; bottom: 70px; width: 68px; height: 68px; }
  .wc-teaser { right: 84px; bottom: 101px; }
  .wc.is-open .wc-btn { display: none; }
  .wc-panel { right: 0; left: 0; bottom: 0; width: auto; max-width: none; height: 88vh; height: 88dvh; max-height: none;
    border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wc-btn, .wc-panel, .wc-teaser, .wc-chips, .wc-typing i, .rb-body, .rb-eyes, .rb-ant { animation: none !important; transition: none; }
}
