/* In-context review (Epic 239) and review notifications (Epic 219).
   Strict site CSP: no inline styles; every visual state is a class. */

.rv-message { padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; font-size: 13px; }
.rv-message.error { color: var(--red); border-color: var(--red); }
.rv-message.info { color: var(--text); }
.rv-toolbar { margin: 8px 0 12px; font-size: 13px; color: var(--text-muted); }
.rv-hint { color: var(--text-muted); font-size: 13px; }
.rv-check { display: block; margin: 6px 0; font-size: 14px; }

.rv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rv-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-panel);
}
.rv-row-main { background: none; border: none; color: var(--text); text-align: left; cursor: pointer; flex: 1; font-size: 14px; padding: 0; }
.rv-row-main:hover { color: var(--text-head); }
.rv-row-meta { color: var(--text-muted); font-size: 12px; }
.rv-empty { color: var(--text-muted); font-size: 13px; padding: 6px 2px; }

.rv-badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); white-space: nowrap; }
.rv-badge.approved { color: var(--green); border-color: var(--green); }
.rv-badge.rejected, .rv-badge.changes_requested { color: var(--red); border-color: var(--red); }
.rv-badge.under_review, .rv-badge.resubmitted_under_review, .rv-badge.in_revision { color: var(--warning); border-color: var(--warning); }

.rv-prompt { margin-top: 8px; padding: 8px 12px; border: 1px solid var(--red); border-radius: 8px; background: var(--red-bg); font-size: 13px; }
.rv-prompt strong { color: var(--red); }

