/*
 * AI rewriter profile states shared by the proposing views (MFE-2627,
 * MFE-2637). Values are the final ones of the MFE-2613 handoff
 * (dist/styles.css, then dist/legacy-alignment.css, last rule wins).
 * Every class starts with rw-, so nothing here touches a view that does not
 * use it; the views only use it while AI_REWRITE_EDITVIEW_UI is on.
 */
:root {
    --rw-ready: #ffffff;
    --rw-rewriting: #ffe0b3;
    --rw-review: #ffc5c7;
    --rw-proposed: #4bb6c1;
    --rw-review-name: #a90329;
    --rw-premium: #684e00;
    --rw-premium-tile: #fff4b8;
    --rw-remarks: #feae61;
    --rw-source-bg: #e7f0f9;
    --rw-source-label: #002060;
    --rw-primary: #009c9c;
    --rw-outline: #00989d;
}

/* Profile surfaces: Compact card body, Edit profile panel, Question row. */
.rw-state-ready { background-color: var(--rw-ready) !important; }
.rw-state-rewriting { background-color: var(--rw-rewriting) !important; }
.rw-state-review { background-color: var(--rw-review) !important; }
.rw-state-proposed { background-color: var(--rw-proposed) !important; }
/* Copy Paste: Ready to propose is white too (MFE-2627 "live visual amendment",
   which wins over the handoff's light green). */
.rw-copy.rw-state-ready { background-color: var(--rw-ready) !important; }

/* Review-required tutor names (Compact), including outage profiles shown as review. */
.rw-name-review, .rw-name-review:hover, .rw-name-review:focus { color: var(--rw-review-name) !important; }

/* Premium is a star beside any state, never a background. */
.rw-star { color: var(--rw-premium) !important; text-shadow: none; font-weight: 700; }
.rw-tier-premium { background: var(--rw-premium-tile); color: var(--rw-premium); }

/* Legend */
.rw-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; margin: 7px 0; }
.rw-legend strong { color: #565c5c; font-weight: 400; }
.rw-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.rw-swatch { width: 9px; height: 9px; border: 1px solid #a8b1b8; border-radius: 0; display: inline-block; }
.rw-swatch.rw-ready { background: var(--rw-ready); }
.rw-swatch.rw-rewriting { background: var(--rw-rewriting); }
.rw-swatch.rw-review { background: var(--rw-review); }
.rw-swatch.rw-proposed { background: var(--rw-proposed); }

/* Contextual callouts: review (red edge) and rewriting (orange edge). */
.rw-callout {
    background: #fff; border: 1px solid #dee5e5; border-left: 4px solid #ff892d; border-radius: 4px;
    padding: 8px 10px; display: flex; gap: 9px; align-items: flex-start; flex-wrap: wrap; margin: 7px 0;
    font-family: Nunito, Arial, sans-serif; font-size: 12px; line-height: 1.4; color: #333;
}
.rw-callout.rw-callout-review { border-left-color: #db4653; }
.rw-callout strong { font-weight: 700; }
.rw-callout p { margin: 2px 0 0; }
.rw-callout > .rw-callout-text { flex: 1; min-width: 0; }
.rw-notice-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-left: auto; }

/* Buttons: one primary rewrite action, an outline approval beside it. */
.rw-btn { min-height: 25px; padding: 3px 7px; font-size: 13px; line-height: 1.25; border-radius: 3px; border: 1px solid #c2c2c2; background: #f7f7f7; cursor: pointer; }
.rw-btn:disabled { opacity: .55; cursor: not-allowed; }
.rw-btn-primary { background: var(--rw-primary); color: #fff; border-color: var(--rw-primary); }
.rw-btn-outline { background: transparent; color: var(--rw-outline); border: 1px solid var(--rw-outline); }
.rw-btn:focus-visible { outline: 2px solid #383d3d; outline-offset: 1px; }

/* Estimate timer and status icons (Ready View, Edit View rewriting callout). */
.rw-timer { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 1.15; color: #713607; font-weight: 700; }
.rw-timer small { display: block; font-weight: 400; }
.rw-icon { display: inline-block; width: 13px; text-align: center; font-style: normal; }

/* Edit View numbered navigation states. */
.rw-nav-number { min-width: 23px; min-height: 22px; font-size: 12px; padding: 2px 5px; border: 1px solid #719caf; border-radius: 3px; background: var(--rw-ready); color: #383d3d; }
.rw-nav-number.rw-state-rewriting { color: #713607; }
.rw-nav-number.rw-state-review { color: #641120; }
.rw-nav-number.rw-state-proposed { color: #143a40; }

@media (prefers-reduced-motion: reduce) {
    .rw-callout, .rw-timer { transition: none; }
}

/* MFE-2637 AC10: the AI rewriter outage banner (HANDOFF.md READY), red with the
   alert icon, Retry rewriting at its right edge. */
.rw-outage-banner { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 12px; }
.rw-outage-banner > .rw-icon { margin-top: 3px; color: #a90329; }
.rw-outage-banner > .rw-callout-text { flex: 1 1 auto; min-width: 0; }
.rw-outage-banner .rw-retry-error { color: #a90329; font-weight: 600; margin: 4px 0 0; }
.rw-ai-unavailable .rw-icon { color: #a90329; }
