/* 홈페이지 AI 상담사 '루아' 위젯 — site.css 토큰(--wl-*) 준수 */
.lua[hidden] { display: none; }

.lua {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 1000;
}

.lua__panel {
  width: 400px;
  height: min(700px, calc(100vh - 56px));
  background: var(--wl-white);
  border-radius: var(--wl-radius-card);
  border: 1px solid var(--wl-border);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--wl-font);
}

.lua__header {
  height: 64px;
  flex-shrink: 0;
  background: var(--wl-green-800);
  color: var(--wl-white);
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lua__who { display: flex; align-items: center; gap: 10px; min-width: 0; }

.lua__avatar {
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--wl-green-50);
}
.lua__avatar img { width: 36px; height: 36px; object-fit: cover; display: block; }

.lua__title { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.lua__title strong { font-size: 15px; font-weight: 800; }
.lua__title small { font-size: 12px; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lua__close {
  width: 40px; height: 40px; border: none; background: transparent; color: var(--wl-white);
  cursor: pointer; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
}
.lua__close:hover { background: rgba(255, 255, 255, 0.12); }

.lua__log {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  background: var(--wl-bg-subtle);
}

.lua__msg {
  max-width: 84%; padding: 11px 14px; font-size: 14.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere;
}
.lua__msg--bot {
  align-self: flex-start; background: var(--wl-white); color: var(--wl-text);
  border: 1px solid var(--wl-border); border-radius: 16px 16px 16px 4px;
}
.lua__msg--user {
  align-self: flex-end; background: var(--wl-green-800); color: var(--wl-white);
  border-radius: 16px 16px 4px 16px;
}
.lua__msg--bot a.lua__link {
  color: var(--wl-green-800); font-weight: 700; text-decoration: underline; text-underline-offset: 2px;
  word-break: break-all;
}
.lua__msg--bot a.lua__link:hover { color: var(--wl-green-500); }
.lua__msg--typing::after { content: '…'; animation: lua-blink 1s steps(1) infinite; }
@keyframes lua-blink { 50% { opacity: 0; } }

.lua__chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.lua__chip {
  border: 1.5px solid var(--wl-green-800); background: var(--wl-white); color: var(--wl-green-800);
  border-radius: 999px; padding: 7px 14px; font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.lua__chip:hover { background: var(--wl-green-50); }

.lua__card {
  align-self: flex-start; width: 92%; background: var(--wl-white); border: 1px solid var(--wl-green-300);
  border-radius: var(--wl-radius-card); padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.lua__card h4 { margin: 0; font-size: 13px; font-weight: 800; color: var(--wl-green-800); }
.lua__card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.lua__card dt { color: var(--wl-text-secondary); font-weight: 600; }
.lua__card dd { margin: 0; color: var(--wl-text); font-weight: 600; text-align: right; }
.lua__card input {
  width: 100%; height: 44px; border: 1px solid var(--wl-border); border-radius: var(--wl-radius-input);
  padding: 0 12px; font-family: inherit; font-size: 14px; color: var(--wl-text); background: var(--wl-white);
}
.lua__card input:focus { outline: 2px solid var(--wl-green-500); border-color: transparent; }
.lua__card input.error { border-color: var(--wl-danger); }
.lua__card .btn { height: 48px; font-size: 15px; cursor: pointer; border: none; font-family: inherit; }
.lua__card small { font-size: 12px; color: var(--wl-text-secondary); line-height: 1.5; }
.lua__card--done { border-color: var(--wl-green-500); background: var(--wl-green-50); }

.lua__form {
  flex-shrink: 0; display: flex; gap: 8px; padding: 10px 12px 12px; background: var(--wl-white);
  border-top: 1px solid var(--wl-divider);
}
.lua__input {
  flex: 1; height: 46px; border: 1px solid var(--wl-border); border-radius: 999px; padding: 0 16px;
  font-family: inherit; font-size: 14.5px; color: var(--wl-text); background: var(--wl-white);
}
.lua__input:focus { outline: 2px solid var(--wl-green-500); border-color: transparent; }
.lua__send {
  width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--wl-green-800); color: var(--wl-white);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lua__send:disabled { opacity: 0.5; cursor: default; }
.lua__notice {
  flex-shrink: 0; margin: 0; padding: 0 16px 10px; background: var(--wl-white);
  font-size: 11.5px; line-height: 1.5; color: var(--wl-text-secondary); text-align: center; word-break: keep-all;
}
.lua__notice a { color: inherit; text-decoration: underline; }

/* 런처 */
.lua-launcher {
  position: fixed; right: 28px; bottom: 28px; z-index: 999;
  height: 60px; display: inline-flex; align-items: center; gap: 10px; padding: 0 22px 0 12px;
  background: var(--wl-green-500); color: #0B0F0C; border: none; border-radius: 999px;
  font-family: var(--wl-font); font-size: 16px; font-weight: 900; cursor: pointer;
  box-shadow: 0 12px 32px rgba(93, 188, 73, 0.45);
  transition: transform .15s ease, background-color .15s ease;
}
.lua-launcher:hover { transform: translateY(-2px); background: #6fca5b; }
.lua-launcher img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--wl-white); display: block; }
body.lua-open .lua-launcher { display: none; }

@media (max-width: 768px) {
  .lua { inset: 0; }
  .lua__panel { width: 100%; height: 100%; border-radius: 0; border: none; transform-origin: top left; }
  body.lua-open { overflow: hidden; }
  .lua-launcher { right: 16px; bottom: 16px; height: 56px; font-size: 15px; }
}
