/* 큐 chat widget for the landing page. Self-contained: scoped to .qchat, own light/dark tokens. */
.qchat {
  --q-bg: #ffffff; --q-surface: #f6f7f9; --q-text: #14171c; --q-muted: #5b6472; --q-line: #e4e7ec;
  --q-me: #c2410c; --q-me-text: #ffffff; --q-orange: #ff6600; --q-shadow: 0 12px 40px rgba(20, 23, 28, .18);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  .qchat { --q-bg: #1a1e24; --q-surface: #111418; --q-text: #eef0f3; --q-muted: #9aa3b2; --q-line: #2b313a;
           --q-me: #ff8a3d; --q-me-text: #111418; --q-shadow: 0 12px 40px rgba(0, 0, 0, .5); color-scheme: dark; }
}
.qchat-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit;
}
.qchat-launcher img {
  width: 64px; height: 64px; border-radius: 50%; box-shadow: var(--q-shadow); transition: transform .2s;
  animation: qchat-bob 3.2s ease-in-out infinite;
}
.qchat-launcher:hover img, .qchat-launcher:focus-visible img { transform: scale(1.06); }
.qchat-hint {
  background: var(--q-bg); color: var(--q-text); border: 1px solid var(--q-line); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 600; box-shadow: var(--q-shadow); white-space: nowrap;
}
.qchat-hint b { color: var(--q-me); }
.qchat.open .qchat-launcher { display: none; }
@keyframes qchat-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.qchat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 51; width: min(380px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 40px)); display: none; flex-direction: column; overflow: hidden;
  background: var(--q-bg); color: var(--q-text); border: 1px solid var(--q-line); border-radius: 20px; box-shadow: var(--q-shadow);
}
.qchat.open .qchat-panel { display: flex; animation: qchat-in .22s cubic-bezier(.2, .7, .2, 1); }
@keyframes qchat-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.qchat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--q-line); }
.qchat-head img { width: 40px; height: 40px; border-radius: 50%; }
.qchat-head div { flex: 1; line-height: 1.3; }
.qchat-head strong { font-size: 16px; }
.qchat-head span { display: block; font-size: 12px; color: var(--q-muted); }
.qchat-close { border: 0; background: none; color: var(--q-muted); font-size: 22px; line-height: 1; padding: 6px 8px; cursor: pointer; border-radius: 8px; }
.qchat-close:hover { background: var(--q-surface); color: var(--q-text); }
.qchat-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--q-surface); }
.qchat-row { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.qchat-row img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.qchat-msg { padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.qchat-bot { background: var(--q-bg); border: 1px solid var(--q-line); border-bottom-left-radius: 4px; }
.qchat-me { align-self: flex-end; background: var(--q-me); color: var(--q-me-text); border-bottom-right-radius: 4px; max-width: 80%; }
.qchat-msg.pending { color: var(--q-muted); }
.qchat-msg.error { color: #b42318; }
.qchat-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.qchat-chips::-webkit-scrollbar { display: none; }
.qchat-chips[hidden] { display: none; }
.qchat-chips button {
  flex: none; border: 1px solid var(--q-line); background: var(--q-bg); color: var(--q-text); border-radius: 999px;
  padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.qchat-chips button:hover { border-color: var(--q-me); color: var(--q-me); }
.qchat-form { display: flex; gap: 8px; padding: 10px 12px; }
.qchat-form textarea {
  flex: 1; min-width: 0; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--q-line);
  background: var(--q-surface); color: var(--q-text); font: inherit; font-size: 15px; line-height: 1.4;
}
.qchat-form textarea:focus { outline: 2px solid var(--q-me); outline-offset: -1px; }
.qchat-form button {
  flex: none; border: 0; border-radius: 12px; padding: 0 16px; background: var(--q-me); color: var(--q-me-text);
  font: inherit; font-weight: 700; cursor: pointer;
}
.qchat-form button:disabled { opacity: .5; cursor: default; }
.qchat-note { margin: 0; padding: 0 14px 10px; font-size: 11px; color: var(--q-muted); text-align: center; }
@media (max-width: 600px) {
  .qchat-panel { inset: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
  .qchat-launcher { right: 14px; bottom: 14px; }
  .qchat-launcher img { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .qchat-launcher img, .qchat.open .qchat-panel { animation: none; } }
.qchat-msg.wait { border-color: var(--q-me); }
.qchat-form button { min-width: 64px; font-variant-numeric: tabular-nums; }