/* Overlay viewer */
.rv-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); z-index: 9000; display: none; align-items: center; justify-content: center; }
.rv-overlay.visible { display: flex; }
.rv-modal {
  background: var(--bg-panel); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  width: 94%; max-width: 1100px; height: 88vh; display: flex; flex-direction: column; overflow: hidden;
}
.rv-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.rv-head h2 { margin: 0 0 4px; font-size: 18px; color: var(--text-head); }
.rv-identity { color: var(--text-muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.rv-layout { display: flex; flex: 1; min-height: 0; }
.rv-scroll { flex: 1; overflow-y: auto; padding: 14px 18px; }
.rv-side { width: 300px; border-left: 1px solid var(--border); padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.rv-side h3 { margin: 0 0 6px; font-size: 14px; color: var(--text-head); }
.rv-line { display: flex; gap: 8px; align-items: flex-start; }
.rv-line-text { flex: 1; white-space: pre-wrap; word-break: break-word; line-height: 1.5; min-height: 1.5em; user-select: text; }
.rv-line-add { opacity: 0.4; background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--text-muted); cursor: pointer; font-size: 12px; }
.rv-line:hover .rv-line-add, .rv-line-add:focus { opacity: 1; }
.rv-thread { margin: 4px 0 10px 24px; padding-left: 10px; border-left: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: 6px; }
.rv-comment { font-size: 13px; background: var(--bg-panel-raised); border: 1px solid var(--border-dim); border-radius: 6px; padding: 6px 10px; }
.rv-comment-meta { color: var(--text-muted); font-size: 12px; }
.rv-comment-quote { color: var(--text-muted); font-style: italic; }
.rv-comment.flash-target { border-color: var(--accent); }
.rv-orphans { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 10px; }
.rv-composer textarea, .rv-edit textarea, .rv-decision textarea {
  width: 100%; min-height: 64px; box-sizing: border-box; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font: inherit;
}
.rv-actions { display: flex; gap: 8px; margin-top: 6px; }
.rv-index-item { background: none; border: none; color: var(--accent); cursor: pointer; text-align: left; padding: 2px 0; font-size: 13px; }
.rv-decision-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.rv-opt { text-align: left; }
.rv-opt.selected { border-color: var(--accent); background: var(--accent-bg); color: var(--text-head); }
.rv-opt:disabled { cursor: not-allowed; opacity: 0.75; }
.rv-error { color: var(--red); font-size: 13px; }
.rv-readonly-note { color: var(--text-muted); font-size: 13px; }

/* Notification bell + panel */
.rv-bell-wrap { position: relative; }
.rv-bell { position: relative; background: none; border: 1px solid var(--border); border-radius: 8px; color: var(--text); cursor: pointer; padding: 4px 8px; }
.rv-bell-count { position: absolute; top: -6px; right: -6px; background: var(--red); color: var(--on-accent); border-radius: 10px; font-size: 11px; padding: 0 5px; }
.rv-notif-panel {
  position: absolute; right: 0; top: 36px; width: 340px; max-height: 360px; overflow-y: auto; z-index: 8000;
  background: var(--bg-panel-raised); border: 1px solid var(--border); border-radius: 8px; padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.rv-notif-panel[hidden] { display: none; }
.rv-notif { display: block; width: 100%; text-align: left; background: none; border: 1px solid var(--border-dim); border-radius: 6px; color: var(--text); padding: 8px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.rv-notif.unread { border-color: var(--accent); }
.rv-notif-kind { font-size: 11px; text-transform: uppercase; color: var(--text-muted); }

/* ---- content revision / audit trail pages (Epics 2687, 2614, 5781) ---- */
/* Content review + audit trail pages. Tokens come from tokens.css; no inline styles anywhere. */
body { background: var(--bg); color: var(--text); font-family: system-ui, sans-serif; margin: 0; }
.rv-page { max-width: 72rem; margin: 1.5rem auto; padding: 0 1rem; }
h1, h2, h3, h4 { color: var(--text-head); }
.rv-layout { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.5rem; }
@media (max-width: 52rem) { .rv-layout { grid-template-columns: 1fr; } }
.rv-list, .rv-detail, .rv-panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.rv-form { display: grid; gap: .5rem; margin-bottom: 1rem; }
.rv-form label { display: grid; gap: .25rem; color: var(--text-muted); }
input, select, textarea { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: .4rem; font: inherit; }
button { background: var(--primary); color: #fff; border: 0; border-radius: 4px; padding: .45rem .8rem; font: inherit; cursor: pointer; }
button:hover { background: var(--primary-hover); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
button.rv-link { background: none; color: var(--info); padding: 0; text-decoration: underline; }
.rv-table { width: 100%; border-collapse: collapse; }
.rv-table th, .rv-table td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--border-dim); }
.rv-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-weight: 600; border: 2px solid currentColor; }
.rv-draft, .rv-none { color: var(--text-muted); }
.rv-under_review { color: var(--info); }
.rv-resubmitted { color: var(--info); border-style: double; }
.rv-approved { color: var(--success); }
.rv-rejected, .rv-changes_requested { color: var(--danger); }
.rv-in_revision { color: var(--warning); border-style: dashed; }
.rv-unavailable { color: var(--text-dim); border-style: dotted; }
.rv-marker { font-weight: 600; margin-left: .4rem; }
.rv-marker-current { color: var(--success); }
.rv-marker-superseded, .rv-marker-unknown { color: var(--text-muted); }
.rv-body { white-space: pre-wrap; background: var(--bg-deep); border: 1px solid var(--border-dim); border-radius: 4px; padding: .6rem; }
.rv-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.rv-tabs { display: flex; gap: .5rem; margin: 1rem 0 .5rem; }
.rv-message, .rv-field-error, .rv-feedback-error { color: var(--danger); min-height: 1.2em; }
.rv-notice { color: var(--text-muted); }
.rv-feedback-item { border-left: 3px solid var(--primary); padding: .25rem .6rem; margin: .5rem 0; }
.rv-feedback-none { color: var(--text-muted); font-style: italic; }
.rv-meta { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
.rv-toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; margin-bottom: 1rem; }
.rv-toolbar label { display: grid; gap: .25rem; color: var(--text-muted); }
.rv-report { background: var(--bg-deep); border: 1px solid var(--border-dim); border-radius: 4px; padding: .75rem; margin-top: 1rem; }
.rv-report .report-gap { border: 2px solid var(--warning); background: var(--warning-bg); padding: .5rem; margin: .5rem 0; }
.rv-report .report-nodata { color: var(--text-muted); font-style: italic; }

.rv-rev-line { white-space: pre-wrap; word-break: break-word; line-height: 1.5; min-height: 1.5em; }
.rv-anchor { background: var(--warning-bg, #fff3b0); color: inherit; border-radius: 2px; }
.rv-feedback-loose { color: var(--text-muted); }

/* Tenant activity: the global-staff byline (REQ-0442) */
.rv-badge.ta-staff { color: var(--accent); border-color: var(--accent); }
.rv-badge.ta-error { color: var(--red); border-color: var(--red); }
