.nbefc-as, .nbefc-as * { box-sizing: border-box; }
.nbefc-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; }
.nbefc-as button { font-family: inherit; }
.nbefc-as-toggle { display: inline-flex; align-items: center; gap: 10px; background: #4D5F72; color: #ffffff; border: none; border-radius: 40px; padding: 15px 24px; font-size: 1em; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(77,95,114,0.35); transition: background 0.2s ease, transform 0.2s ease; }
.nbefc-as-toggle:hover { background: #3d4d5c; transform: translateY(-2px); }
.nbefc-as-toggle svg { width: 20px; height: 20px; flex: 0 0 20px; }
.nbefc-as-toggle:focus-visible, .nbefc-as-close:focus-visible, .nbefc-as-send:focus-visible, .nbefc-as-input:focus-visible { outline: 3px solid #2BB7B3; outline-offset: 2px; }
.nbefc-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 #e5e7eb; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(17,24,39,0.18); display: none; flex-direction: column; }
.nbefc-as.is-open .nbefc-as-panel { display: flex; }
.nbefc-as-strip { height: 5px; flex: 0 0 5px; background: linear-gradient(90deg, #2BB7B3, #F2C14E, #F08A4B, #E86A92, #8E6AA8); }
.nbefc-as-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 12px; border-bottom: 1px solid #e5e7eb; flex: 0 0 auto; }
.nbefc-as-title { margin: 0; font-size: 1.05em; font-weight: 700; color: #4D5F72; line-height: 1.3; }
.nbefc-as-sub { margin: 2px 0 0; font-size: 0.78em; color: #6b7280; line-height: 1.4; }
.nbefc-as-close { background: none; border: none; color: #6b7280; font-size: 1.5em; line-height: 1; cursor: pointer; padding: 0 4px; }
.nbefc-as-close:hover { color: #111827; }
.nbefc-as-log { flex: 1 1 auto; overflow-y: auto; padding: 16px 16px 8px; background: #f8f9fa; }
.nbefc-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; }
.nbefc-as-msg.bot { white-space: normal; }
.nbefc-as-msg.bot p { margin: 0 0 10px; padding: 0; font-size: 1em; line-height: 1.55; color: inherit; }
.nbefc-as-msg.bot ul { margin: 4px 0 10px; padding: 0 0 0 18px; list-style: disc; }
.nbefc-as-msg.bot li { margin: 0 0 7px; padding: 0; font-size: 1em; line-height: 1.5; color: inherit; }
.nbefc-as-msg.bot p:last-child, .nbefc-as-msg.bot ul:last-child, .nbefc-as-msg.bot li:last-child { margin-bottom: 0; }
.nbefc-as-msg.bot ul:last-child li:last-child { margin-bottom: 0; }
.nbefc-as-msg.bot { background: #ffffff; color: #111827; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.nbefc-as-msg.user { background: #4D5F72; color: #ffffff; margin-left: auto; border-bottom-right-radius: 4px; }
.nbefc-as-msg a { color: #4D5F72; font-weight: 600; text-decoration: underline; }
.nbefc-as-msg.user a { color: #ffffff; }
.nbefc-as-typing { display: inline-flex; gap: 4px; align-items: center; }
.nbefc-as-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9ca3af; animation: nbefc-as-dot 1.2s infinite ease-in-out; }
.nbefc-as-typing span:nth-child(2) { animation-delay: 0.15s; }
.nbefc-as-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes nbefc-as-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.nbefc-as-form { display: flex; gap: 8px; padding: 12px 14px 8px; border-top: 1px solid #e5e7eb; background: #ffffff; flex: 0 0 auto; margin: 0; }
.nbefc-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; }
.nbefc-as-input:focus { outline: 2px solid #4D5F72; outline-offset: 1px; border-color: #4D5F72; }
.nbefc-as-send { flex: 0 0 auto; background: #4D5F72; color: #ffffff; border: none; border-radius: 8px; padding: 0 16px; font-size: 0.92em; font-weight: 600; cursor: pointer; transition: background 0.2s ease; }
.nbefc-as-send:hover { background: #3d4d5c; }
.nbefc-as-send:disabled { background: #9ca3af; cursor: default; }
.nbefc-as-foot { padding: 0 14px 12px; background: #ffffff; font-size: 0.78em; color: #6b7280; text-align: center; flex: 0 0 auto; }
.nbefc-as-foot a { color: #4D5F72; font-weight: 600; text-decoration: none; }
.nbefc-as a:hover { text-decoration: underline; }
.nbefc-as.nbefc-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; }
.nbefc-as-embed .nbefc-as-toggle, .nbefc-as-embed .nbefc-as-close { display: none; }
.nbefc-as-embed .nbefc-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) {
    .nbefc-as { right: 16px; bottom: 16px; }
    .nbefc-as-toggle { padding: 14px 18px; }
    .nbefc-as-panel { position: fixed; left: 12px; right: 12px; top: 12px; bottom: 82px; width: auto; max-width: none; height: auto; max-height: none; }
    .nbefc-as-input { font-size: 16px; }
}
@media (max-width: 600px) {
    .nbefc-as.nbefc-as-embed { padding: 0; right: auto; bottom: auto; }
    .nbefc-as-embed .nbefc-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 { .nbefc-as { display: none; } }
