.ta-ai-assistant {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1050;
    font-family: "Rubik", sans-serif;
}

.ta-ai-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #e65307;
    box-shadow: 0 10px 28px rgba(38, 42, 46, .28);
    cursor: pointer;
    font-size: 24px;
}

.ta-ai-panel {
    display: none;
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    border: 1px solid #e8e8e8;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(28, 35, 42, .24);
}

.ta-ai-panel.is-open {
    display: flex;
    flex-direction: column;
}

.ta-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
    background: #263238;
}

.ta-ai-header strong,
.ta-ai-header small {
    display: block;
}

.ta-ai-header small {
    margin-top: 2px;
    color: #dce3e7;
    font-size: 11px;
}

.ta-ai-close {
    border: 0;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.ta-ai-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ta-ai-new-chat {
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 5px;
    padding: 5px 8px;
    color: #fff;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
}

.ta-ai-new-chat:hover,
.ta-ai-new-chat:focus {
    color: #263238;
    background: #fff;
}

.ta-ai-tabs {
    display: flex;
    border-bottom: 1px solid #eceff1;
}

.ta-ai-tab {
    flex: 1;
    padding: 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    color: #5d676d;
    background: #fff;
    cursor: pointer;
    font-weight: 500;
}

.ta-ai-tab.is-active {
    border-bottom-color: #e65307;
    color: #e65307;
}

.ta-ai-view {
    display: none;
    min-height: 0;
    flex: 1;
}

.ta-ai-view.is-active {
    display: flex;
    flex-direction: column;
}

.ta-ai-messages,
.ta-ai-recommendations {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f7f8f9;
}

.ta-ai-message {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: #28343a;
    background: #fff;
    box-shadow: 0 2px 7px rgba(38, 50, 56, .08);
    white-space: pre-wrap;
}

.ta-ai-message.is-user {
    margin-left: auto;
    color: #fff;
    background: #e65307;
}

.ta-ai-sources {
    display: block;
    margin-top: 7px;
    color: #6b757b;
    font-size: 10px;
}

.ta-ai-compose {
    padding: 12px;
    border-top: 1px solid #eceff1;
    background: #fff;
}

.ta-ai-compose textarea {
    width: 100%;
    min-height: 66px;
    resize: none;
    border: 1px solid #d7dde0;
    border-radius: 8px;
    padding: 9px 10px;
}

.ta-ai-compose-actions,
.ta-ai-recommendation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.ta-ai-hint {
    max-width: 245px;
    color: #7a858b;
    font-size: 10px;
}

.ta-ai-send,
.ta-ai-refresh {
    border: 0;
    border-radius: 6px;
    padding: 8px 13px;
    color: #fff;
    background: #e65307;
    cursor: pointer;
}

.ta-ai-send:disabled,
.ta-ai-refresh:disabled {
    cursor: wait;
    opacity: .65;
}

.ta-ai-recommendation-header {
    margin: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #eceff1;
    background: #fff;
}

.ta-ai-course {
    margin-bottom: 10px;
    padding: 12px;
    border-left: 3px solid #e65307;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 7px rgba(38, 50, 56, .08);
}

.ta-ai-course a {
    color: #263238;
    font-weight: 500;
}

.ta-ai-course p {
    margin: 6px 0 0;
    color: #647078;
    font-size: 12px;
}

.ta-ai-score {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 7px;
    border-radius: 10px;
    color: #a53800;
    background: #fff0e8;
    font-size: 11px;
}

@media (max-width: 575px) {
    .ta-ai-assistant {
        right: 16px;
        bottom: 16px;
    }

    .ta-ai-panel {
        position: fixed;
        right: 8px;
        bottom: 84px;
        left: 8px;
        width: auto;
        height: calc(100vh - 105px);
        max-width: none;
        max-height: none;
    }
}
