.mister-chatbot {
    width: 100%;
    box-sizing: border-box;
}

.mister-chatbot *,
.mister-chatbot *::before,
.mister-chatbot *::after {
    box-sizing: border-box;
}

.mister-chatbot-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    text-align: left;
}

.mister-chatbot-info p {
  margin: 0;
}

.mister-chatbot-info svg {
    flex: 0 0 auto;
}

.mister-chatbot-box {
    width: 100%;
    border: 1px solid gray;
    border-radius: 10px;
    padding: 8px;
    transition: border-color 0.15s ease;
}

.mister-chatbot-box.is-replying {
    border-color: transparent !important;
}

.mister-chatbot-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.mister-chatbot-content {
    position: relative;
    width: 100%;
    min-width: 200px;
}

.mister-chatbot-textarea {
    display: block;
    width: 100%;
    min-height: 42px;
    max-height: 300px;
    padding: 10px 12px;
    margin: 0;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    resize: none;
    overflow-y: hidden;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    font-family: inherit;
}

.mister-chatbot-textarea:disabled {
    color: gray;
    cursor: not-allowed;
}

.mister-chatbot-textarea::placeholder {
    color: #64748b;
}

.mister-chatbot-waiting {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    margin-top: 4px;
    font-size: 14px;
}

.mister-chatbot-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #dbeafe;
    border-top-color: #0F6BB1;
    border-radius: 50%;
    animation: mister-chatbot-spin 0.8s linear infinite;
    flex: 0 0 auto;
}

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

.mister-chatbot-answer {
    padding-left: 10px;
    padding-right: 5px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.55;
    color: #334155;
    overflow-wrap: anywhere;
}

.mister-chatbot-answer:empty {
    display: none;
}

.mister-chatbot-answer p {
    margin: 0 0 8px;
}

.mister-chatbot-answer p:last-child {
    margin-bottom: 0;
}

.mister-chatbot-answer ul,
.mister-chatbot-answer ol {
    margin: 8px 0;
    padding-left: 22px;
}

.mister-chatbot-answer code {
    padding: 2px 4px;
    border-radius: 4px;
    background: #f1f5f9;
}

.mister-chatbot-answer pre {
    overflow-x: auto;
    padding: 10px;
    border-radius: 6px;
    background: #f1f5f9;
}

.mister-chatbot-counter {
    margin-top: 4px;
    padding-right: 5px;
    text-align: right;
    font-size: 12px;
    color: #64748b;
}

.mister-chatbot-button-wrapper {
    flex: 0 0 auto;
}

.mister-chatbot-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0F6BB1;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.mister-chatbot-button:hover {
    background: #25314D;
}

.mister-chatbot-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.mister-chatbot-button svg {
    width: 20px;
    height: 20px;
}

.mister-chatbot-sources {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 10px;
}

.mister-chatbot-source {
    align-items: flex-start;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mister-chatbot-source:hover {
    border-color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mister-chatbot-source-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mister-chatbot-source-favicon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.mister-chatbot-source-title {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mister-chatbot-source-title a {
    color: inherit;
    text-decoration: none;
}

.mister-chatbot-source-title a:hover {
    text-decoration: underline;
}

.mister-chatbot-source-description {
    margin-top: 8px;
    line-height: 1.5;
}

.mister-chatbot-privacy {
    padding-top: 10px;
    font-size: 14px;
}

.mister-chatbot-privacy a {
    color: inherit;
}

.mister-chatbot-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    font-size: 14px;
}
