#tauria-ai-admin-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--tauria-primary, #007bff);
    color: white;
    font-size: 24px;
    text-align: center;
    line-height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 999999;
    border: 0;
}

#tauria-ai-admin-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: min(380px, calc(100vw - 40px));
    background: white;
    border-radius: 10px;
    box-shadow: 0 14px 42px rgb(0 0 0 / 22%);
    z-index: 99999;
    border: 1px solid #cfcfcf;
    overflow: hidden;
}

.chat-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    background-color: #01b701;
    border-radius: 50%;
}

#chat-header {
    background: #ffffff;
    color: #000000;
    padding: 16px 18px 14px;
    border-bottom: 1px solid #dfdfdf;
    position: relative;
}

.chat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.chat-header-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

#chat-menu-toggle,
#chat-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    color: #000000;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

#chat-menu-toggle {
    font-size: 34px;
    font-weight: 700;
}

#chat-menu {
    position: absolute;
    top: 58px;
    right: 54px;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid #dedede;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 20%);
    padding: 6px;
    z-index: 2;
}

#chat-menu[hidden] {
    display: none;
}

#chat-new,
#chat-delete {
    display: block;
    width: 100%;
    background: transparent;
    border: 0;
    color: #222;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    text-align: left;
}

#chat-new:hover,
#chat-delete:hover {
    background: #f3f3f3;
}

#chat-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 24px 18px;
    height: 400px;
    scrollbar-width: thin;
    scrollbar-color: #c7c7c7 transparent;
}

#chat-body::-webkit-scrollbar {
    width: 6px;
}

#chat-body::-webkit-scrollbar-track {
    background: transparent;
}

#chat-body::-webkit-scrollbar-thumb {
    background-color: #c7c7c7;
    border-radius: 3px;
}

#chat-body::-webkit-scrollbar-thumb:hover {
    background-color: #aaaaaa;
}

#chat-input-container {
    display: flex;
    padding: 12px 14px 6px;
    gap: 10px;
    border-top: 1px solid #dedede;
    align-items: center;
}

.ai-message {
    margin-top: 10px;
    background: #ededed;
    padding: 14px 16px;
    border-radius: 8px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-message a {
    color: var(--tauria-primary, #007bff);
    text-decoration: underline;
    word-break: break-all;
}

div#chat-input-container input#chat-input {
    width: 100%;
    height: 48px;
    border-radius: 6px;
    padding: 0 14px;
    border: 1px solid #cfcfcf;
    font-family: inherit;
    font-size: 16px;
    color: #111;
}

div#chat-input-container input#chat-input::placeholder {
    color: #111;
    opacity: 1;
}
.user-message {
    background: var(--tauria-primary, #007bff);
    text-align: left;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    margin-top: 15px;
    width: fit-content;
    color: white;
}

span#chat-title {
    display: block;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.ai-message.error {
    background: var(--tauria-primary, #007bff);
    padding: 8px;
    margin-bottom: 10px;
    text-align: left;
    color: white;
    border-radius: 5px;
    border-bottom-left-radius: 0px;
}
button#chat-send {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    background: #ffffff;
    color: var(--tauria-primary, #007bff);
    border: 3px solid #cfcfcf;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

button#chat-send svg {
    display: block;
}

#chat-send:disabled { opacity: .6; cursor: wait; }
#chat-status { min-height: 0; padding: 0 14px; font-size: 13px; color: #555; }
#chat-privacy { padding: 0 14px 10px; font-size: 10px; color: #666; line-height: 1.25; }
#chat-privacy a { color: inherit; text-decoration: underline; }
.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.hidden {
    display: none;
}

.typing-message {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto;
    min-width: 54px;
}

.typing-message span {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #777;
    animation: tauriaTyping 1.15s infinite ease-in-out;
}

.typing-message span:nth-child(2) { animation-delay: .15s; }
.typing-message span:nth-child(3) { animation-delay: .3s; }

.confirm-message {
    white-space: normal;
}

.chat-confirm-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.chat-confirm-actions button {
    border: 1px solid #d9e3f2;
    border-radius: 6px;
    padding: 7px 10px;
    cursor: pointer;
    background: #fff;
}

.chat-confirm-actions button.danger {
    background: var(--tauria-primary, #007bff);
    border-color: var(--tauria-primary, #007bff);
    color: #fff;
}

@keyframes tauriaTyping {
    0%, 80%, 100% { transform: translateY(0); opacity: .45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

@media (max-width: 480px) {
    #tauria-ai-admin-chatbot {
        right: 10px; bottom: 10px; width: calc(100vw - 20px); max-height: calc(100vh - 20px);
    }
    #chat-body { height: min(400px, calc(100vh - 190px)); }
    #chat-input-container { padding: 12px 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    #tauria-ai-admin-chatbot, #tauria-ai-admin-button { scroll-behavior: auto; }
    .typing-message span { animation: none; }
}
