.ai-feedback {
    --ai-feedback-accent: #4ed4f5;
    --ai-feedback-positive: #34d399;
    --ai-feedback-negative: #fb7185;
    width: min(560px, 80%);
    margin-top: 6px;
    color: #e2e8f0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-feedback__bar,
.ai-feedback-row,
.ai-feedback-prompt {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 4px 5px 4px 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.16);
    backdrop-filter: blur(8px);
}

.ai-feedback__prompt,
.ai-feedback-question,
.ai-feedback-label {
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.ai-feedback__actions,
.ai-feedback-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-feedback-vote {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ai-feedback-vote:hover:not(:disabled) {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.ai-feedback-vote[data-avaliacao="1"].is-selected,
.ai-feedback-vote[data-rating="1"].is-selected {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.15);
    color: var(--ai-feedback-positive);
}

.ai-feedback-vote[data-avaliacao="-1"].is-selected,
.ai-feedback-vote[data-rating="-1"].is-selected {
    border-color: rgba(251, 113, 133, 0.45);
    background: rgba(251, 113, 133, 0.15);
    color: var(--ai-feedback-negative);
}

.ai-feedback-vote:disabled {
    cursor: wait;
    opacity: 0.56;
}

.ai-feedback-vote:focus-visible,
.ai-feedback-details button:focus-visible,
.ai-feedback-details input:focus-visible + label,
.ai-feedback-details input:focus-visible + span,
.ai-feedback-details textarea:focus-visible {
    outline: 3px solid rgba(78, 212, 245, 0.38);
    outline-offset: 2px;
}

.ai-feedback-status {
    min-height: 16px;
    margin: 4px 4px 0 10px;
    color: #94a3b8;
    font-size: 0.7rem;
    line-height: 1.35;
}

.ai-feedback-status.is-success {
    color: #86efac;
}

.ai-feedback-status.is-error {
    color: #fda4af;
}

.ai-feedback-details {
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    background: #111c2b;
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.28);
}

.ai-feedback-details fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.ai-feedback-details legend {
    margin: 0 0 4px;
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 700;
}

.ai-feedback-details[hidden] {
    display: none !important;
}

.ai-feedback-details__title {
    margin: 0 0 4px;
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 700;
}

.ai-feedback-details__hint {
    margin: 0 0 12px;
    color: #94a3b8;
    font-size: 0.74rem;
}

.ai-feedback-reasons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 12px;
}

.ai-feedback-reason {
    position: relative;
}

.ai-feedback-reason input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.ai-feedback-reason span {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 0.73rem;
    line-height: 1.25;
    transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.ai-feedback-reason:hover span {
    border-color: #64748b;
    color: #ffffff;
}

.ai-feedback-reason input:checked + span {
    border-color: rgba(251, 113, 133, 0.72);
    background: rgba(251, 113, 133, 0.11);
    color: #fecdd3;
}

.ai-feedback-details label[for],
.ai-feedback-comment > span {
    display: block;
    margin-bottom: 6px;
    color: #cbd5e1;
    font-size: 0.74rem;
    font-weight: 600;
}

.ai-feedback-comment small {
    color: #7f8da1;
    font-weight: 500;
}

.ai-feedback-details textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    padding: 10px 11px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0f172a;
    color: #f8fafc;
    font: inherit;
    font-size: 0.8rem;
    line-height: 1.45;
}

.ai-feedback-details textarea::placeholder {
    color: #64748b !important;
}

.ai-feedback-details__footer,
.ai-feedback-detail-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.ai-feedback-cancel,
.ai-feedback-submit {
    min-height: 38px;
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ai-feedback-cancel {
    border: 1px solid #334155;
    background: transparent;
    color: #cbd5e1;
}

.ai-feedback-submit {
    border: 1px solid var(--ai-feedback-negative);
    background: var(--ai-feedback-negative);
    color: #26070d;
}

.ai-feedback-cancel:hover,
.ai-feedback-submit:hover {
    transform: translateY(-1px);
}

.ai-feedback-details button:disabled {
    cursor: wait;
    opacity: 0.62;
}

@media (max-width: 640px) {
    .ai-feedback {
        width: min(94%, 560px);
    }

    .ai-feedback__bar,
    .ai-feedback-row,
    .ai-feedback-prompt {
        min-height: 42px;
    }

    .ai-feedback-vote {
        width: 34px;
        height: 34px;
    }

    .ai-feedback-reasons {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-feedback *,
    .ai-feedback *::before,
    .ai-feedback *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
