/* Song Law Firm AI Chatbot — widget styles
 * Brand: K90 #0E1A2B · Burgundy #7A2E3B · Gold #C9A86B
 */
#slf-chatbot-bubble {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 2147483645;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #7A2E3B 0%, #9B4452 100%);
  color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  display: grid; place-items: center;
  transition: transform .2s, background .2s;
  padding: 0;
}
#slf-chatbot-bubble:hover { transform: scale(1.08); }
#slf-chatbot-bubble.open { background: #0E1A2B; }
#slf-chatbot-bubble .slf-cb-icon { font-size: 28px; line-height: 1; }

#slf-chatbot-panel {
  position: fixed; bottom: 96px; right: 24px;
  z-index: 2147483646;
  width: 380px; height: 600px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.25);
  display: none; flex-direction: column;
  overflow: hidden;
  font-family: 'Noto Sans KR', 'Malgun Gothic', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  color: #0E1A2B;
}
#slf-chatbot-panel.open { display: flex; }

.slf-cb-head {
  background: #0E1A2B; color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.slf-cb-head .slf-cb-mark {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg,#7A2E3B,#9B4452);
  display: grid; place-items: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700; font-size: 16px; color: #fff;
}
.slf-cb-head-txt { flex: 1; }
.slf-cb-title { font-weight: 700; font-size: 13px; }
.slf-cb-status {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px; letter-spacing: .1em; color: #C9A86B;
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.slf-cb-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #C9A86B;
  animation: slfcbpulse 2s infinite;
}
@keyframes slfcbpulse {
  0% { box-shadow: 0 0 0 0 rgba(201,168,107,.6); }
  70% { box-shadow: 0 0 0 6px rgba(201,168,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(201,168,107,0); }
}
.slf-cb-close {
  background: transparent; border: 0; color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
}
.slf-cb-close:hover { background: rgba(255,255,255,.1); }

.slf-cb-chat {
  flex: 1; overflow-y: auto;
  padding: 16px 12px;
  background: #fff;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.slf-cb-chat::-webkit-scrollbar { width: 0; }

.slf-cb-msg {
  max-width: 84%;
  font-size: 13px; line-height: 1.5;
  word-break: keep-all;
  white-space: pre-wrap;
  animation: slfcbin .25s ease;
}
@keyframes slfcbin {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.slf-cb-msg.bot {
  align-self: flex-start;
  background: #F2F4F7; color: #0E1A2B;
  padding: 10px 14px;
  border-radius: 18px 18px 18px 4px;
}
.slf-cb-msg.user {
  align-self: flex-end;
  background: #0E1A2B; color: #fff;
  padding: 10px 14px;
  border-radius: 18px 18px 4px 18px;
}
.slf-cb-msg.warn {
  background: #fdeaea; border: 1px solid #e9b5b1;
  color: #5a1812;
  align-self: stretch; max-width: 100%;
  border-radius: 12px; padding: 12px 14px;
  font-weight: 500;
}
.slf-cb-msg.notice {
  background: #fef7e6; border: 1px solid #e8d4a0;
  color: #5a4310;
  align-self: stretch; max-width: 100%;
  border-radius: 12px; padding: 12px 14px;
}
.slf-cb-msg.free, .slf-cb-msg.ok {
  background: #e8f5ee; border: 1px solid #b8dcc8;
  color: #1e4532;
  align-self: stretch; max-width: 100%;
  border-radius: 12px; padding: 12px 14px;
  font-weight: 500;
}
.slf-cb-msg.sys {
  align-self: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 9px; letter-spacing: .08em;
  text-transform: uppercase;
  color: #4A5A75;
  background: #F2F4F7;
  padding: 4px 10px; border-radius: 999px;
}

.slf-cb-choices {
  padding: 8px 12px 12px;
  display: flex; flex-wrap: wrap; gap: 6px;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #D8DDE4;
}

.slf-cb-chip {
  border: 1px solid #D8DDE4;
  background: #fff; color: #0E1A2B;
  padding: 9px 13px; border-radius: 999px;
  font: 600 12px/1 'Noto Sans KR', sans-serif;
  cursor: pointer; transition: all .15s;
}
.slf-cb-chip:hover { background: #0E1A2B; color: #fff; border-color: #0E1A2B; }
.slf-cb-chip.danger {
  background: #A8352A; color: #fff; border-color: #A8352A;
}
.slf-cb-chip.method {
  flex: 1 1 30%;
  padding: 12px 10px;
  text-align: center;
  flex-direction: column;
  display: flex;
  gap: 3px;
  align-items: center;
  font-size: 12px;
}
.slf-cb-chip.method .icon { font-size: 16px; }
.slf-cb-chip.faq { flex: 1 1 100%; text-align: left; padding: 10px 13px; }

.slf-cb-input-row {
  display: flex; gap: 8px; width: 100%;
}
.slf-cb-input-row input {
  flex: 1;
  border: 1px solid #D8DDE4; border-radius: 999px;
  padding: 10px 14px;
  font: 400 13px 'Noto Sans KR', sans-serif;
  background: #fff; color: #0E1A2B;
  outline: none;
}
.slf-cb-input-row input:focus { border-color: #7A2E3B; }
.slf-cb-input-row button {
  border: 0; background: #0E1A2B; color: #fff;
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; font-size: 16px;
}

/* Mobile — fullscreen panel */
@media (max-width: 640px) {
  #slf-chatbot-panel {
    bottom: 0; right: 0;
    width: 100vw; height: 100vh;
    max-width: 100vw; max-height: 100vh;
    border-radius: 0;
  }
  #slf-chatbot-bubble { bottom: 16px; right: 16px; }
}

/* Dark mode (follow system) */
@media (prefers-color-scheme: dark) {
  #slf-chatbot-panel {
    background: #141E30; color: #F2F4F7;
  }
  .slf-cb-chat { background: #141E30; }
  .slf-cb-msg.bot { background: #1A2335; color: #F2F4F7; }
  .slf-cb-choices { background: #141E30; border-top-color: #2E3A52; }
  .slf-cb-chip { background: #1A2335; color: #F2F4F7; border-color: #2E3A52; }
  .slf-cb-input-row input { background: #1A2335; color: #F2F4F7; border-color: #2E3A52; }
}
