﻿.tutor-ia {
    --tutor-primary: #f27922;
    --tutor-primary-dark: #c7560f;
    --tutor-ink: #202733;
    --tutor-muted: #6c7480;
    --tutor-border: #d9dde3;
    --tutor-surface: #ffffff;
    --tutor-soft: #f5f7fa;
    bottom: 22px;
    font-family: Arial, Helvetica, sans-serif;
    position: fixed;
    right: 24px;
    z-index: 99999;
}

.tutor-ia * {
    box-sizing: border-box;
}

.tutor-ia__launcher {
    align-items: center;
    background: #fff;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 12px 26px rgba(31, 38, 50, .22);
    color: #fff;
    cursor: pointer;
    display: none;
    height: 79px;
    justify-content: center;
    width: 79px;
}

.tutor-ia__launcher-image {
    border-radius: 50%;
    display: block;
    height: 79px;
    object-fit: cover;
    width: 79px;
}

.tutor-ia__teaser {
    align-items: flex-start !important;
    background: #fff !important;
    border: 1px solid var(--tutor-border) !important;
    border-radius: 8px !important;
    bottom: 92px !important;
    box-shadow: 0 12px 28px rgba(31, 38, 50, .16) !important;
    color: var(--tutor-ink) !important;
    cursor: pointer !important;
    display: none !important;
    gap: 10px !important;
    max-width: 360px !important;
    min-width: 300px !important;
    padding: 12px 14px !important;
    position: absolute !important;
    right: 0 !important;
    width: max-content !important;
}

.tutor-ia__teaser:after {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
    bottom: -8px;
    content: "";
    position: absolute;
    right: 19px;
}

.tutor-ia__teaser--visible {
    display: flex !important;
}

.tutor-ia__teaser-text {
    display: block !important;
    flex: 1 1 auto !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    max-width: 310px !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
}

.tutor-ia__teaser-close {
    background: transparent;
    border: 0;
    color: var(--tutor-muted);
    cursor: pointer;
    flex: 0 0 auto !important;
    font-size: 14px !important;
    line-height: 1 !important;
    padding: 0 !important;
    width: auto !important;
}

.tutor-ia__panel {
    background: var(--tutor-surface);
    border: 1px solid var(--tutor-border);
    border-radius: 8px;
    box-shadow: 0 20px 46px rgba(31, 38, 50, .2);
    display: flex;
    flex-direction: column;
    height: 560px;
    max-height: calc(100vh - 56px);
    overflow: hidden;
    width: 380px;
}

.tutor-ia__header {
    align-items: center;
    background: #232a34;
    color: #fff;
    display: flex;
    justify-content: space-between;
    min-height: 62px;
    padding: 14px 16px;
}

.tutor-ia__title {
    display: block;
    font-size: 15px;
    letter-spacing: 0;
}

