/* AI 안내 — 오른쪽 아래 상주 (chat.js 가 마크업을 넣는다) */
.chat { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(max(20px, env(safe-area-inset-bottom, 0px)) + var(--chat-lift, 0px)); z-index: 60; font-family: var(--sans); }
.chat__fab { display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--blue); color: #fff;
  cursor: pointer; box-shadow: 0 8px 22px rgba(49, 88, 230, .35); transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s; }
.chat__fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(49, 88, 230, .42); }
.chat__fab:active { transform: scale(.96); }
.chat__fab:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.chat.is-inv .chat__fab { background: #fff; color: var(--blue); box-shadow: 0 8px 22px rgba(11, 35, 71, .28); }
.chat__fab { transition: transform .2s cubic-bezier(.22, 1, .36, 1), box-shadow .2s, background .25s, color .25s; }
.chat__face { width: 46px; height: 46px; overflow: visible; }
.chat__eyes { transform-origin: 24px 21px; animation: chat-blink 4.5s infinite; }
.chat__mouth { transition: d .2s; }
.chat__fab:hover .chat__mouth { d: path("M18 29q6 7 12 0"); }
@keyframes chat-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.chat.is-open .chat__fab { display: none; }
.chat__panel { position: absolute; right: 0; bottom: 0; width: min(392px, calc(100vw - 40px)); height: min(600px, calc(100dvh - 120px));
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 48px rgba(14, 24, 40, .18); overflow: hidden;
  animation: chat-in .22s cubic-bezier(.22, 1, .36, 1); }
.chat__panel[hidden] { display: none; }
@keyframes chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.chat__hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.chat__h { font: 700 16px/1.3 var(--sans); color: var(--ink); }
.chat__sub { margin-top: 3px; font-size: 14px; color: var(--ink-3); }
.chat__x { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.chat__x:hover { background: var(--tint); }
.chat__x svg { width: 18px; height: 18px; }
.chat__log { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.chat__msg { max-width: 88%; font-size: 15px; line-height: 1.6; color: var(--ink); }
.chat__msg p + p { margin-top: 6px; }
.chat__msg--bot { align-self: flex-start; padding: 12px 14px; background: var(--tint); border-radius: 4px 14px 14px 14px; }
.chat__msg--me { align-self: flex-end; padding: 10px 14px; background: var(--blue); color: #fff; border-radius: 14px 4px 14px 14px; }
.chat__text { white-space: pre-line; }
.chat__src { font-size: 12px; color: var(--ink-3); }
.chat__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chat__go { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 17px; background: #fff;
  font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; }
.chat__go:hover { border-color: var(--ink-3); }
.chat__go.is-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.chat__wait { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); }
.chat__wait b { font-weight: 500; }
.chat__wait button { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--blue-ink); text-decoration: underline; cursor: pointer; }
.chat__dots { display: inline-flex; gap: 3px; }
.chat__dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3); animation: chat-dot 1s infinite ease-in-out; }
.chat__dots i:nth-child(2) { animation-delay: .15s; } .chat__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.chat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 12px; }
.chat__chips[hidden] { display: none; }
.chat__chips button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 17px; background: #fff; font: 500 13px/1.3 var(--sans); color: var(--ink-2); cursor: pointer; text-align: left; }
.chat__chips button:hover { border-color: var(--blue); color: var(--blue-ink); }
.chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 12px 12px 18px; border-top: 1px solid var(--line); }
.chat__form textarea { flex: 1; resize: none; border: 0; outline: 0; padding: 8px 0; max-height: 120px; font: 15px/1.5 var(--sans); color: var(--ink); background: none; }
.chat__send { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; cursor: pointer; }
.chat__send:hover { background: var(--blue-ink); }
.chat__send svg { width: 20px; height: 20px; }
.chat button:focus-visible, .chat a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 560px) {
  .chat__fab { width: 54px; height: 54px; }
  .chat__face { width: 42px; height: 42px; }
  .chat__panel { position: fixed; inset: auto 0 0 0; width: 100%; height: min(86dvh, 640px); border-radius: 16px 16px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .chat__eyes { animation: none; } .chat__fab { transition: none; } .chat__panel { animation: none; } .chat__dots i { animation: none; opacity: .6; } }
@media print { .chat { display: none; } }
