/* 우측 하단 문의 채팅 — customer·app 레이아웃 공용 */
.iru-chat {
  position: fixed;
  right: 20px;
  bottom: 28px;
  z-index: 45;
  font-size: 14px;
}
.iru-chat-launch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 56px;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-grad, var(--primary));
  color: var(--accent-ink, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 6px 16px rgba(0, 0, 0, .14);   /* 보라 빛 번짐 없이 무채색 그림자 */
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.iru-chat-launch:hover { transform: translateY(-1px); }
.iru-chat-launch svg { width: 24px; height: 24px; fill: currentColor; flex-shrink: 0; }
.iru-chat-launch span { font-weight: 700; letter-spacing: -.02em; }
.iru-chat.is-open .iru-chat-launch { border-radius: 50%; min-width: 56px; padding: 0; }
.iru-chat.is-open .iru-chat-launch span { display: none; }

.iru-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(360px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(25, 18, 38, .18);
  overflow: hidden;
}
.iru-chat-panel[hidden] { display: none !important; }

.iru-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  background: linear-gradient(180deg, var(--hero-from, var(--soft)) 0%, var(--surface) 100%);
  border-bottom: 1px solid var(--line-soft);
}
.iru-chat-kicker { margin: 0; font-size: 12px; color: var(--ink-3, var(--ink3)); }
.iru-chat-title { margin: 4px 0 0; font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.iru-chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2, var(--ink2));
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.iru-chat-close:hover { background: var(--soft); color: var(--ink); }

.iru-chat-body {
  flex: 1;
  padding: 14px 16px;
  overflow: auto;
}
.iru-chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.iru-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-tint, var(--soft));
  color: var(--primary);
  flex-shrink: 0;
}
.iru-chat-avatar svg { width: 18px; height: 18px; fill: currentColor; }
.iru-chat-msg p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--soft);
  color: var(--ink-2, var(--ink2));
  line-height: 1.55;
}

.iru-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.iru-chat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.iru-chat-chip:hover {
  border-color: var(--primary-line, var(--line));
  background: var(--primary-tint, var(--soft));
  color: var(--primary-strong, var(--primary));
}

.iru-chat-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.iru-chat-kakao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: #fee500;
  color: #191600;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.iru-chat-kakao svg,
.iru-chat-kakao .iru-chat-kakao-ico { width: 22px; height: 22px; flex-shrink: 0; }
.iru-chat-kakao svg { fill: currentColor; }
.iru-chat-note { margin: 0; font-size: 14px; color: var(--ink-3, var(--ink3)); line-height: 1.5; }

.iru-chat--m {
  right: 14px;
  bottom: calc(24px + env(safe-area-inset-bottom));
}
/* 아래 5탭이 있는 휴대폰 화면(공개 customer.m · 회원 앱 틀 ap-m) — 탭 위로 */
body.m .iru-chat--m {
  bottom: calc(86px + env(safe-area-inset-bottom));
}
.iru-chat--m .iru-chat-launch {
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}
.iru-chat--m .iru-chat-launch span { display: none; }
.iru-chat--m .iru-chat-launch svg { width: 22px; height: 22px; }
.iru-chat--m .iru-chat-panel {
  bottom: calc(100% + 10px);
  width: min(340px, calc(100vw - 28px));
}

@media (min-width: 641px) {
  .iru-chat-launch span { display: inline; }
  .iru-chat.is-open .iru-chat-launch span { display: none; }
}

/* 회원 앱 틀(ap-body) — FAB 대신 같은 z-index 레이어 */
.ap-body .iru-chat { z-index: 50; }
/* 문의 버튼(화면 바닥에서 28~84px, 오른쪽)이 맨 아래까지 내렸을 때 바닥글 아래 줄(가+·라이트·다크)을 가리지 않게 바닥글 밑에 자리를 둔다 — PC 만(휴대폰은 아래 탭 위에 뜬다) */
@media (min-width: 861px) {
  body:not(.m) .iru-foot, body:not(.m) .ap-foot { padding-bottom: 104px; }
}
