.inbgc-as, .inbgc-as * { box-sizing: border-box; }
.inbgc-as { position: fixed; right: 22px; bottom: 22px; z-index: 99999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; line-height: 1.5; font-size: 16px; }
.inbgc-as button { font-family: inherit; }
.inbgc-as-toggle { display: inline-flex; align-items: center; gap: 10px; background: #1a2942; color: #ffffff; border: none; border-radius: 40px; padding: 15px 24px; font-size: 1em; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(26,41,66,0.35); transition: background 0.2s ease, transform 0.2s ease; }
.inbgc-as-toggle:hover { background: #25364D; transform: translateY(-2px); }
.inbgc-as-toggle svg { width: 20px; height: 20px; flex: 0 0 20px; }
.inbgc-as-toggle:focus-visible, .inbgc-as-close:focus-visible, .inbgc-as-send:focus-visible, .inbgc-as-input:focus-visible { outline: 3px solid #b89968; outline-offset: 2px; }
.inbgc-as-panel { position: absolute; right: 0; bottom: 70px; width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 120px); background: #ffffff; border: 1px solid #e4dccb; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(17,24,39,0.18); display: none; flex-direction: column; }
.inbgc-as.is-open .inbgc-as-panel { display: flex; }
.inbgc-as-strip { height: 5px; flex: 0 0 5px; background: #b89968; }
.inbgc-as-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid #e4dccb; flex: 0 0 auto; }
.inbgc-as-title { margin: 0; font-family: 'ltc-caslon-pro', Georgia, 'Times New Roman', serif; font-size: 1.05em; font-weight: 700; color: #1a2942; line-height: 1.3; }
.inbgc-as-sub { margin: 2px 0 0; font-size: 0.78em; color: #6b7280; line-height: 1.4; }
.inbgc-as-close { background: none; border: none; color: #6b7280; font-size: 1.5em; line-height: 1; cursor: pointer; padding: 0 4px; }
.inbgc-as-close:hover { color: #111827; }
.inbgc-as-log { flex: 1 1 auto; overflow-y: auto; padding: 16px 16px 8px; background: #fbf8f1; }
.inbgc-as-msg { max-width: 88%; margin: 0 0 10px; padding: 10px 13px; border-radius: 12px; font-size: 0.92em; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
.inbgc-as-msg.bot { white-space: normal; }
.inbgc-as-msg.bot p { margin: 0 0 10px; padding: 0; font-size: 1em; line-height: 1.55; color: inherit; }
.inbgc-as-msg.bot ul { margin: 4px 0 10px; padding: 0 0 0 18px; list-style: disc; }
.inbgc-as-msg.bot li { margin: 0 0 7px; padding: 0; font-size: 1em; line-height: 1.5; color: inherit; }
.inbgc-as-msg.bot p:last-child, .inbgc-as-msg.bot ul:last-child, .inbgc-as-msg.bot li:last-child { margin-bottom: 0; }
.inbgc-as-msg.bot ul:last-child li:last-child { margin-bottom: 0; }
.inbgc-as-msg.bot { background: #ffffff; color: #111827; border: 1px solid #e4dccb; border-bottom-left-radius: 4px; }
.inbgc-as-msg.user { background: #1a2942; color: #ffffff; margin-left: auto; border-bottom-right-radius: 4px; }
.inbgc-as-msg a { color: #1a2942; font-weight: 600; text-decoration: underline; }
.inbgc-as-msg.user a { color: #ffffff; }
.inbgc-as-typing { display: inline-flex; gap: 4px; align-items: center; }
.inbgc-as-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: inbgc-as-dot 1.2s infinite ease-in-out; }
.inbgc-as-typing span:nth-child(2) { animation-delay: 0.15s; }
.inbgc-as-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes inbgc-as-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.inbgc-as-form { display: flex; gap: 8px; padding: 12px 14px 8px; border-top: 1px solid #e4dccb; background: #ffffff; flex: 0 0 auto; margin: 0; }
.inbgc-as-input { flex: 1 1 auto; resize: none; min-height: 44px; max-height: 120px; padding: 11px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-family: inherit; font-size: 0.92em; color: #111827; background: #ffffff; line-height: 1.4; }
.inbgc-as-input:focus { outline: 2px solid #1a2942; outline-offset: 1px; border-color: #1a2942; }
.inbgc-as-send { flex: 0 0 auto; background: #1a2942; color: #ffffff; border: none; border-radius: 8px; padding: 0 16px; font-size: 0.92em; font-weight: 600; cursor: pointer; transition: background 0.2s ease; }
.inbgc-as-send:hover { background: #25364D; }
.inbgc-as-send:disabled { background: #9ca3af; cursor: default; }
.inbgc-as-foot { padding: 0 14px 12px; background: #ffffff; font-size: 0.78em; color: #6b7280; text-align: center; flex: 0 0 auto; }
.inbgc-as-foot a { color: #1a2942; font-weight: 600; text-decoration: none; }
.inbgc-as a:hover { text-decoration: underline; }
.inbgc-as.inbgc-as-embed { position: static; right: auto; bottom: auto; min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.inbgc-as-embed .inbgc-as-toggle, .inbgc-as-embed .inbgc-as-close { display: none; }
.inbgc-as-embed .inbgc-as-panel { position: relative; right: auto; bottom: auto; display: flex; width: 100%; max-width: 720px; height: calc(100vh - 48px); height: calc(100dvh - 48px); max-height: 820px; }
@media (max-width: 600px) {
    .inbgc-as { right: 16px; bottom: 16px; }
    .inbgc-as-toggle { padding: 14px 18px; }
    .inbgc-as.is-open { right: 0; bottom: 0; left: 0; top: 0; }
    .inbgc-as.is-open .inbgc-as-toggle { display: none; }
    .inbgc-as-panel { position: fixed; left: 0; right: 0; top: var(--inbgc-top, 0px); bottom: auto; width: 100%; max-width: none; height: var(--inbgc-vh, 100vh); height: var(--inbgc-vh, 100dvh); max-height: none; border-radius: 0; border: none; box-shadow: none; }
    .inbgc-as-head { padding: 12px 14px 10px; align-items: center; }
    .inbgc-as-close { font-size: 2em; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
    .inbgc-as-log { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .inbgc-as-msg { max-width: 94%; }
    .inbgc-as-form { padding: 10px 12px 6px; }
    .inbgc-as-foot { padding: 0 12px calc(10px + env(safe-area-inset-bottom)); }
    .inbgc-as-input { font-size: 16px; }
}
html.inbgc-as-lock, html.inbgc-as-lock body { overflow: hidden; }
@media (max-width: 600px) {
    .inbgc-as.inbgc-as-embed { padding: 0; right: auto; bottom: auto; }
    .inbgc-as-embed .inbgc-as-panel { position: relative; left: auto; right: auto; top: auto; bottom: auto; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; border: none; }
}
@media print { .inbgc-as { display: none; } }

.inbgc-as-note { display: block; margin-top: 4px; font-size: 0.92em; color: #6b7280; }
