.nxt-chatbot {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1400;
    font-family: 'Roboto', sans-serif;
}

.nxt-chatbot-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #4faee0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 174, 224, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.nxt-chatbot-fab .material-icons {
    font-size: 26px;
    color: #fff;
}

.nxt-chatbot-fab:hover {
    background: #3A9BD0;
}

.nxt-chatbot-fab-open {
    background: #2E8FBF;
}

.nxt-chatbot-panel {
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 480px;
    max-height: calc(100vh - 100px);
    margin-bottom: 12px;
    background: #F4F6F8;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.nxt-chatbot-panel-expanded {
    width: 1880px;
    height: 790px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 190px);
}

.nxt-chatbot-header {
    background: #4faee0;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nxt-chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nxt-chatbot-header-icon {
    font-size: 22px !important;
    color: #fff !important;
    flex-shrink: 0;
}

.nxt-chatbot-title {
    font-size: 15px;
    font-weight: 500;
}

.nxt-chatbot-header-right {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.nxt-chatbot-header-action {
    border: none;
    background: transparent;
    color: #fff;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.nxt-chatbot-header-action .material-icons {
    font-size: 20px;
    color: #fff;
}

.nxt-chatbot-header-svg-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.nxt-chatbot-header-action:hover {
    background: rgba(255, 255, 255, 0.18);
}

.nxt-chatbot-header-action.nxt-chatbot-header-action-busy,
.nxt-chatbot-header-action.nxt-chatbot-header-action-busy:hover {
    background: transparent;
    cursor: default;
}

.nxt-chatbot-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.nxt-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
}

.nxt-chatbot-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100%;
    padding: 24px 20px;
    box-sizing: border-box;
}

.nxt-chatbot-welcome-icon-wrap {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.nxt-chatbot-welcome-icon {
    width: 72px;
    height: 72px;
    display: block;
}

.nxt-chatbot-welcome-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 10px;
    line-height: 1.35;
}

.nxt-chatbot-welcome-text {
    font-size: 13px;
    color: #6B7785;
    line-height: 1.5;
    max-width: 300px;
}

.nxt-chatbot-panel-expanded .nxt-chatbot-welcome-text {
    max-width: 420px;
}

.nxt-chatbot-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.nxt-chatbot-row-user {
    justify-content: flex-end;
}

.nxt-chatbot-row-assistant {
    justify-content: flex-start;
}

.nxt-chatbot-bubble {
    max-width: 85%;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
    min-height: 0;
    height: auto;
}

.nxt-chatbot-bubble-text {
    margin: 0;
    padding: 0;
    line-height: 1.3;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.nxt-chatbot-md {
    white-space: normal;
}

.nxt-chatbot-md > *:first-child {
    margin-top: 0;
}

.nxt-chatbot-md > *:last-child {
    margin-bottom: 0;
}

.nxt-chatbot-md p,
.nxt-chatbot-md ul,
.nxt-chatbot-md ol,
.nxt-chatbot-md pre,
.nxt-chatbot-md blockquote,
.nxt-chatbot-md table {
    margin: 0 0 8px;
}

.nxt-chatbot-md h1,
.nxt-chatbot-md h2,
.nxt-chatbot-md h3,
.nxt-chatbot-md h4 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.nxt-chatbot-md ul,
.nxt-chatbot-md ol {
    padding-left: 18px;
}

.nxt-chatbot-md li {
    margin: 0 0 2px;
}

.nxt-chatbot-md a {
    color: #2F6886;
    text-decoration: underline;
}

.nxt-chatbot-md code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    background: #F0F2F5;
    padding: 0 4px;
    border-radius: 3px;
}

.nxt-chatbot-md pre {
    background: #F0F2F5;
    border-radius: 6px;
    padding: 8px;
    overflow-x: auto;
}

.nxt-chatbot-md pre code {
    padding: 0;
    background: transparent;
}

.nxt-chatbot-md table {
    border-collapse: collapse;
    width: 100%;
    font-size: 12px;
}

.nxt-chatbot-md th,
.nxt-chatbot-md td {
    border: 1px solid #E1E6EB;
    padding: 4px 6px;
    text-align: left;
}

.nxt-chatbot-md th {
    background: #F0F2F5;
    font-weight: 600;
}

.nxt-chatbot-md blockquote {
    border-left: 3px solid #D0D7DE;
    padding-left: 8px;
    color: #6B7785;
}

.nxt-chatbot-bubble-user {
    background: #2F6886;
    color: #fff;
    border-radius: 0 8px 0 8px;
}

.nxt-chatbot-bubble-assistant {
    background: #fff;
    color: #1A1A1A;
    border: 1px solid #E1E6EB;
    border-radius: 8px 0 8px 0;
    max-width: 95%;
}

.nxt-chatbot-bubble-error {
    border-color: #F5C2C7;
    color: #842029;
    background: #F8D7DA;
}