.tutor-ia__subtitle {
    color: rgba(255, 255, 255, .7);
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

.tutor-ia__minimize {
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    height: 32px;
    line-height: 1;
    width: 34px;
}

.tutor-ia__messages {
    background: var(--tutor-soft);
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.tutor-ia__message {
    clear: both;
    margin-bottom: 12px;
}

.tutor-ia__bubble {
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.45;
    max-width: 94%;
    padding: 10px 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tutor-ia__message--bot .tutor-ia__bubble {
    background: #fff;
    border: 1px solid var(--tutor-border);
    color: var(--tutor-ink);
}

.tutor-ia__message--user {
    display: flex;
    justify-content: flex-end;
}

.tutor-ia__message--user .tutor-ia__bubble {
    background: var(--tutor-primary);
    color: #fff;
}

.tutor-ia__typing {
    align-items: center;
    color: var(--tutor-muted) !important;
    display: inline-flex;
    gap: 7px;
    font-style: italic;
    max-width: none;
    white-space: nowrap;
}

.tutor-ia__typing-dots {
    display: inline-flex;
    gap: 3px;
}

.tutor-ia__typing-dots i {
    animation: tutorTypingPulse 1.1s infinite ease-in-out;
    background: var(--tutor-primary);
    border-radius: 50%;
    display: block;
    height: 5px;
    opacity: .35;
    width: 5px;
}

.tutor-ia__typing-dots i:nth-child(2) {
    animation-delay: .16s;
}

.tutor-ia__typing-dots i:nth-child(3) {
    animation-delay: .32s;
}

@keyframes tutorTypingPulse {
    0%, 80%, 100% {
        opacity: .3;
        transform: translateY(0);
    }

    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.tutor-ia__inline-link {
    background: #fff3eb;
    border: 1px solid rgba(242, 121, 34, .26);
    border-radius: 4px;
    color: var(--tutor-primary-dark);
    display: inline;
    font-weight: 700;
    line-height: 1.7;
    padding: 1px 4px;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.tutor-ia__inline-link:hover {
    background: #ffe6d3;
    border-color: rgba(242, 121, 34, .55);
    color: var(--tutor-primary);
    text-decoration: none;
}

.tutor-ia__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 14px;
}

.tutor-ia__chip,
.tutor-ia__action {
    background: #fff;
    border: 1px solid var(--tutor-border);
    border-radius: 6px;
    color: var(--tutor-ink);
    cursor: pointer;
    font-size: 12px;
    padding: 7px 9px;
    text-decoration: none;
}

.tutor-ia__chip:hover,
.tutor-ia__action:hover {
    border-color: var(--tutor-primary);
    color: var(--tutor-primary-dark);
    text-decoration: none;
}

.tutor-ia__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    max-width: 94%;
    width: 94%;
}

.tutor-ia__action {
    display: block;
    line-height: 1.35;
    overflow-wrap: anywhere;
    width: 100%;
}

.tutor-ia__form {
    background: #fff;
    border-top: 1px solid var(--tutor-border);
    display: flex;
    gap: 8px;
    padding: 12px;
}

.tutor-ia__input {
    border: 1px solid var(--tutor-border);
    border-radius: 6px;
    color: var(--tutor-ink);
    flex: 1;
    font-size: 13px;
    line-height: 1.35;
    max-height: 96px;
    min-height: 42px;
    padding: 9px 10px;
    resize: vertical;
}

.tutor-ia__input:focus {
    border-color: var(--tutor-primary);
    box-shadow: 0 0 0 2px rgba(242, 121, 34, .14);
    outline: 0;
}

.tutor-ia__send {
    background: var(--tutor-primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    min-width: 76px;
    padding: 0 14px;
}

.tutor-ia__send:disabled {
    cursor: wait;
    opacity: .7;
}

.tutor-ia--closed .tutor-ia__panel {
    display: none;
}

.tutor-ia--closed .tutor-ia__launcher {
    display: flex;
}

@media (max-width: 520px) {
    .tutor-ia {
        bottom: 12px;
        left: 12px;
        right: 12px;
    }

    .tutor-ia__panel {
        height: calc(100vh - 24px);
        width: 100%;
    }

    .tutor-ia__launcher {
        margin-left: auto;
    }

    .tutor-ia__teaser {
        max-width: calc(100vw - 82px) !important;
        min-width: 240px !important;
        right: 0 !important;
        width: auto !important;
    }

    .tutor-ia__teaser-text {
        max-width: calc(100vw - 132px) !important;
    }
}

.tutor-ia__backdrop {
    backdrop-filter: blur(5px);
    background: rgba(15, 23, 42, .38);
    display: none;
    inset: 0;
    position: fixed;
    z-index: -1;
}

.tutor-ia__header-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.tutor-ia__maximize,
.tutor-ia__minimize {
    align-items: center;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 16px;
    height: 32px;
    justify-content: center;
    line-height: 1;
    width: 34px;
}

.tutor-ia__copy {
    align-items: center;
    align-self: flex-end;
    background: #fff;
    border: 1px solid var(--tutor-border);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(31, 38, 50, .08);
    color: var(--tutor-muted);
    cursor: pointer;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    gap: 5px;
    line-height: 1;
    margin-top: 5px;
    padding: 6px 9px;
    text-align: right;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.tutor-ia__message--user .tutor-ia__copy {
    align-self: flex-end;
}

.tutor-ia__copy-icon {
    font-size: 13px;
    line-height: 1;
}

.tutor-ia__copy:hover,
.tutor-ia__copy--done {
    background: #fff7f1;
    border-color: rgba(242, 121, 34, .45);
    box-shadow: 0 6px 14px rgba(242, 121, 34, .12);
    color: var(--tutor-primary-dark);
}

.tutor-ia--maximized {
    bottom: auto;
    left: 0;
    right: auto;
    top: 0;
    z-index: 100000;
}

.tutor-ia--maximized .tutor-ia__backdrop {
    display: block;
}

.tutor-ia--maximized .tutor-ia__panel {
    border-radius: 10px;
    height: min(760px, calc(100vh - 64px));
    left: 50%;
    max-height: calc(100vh - 64px);
    max-width: calc(100vw - 64px);
    position: fixed;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(980px, calc(100vw - 64px));
    z-index: 1;
}

.tutor-ia--maximized .tutor-ia__messages {
    padding: 22px 26px;
}

.tutor-ia--maximized .tutor-ia__bubble,
.tutor-ia--maximized .tutor-ia__actions {
    max-width: 78%;
}

@media (max-width: 720px) {
    .tutor-ia--maximized .tutor-ia__panel {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
        max-width: 100vw;
        width: 100vw;
    }

    .tutor-ia--maximized .tutor-ia__bubble,
    .tutor-ia--maximized .tutor-ia__actions {
        max-width: 94%;
    }
}

.tutor-ia__message {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
}

.tutor-ia__message--user {
    align-items: flex-end;
    justify-content: flex-start;
}


.tutor-ia__message-stack {
    align-items: flex-start;
    display: inline-flex;
    flex-direction: column;
    max-width: 94%;
}

.tutor-ia__message-row {
    align-items: flex-end;
    display: inline-flex;
    max-width: 100%;
}

.tutor-ia__message-row .tutor-ia__bubble {
    max-width: 100%;
}

.tutor-ia__message--user .tutor-ia__message-stack {
    align-items: flex-end;
}

.tutor-ia__message-tools {
    align-items: center;
    align-self: flex-end;
    display: inline-flex;
    gap: 5px;
    margin-top: 5px;
}

.tutor-ia__copy,
.tutor-ia__tool {
    align-items: center;
    background: #fff;
    border: 1px solid var(--tutor-border);
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(31, 38, 50, .08);
    color: var(--tutor-muted);
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 28px;
    font-size: 13px;
    height: 28px;
    justify-content: center;
    line-height: 1;
    margin-top: 0;
    padding: 0;
    text-align: center;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background-color .15s ease, box-shadow .15s ease;
    width: 28px;
}

.tutor-ia__copy-label {
    display: none;
}

.tutor-ia__copy-icon,
.tutor-ia__tool-icon {
    font-size: 14px;
    line-height: 1;
}

.tutor-ia__copy:hover,
.tutor-ia__copy--done,
.tutor-ia__tool:hover {
    background: #fff7f1;
    border-color: rgba(242, 121, 34, .45);
    box-shadow: 0 6px 14px rgba(242, 121, 34, .12);
    color: var(--tutor-primary-dark);
    text-decoration: none;
}

.tutor-ia--maximized .tutor-ia__message-stack {
    max-width: 78%;
}

@media (max-width: 720px) {
    .tutor-ia--maximized .tutor-ia__message-stack {
        max-width: 94%;
    }
}

.tutor-ia__tool-icon {
    display: block;
    fill: none;
    height: 15px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 15px;
}




.tutor-ia__feedback.tutor-ia__tool--selected {
    background: #ecfdf5;
    border-color: rgba(16, 185, 129, .45);
    color: #047857;
}

.tutor-ia__feedback--bad.tutor-ia__tool--selected {
    background: #fff7f1;
    border-color: rgba(242, 121, 34, .45);
    color: var(--tutor-primary-dark);
}

.tutor-ia__tool--sending {
    cursor: wait;
    opacity: .65;
}

.tutor-ia__feedback-form {
    align-self: stretch;
    background: #fff;
    border: 1px solid var(--tutor-border);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(31, 38, 50, .08);
    margin-top: 8px;
    padding: 10px;
    width: 100%;
}

.tutor-ia__feedback-help {
    color: var(--tutor-muted);
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 8px;
}

.tutor-ia__feedback-input {
    border: 1px solid var(--tutor-border);
    border-radius: 6px;
    color: var(--tutor-ink);
    font-size: 12px;
    line-height: 1.35;
    min-height: 70px;
    padding: 8px;
    resize: vertical;
    width: 100%;
}

.tutor-ia__feedback-input:focus {
    border-color: var(--tutor-primary);
    box-shadow: 0 0 0 2px rgba(242, 121, 34, .14);
    outline: 0;
}

.tutor-ia__feedback-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 8px;
}

.tutor-ia__feedback-submit,
.tutor-ia__feedback-close {
    border: 1px solid var(--tutor-border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 9px;
}

.tutor-ia__feedback-submit {
    background: var(--tutor-primary);
    border-color: var(--tutor-primary);
    color: #fff;
}

.tutor-ia__feedback-close {
    background: #fff;
    color: var(--tutor-muted);
}
