/* Moona — myTauliah Melaka public chatbot widget (bottom-right) */
#moona-root {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 2147483000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

#moona-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    border-radius: 999px;
    padding: 12px 18px 12px 12px;
    background: linear-gradient(135deg, #0f5c3d, #12805a);
    color: #fff;
    box-shadow: 0 10px 24px rgba(15, 92, 61, 0.35);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease;
}

#moona-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 92, 61, 0.42);
}

#moona-toggle .moona-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
}

#moona-panel {
    position: fixed;
    right: 20px;
    bottom: 92px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 500px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#moona-panel[hidden] {
    display: none;
}

.moona-header {
    background: linear-gradient(135deg, #0f5c3d, #12805a);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.moona-header .moona-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
}

.moona-header-text {
    flex: 1;
    min-width: 0;
}

.moona-header-text strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.moona-header-text span {
    display: block;
    font-size: 11.5px;
    opacity: .85;
    line-height: 1.3;
}

.moona-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    flex: none;
}

.moona-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.moona-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f4f7f6;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.moona-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.moona-msg.bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e3e8e6;
    color: #23312b;
    border-bottom-left-radius: 3px;
}

.moona-msg.user {
    align-self: flex-end;
    background: #12805a;
    color: #fff;
    border-bottom-right-radius: 3px;
}

.moona-msg.typing {
    align-self: flex-start;
    opacity: .65;
    font-style: italic;
}

.moona-suggestions {
    padding: 0 14px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f4f7f6;
}

.moona-suggestion {
    border: 1px solid #cfe0d8;
    background: #fff;
    color: #0f5c3d;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
}

.moona-suggestion:hover {
    background: #e9f4ef;
}

.moona-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e6e9e8;
    background: #fff;
}

.moona-form textarea {
    flex: 1;
    resize: none;
    border: 1px solid #d7ddda;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 13.5px;
    font-family: inherit;
    max-height: 80px;
}

.moona-form textarea:focus {
    outline: none;
    border-color: #12805a;
}

.moona-send {
    border: none;
    background: #12805a;
    color: #fff;
    border-radius: 10px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.moona-send:disabled {
    opacity: .6;
    cursor: default;
}

@media (max-width: 420px) {
    #moona-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 84px;
    }

    #moona-root {
        right: 12px;
        bottom: 12px;
    }
}