.nxt-chatbot-typing {
    color: #6B7785;
    font-style: italic;
}

.nxt-chatbot-footer {
    background: #F4F6F8;
    border-top: 1px solid #E1E6EB;
}

.nxt-chatbot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 6px;
}

.nxt-chatbot-action-btn {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 6px;
    border: 1px solid #D0D7DE;
    border-radius: 8px;
    background: #fff;
    color: #1A1A1A;
    font-size: 11px;
    line-height: 1.2;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
}

.nxt-chatbot-panel-expanded .nxt-chatbot-actions {
    gap: 8px;
    padding: 10px 12px 8px;
}

.nxt-chatbot-panel-expanded .nxt-chatbot-action-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    padding: 8px 12px;
    font-size: 12px;
    gap: 6px;
}

.nxt-chatbot-panel-expanded .nxt-chatbot-action-btn .material-icons,
.nxt-chatbot-panel-expanded .nxt-chatbot-action-btn .nxt-chatbot-action-svg {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.nxt-chatbot-action-btn .material-icons,
.nxt-chatbot-action-btn .nxt-chatbot-action-svg {
    font-size: 18px;
    color: #4faee0;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nxt-chatbot-action-btn .nxt-chatbot-action-svg {
    display: block;
}

.nxt-chatbot-action-btn span {
    text-align: left;
}

.nxt-chatbot-action-btn:hover:not(:disabled):not(.nxt-chatbot-action-btn-active) {
    border-color: #4faee0;
    background: #F7FBFE;
}

.nxt-chatbot-action-btn:disabled,
.nxt-chatbot-action-btn.nxt-chatbot-action-btn-busy {
    opacity: 0.55;
    cursor: default;
}

.nxt-chatbot-action-btn.nxt-chatbot-action-btn-active,
.nxt-chatbot-action-btn.nxt-chatbot-action-btn-active:disabled {
    background: #2F6886;
    border-color: #2F6886;
    color: #fff;
    opacity: 1;
    cursor: default;
}

.nxt-chatbot-action-btn.nxt-chatbot-action-btn-active .material-icons,
.nxt-chatbot-action-btn.nxt-chatbot-action-btn-active .nxt-chatbot-action-svg {
    color: #fff;
}

.nxt-chatbot-action-btn.nxt-chatbot-action-btn-active .nxt-chatbot-action-svg {
    filter: brightness(0) invert(1);
}

.nxt-chatbot-composer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #fff;
    border-top: 1px solid #E1E6EB;
}

.nxt-chatbot-input {
    flex: 1;
    border: 1px solid #D0D7DE;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 18px;
    height: 40px;
    outline: none;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    box-sizing: border-box;
}

.nxt-chatbot-input:focus {
    border-color: #2F6886;
}

.nxt-chatbot-input:disabled {
    background: #F0F2F5;
}

.nxt-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #4faee0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
}

.nxt-chatbot-send .material-icons {
    font-size: 20px;
    color: #fff;
}

.nxt-chatbot-send:disabled {
    background: #C5D0DA;
    cursor: not-allowed;
}

.nxt-chatbot-send-busy,
.nxt-chatbot-send-busy:disabled {
    background: #4faee0;
    cursor: default;
}

.nxt-chatbot-send-busy .nxt-chatbot-send-icon {
    visibility: hidden;
}

.nxt-chatbot-send-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nxt-chatbot-spin 0.8s linear infinite;
    display: none;
    box-sizing: border-box;
    position: absolute;
}

.nxt-chatbot-send-busy .nxt-chatbot-send-spinner {
    display: block;
}

@keyframes nxt-chatbot-spin {
    to {
        transform: rotate(360deg);
    }
}

.nxt-chatbot-selected-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    background: #E8F4FB;
    border-bottom: 1px solid #E1E6EB;
    font-size: 12px;
    color: #2F6886;
}

.nxt-chatbot-selected-text-clear {
    border: none;
    background: transparent;
    color: #2F6886;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}

.nxt-chatbot-inspect-hint {
    margin-top: 8px;
    background: #2F6886;
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: auto;
    max-width: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.nxt-chatbot-inspect-cancel {
    border: none;
    background: #fff;
    color: #2F6886;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

body.nxt-chatbot-inspecting,
body.nxt-chatbot-inspecting * {
    cursor: copy !important;
}

.nxt-chatbot-inspect-overlay {
    position: fixed;
    pointer-events: none;
    z-index: 1390;
    box-sizing: border-box;
    border: 2px solid #4faee0;
    background: rgba(79, 174, 224, 0.12);
    display: none;
}

@media (max-width: 480px) {
    .nxt-chatbot {
        left: 12px;
        bottom: 12px;
    }

    .nxt-chatbot-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 90px);
    }

    .nxt-chatbot-panel-expanded {
        width: calc(100vw - 24px);
        height: calc(100vh - 90px);
    }

    .nxt-chatbot-action-btn {
        flex: 1 1 100%;
    }
}
