.feedback-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(12px);
    overflow-y: auto;
    padding: 1.25rem;
    animation: feedback-fade-in 0.45s ease;
}

.feedback-overlay.is-hidden {
    display: none !important;
}

@keyframes feedback-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.feedback-warning {
    text-align: center;
    padding: 2rem 1rem;
}

.feedback-warning h1 {
    color: #fbbf24;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.feedback-warning p {
    color: #cbd5e1;
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

.feedback-grid--disabled .score-bar-row--disabled .score-bar-row__fill,
.overall-ring--disabled circle:last-of-type {
    opacity: 0.35;
}

.score-bar-row--disabled .score-bar-row__head span:last-child {
    color: #94a3b8;
}

.feedback-shell {
    max-width: 1100px;
    margin: 0 auto 2rem;
}

.feedback-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.feedback-header h1 {
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin: 0 0 0.35rem;
}

.feedback-header p {
    color: #c4b5fd;
    margin: 0;
}

.feedback-generating {
    text-align: center;
    padding: 4rem 1rem;
    color: #e9d5ff;
}

.feedback-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(167, 139, 250, 0.25);
    border-top-color: #a78bfa;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: feedback-spin 0.9s linear infinite;
}

@keyframes feedback-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.feedback-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 900px) {
    .feedback-grid--scores {
        grid-template-columns: 280px 1fr;
    }
    .feedback-grid--two {
        grid-template-columns: 1fr 1fr;
    }
}

.feedback-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(49, 46, 129, 0.25);
}

.feedback-card h2 {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overall-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 1rem;
}

.overall-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.overall-ring__label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.overall-ring__value {
    font-size: 2rem;
    font-weight: 800;
}

.overall-ring__text {
    font-size: 0.75rem;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.score-bar-row {
    margin-bottom: 0.85rem;
}

.score-bar-row__head {
    display: flex;
    justify-content: space-between;
    color: #e5e7eb;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.score-bar-row__track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.score-bar-row__fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    width: 0;
    transition: width 1s ease;
}

.feedback-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feedback-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.feedback-list li:last-child {
    border-bottom: none;
}

.feedback-list--strengths li::before {
    content: "✔";
    color: #4ade80;
}

.feedback-list--improve li::before {
    content: "⚠";
    color: #fbbf24;
}

.feedback-list--tips li::before {
    content: "→";
    color: #a78bfa;
}

.feedback-narrative {
    color: #e5e7eb;
    line-height: 1.7;
    font-size: 0.95rem;
}

.correction-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
}

.correction-card__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.correction-card__original {
    color: #fca5a5;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.correction-card__improved {
    color: #86efac;
    font-size: 0.9rem;
}

.transcript-thread {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 360px;
    overflow-y: auto;
}

.transcript-turn {
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
}

.transcript-turn--ai {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(139, 92, 246, 0.25));
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.transcript-turn--user {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-left: 1.5rem;
}

.transcript-turn__role {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #c4b5fd;
    margin-bottom: 0.25rem;
}

.transcript-turn--user .transcript-turn__role {
    color: #94a3b8;
}

.transcript-turn__text {
    color: #f1f5f9;
    font-size: 0.88rem;
    line-height: 1.5;
    margin: 0;
}

.feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.feedback-btn {
    border: none;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feedback-btn:hover {
    transform: translateY(-1px);
}

.feedback-btn--primary {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.feedback-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feedback-meta {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}
