/* PathKEY v5.1 — the reviewer space (TR-UI, docs/v51-translation-review.md 5.3, 5.4).
 * Classes .rv-; the frame is app.js's data-layout="review".
 * The protections here are deterrence, not prevention (0.4): nothing in CSS
 * stops a screenshot. */

/* ---------------------------------------------------------- the frame --- */
.app[data-layout="review"] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.app[data-layout="review"] textarea,
.app[data-layout="review"] input { -webkit-user-select: text; user-select: text; }
.rv-top { gap: var(--sp-3); }
.rv-top .brand-lockup-img { display: block; height: 36px; width: auto; }
.rv-top .appbar-product { margin-left: 0; }
.rv-work { padding: var(--sp-6) var(--gutter, 24px) var(--sp-10); }
.rv-page { max-width: 1180px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-4); }

/* --------------------------------------------------------- the header --- */
.rv-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sp-3) var(--sp-6); }
.rv-head-text { flex: 1 1 240px; min-width: 0; }
.rv-head h1 { margin: 0; }
.rv-muted { color: var(--text-muted); font-size: var(--fs-13); margin: 0; }
.rv-lang { display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-13); color: var(--text-muted); }
.rv-lang .select { min-width: 180px; }
.rv-progress { margin: 0; color: var(--text-2); font-size: var(--fs-14); white-space: nowrap; }
.rv-progress .num { font-weight: var(--fw-semibold); color: var(--text); }

/* ----------------------------------------------------------- the item --- */
.rv-item { display: flex; flex-direction: column; gap: var(--sp-3); }
.rv-context { margin: 0; font-size: var(--fs-13); color: var(--text-eyebrow); font-weight: var(--fw-medium); }
.rv-panes {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-4);
  padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-16); background: var(--bg-surface);
  overflow: hidden; color: var(--text);
}
.rv-pane { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.rv-pane-title { margin: 0; font-size: var(--fs-13); font-weight: var(--fw-semibold); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.rv-en { display: block; width: 100%; color: var(--text); font-family: inherit; pointer-events: none; }
.rv-en-was { opacity: .8; }
.rv-was { margin: var(--sp-2) 0 0; font-size: var(--fs-13); color: var(--warn-text, var(--text-2)); }
.rv-draft { min-height: 160px; font-size: var(--fs-16, 16px); line-height: 1.5; resize: vertical; }
.rv-draft.is-invalid { border-color: var(--crit); }
.rv-meta { margin: 0; font-size: var(--fs-12); color: var(--text-muted); }
.rv-note { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0; font-size: var(--fs-13); color: var(--text-2); }
.rv-note .icon { flex: none; margin-top: 2px; color: var(--icon); }

/* The watermark overlay (5.4 item 5): over both panes, never in the way. */
.rv-mark { position: absolute; inset: 0; pointer-events: none; color: var(--text); z-index: 2; }
/* Without the overlay the text is not shown (checked each second by review.js). */
.rv-panes.rv-nomark > .rv-pane { visibility: hidden; }

/* Hidden while the window is not in front (5.4 item 6). */
.rv-panes.rv-veiled > .rv-pane { visibility: hidden; }
.rv-veil {
  position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-3); padding: var(--sp-6); text-align: center; background: var(--bg-surface);
}
.rv-veil p { margin: 0; max-width: 420px; color: var(--text-2); }

.rv-tools { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.rv-size { display: inline-flex; gap: var(--sp-1); }
.rv-notice { display: flex; gap: var(--sp-2); align-items: center; margin: 0; font-size: var(--fs-13); color: var(--highlight-strong-text, var(--text)); }
.rv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
/* TRF1 (UX-8): the Approve shortcut, quiet; touch screens have no keyboard to show it for. */
.rv-kbd { font-size: var(--fs-12, 12px); color: var(--text-3, var(--text-2)); }
@media (pointer: coarse) { .rv-kbd { display: none; } }

/* ----------------------------------------------------- states, pages --- */
.rv-state { padding: var(--sp-8) 0; }
.rv-idle { max-width: 420px; display: flex; flex-direction: column; gap: var(--sp-3); }
.rv-idle h2 { margin: 0; font-size: var(--fs-18, 18px); }
.rv-help-text { margin: 0; max-width: 70ch; line-height: 1.6; }
/* TRF3 (UX-5): the other languages with texts waiting, under "All done for now". */
.rv-others { list-style: none; margin: var(--sp-4) auto 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; }
.rv-others li { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-3); color: var(--text-2); }

/* ------------------------------------------------------------- phones --- */
@media screen and (max-width: 767px) {
  .rv-panes { grid-template-columns: minmax(0, 1fr); }
  .app[data-layout="review"] .rv-rail { display: block; position: static; width: auto; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .app[data-layout="review"] .rv-body { flex-direction: column; background: none; }
  .rv-rail .rail-scroll { padding: var(--sp-2) var(--sp-3); }
  .rv-rail .nav-heading { display: none; }
  .rv-rail .nav-list { flex-direction: row; }
  /* TRF3 (UX-11): the rail's words show on a phone (two bare icons said nothing). */
  .app[data-layout="review"] .rv-rail .nav-label { display: inline; }
  .app[data-layout="review"] .rv-rail .nav-item { width: auto; height: 40px; margin: 0; padding: 0 var(--sp-3); justify-content: flex-start; gap: var(--sp-2); }
  .rv-top .appbar-product { display: none; }
}

/* ------------------------------------------------------------ print --- */
/* Printing is off while the review frame is mounted (5.4 item 4). */
@media print {
  body:has(.app[data-layout="review"]) * { display: none !important; }
  body:has(.app[data-layout="review"])::after { content: "Printing is turned off on this page."; display: block; padding: 24px; font: 16px/1.5 system-ui, sans-serif; }
}

/* ------------------------------------------- v5.2: Studio › Languages --- */
.lng-page { display: flex; flex-direction: column; gap: var(--sp-5); }
.lng-run { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); }
.lng-run progress { width: 100%; accent-color: var(--accent); }
.lng-reason { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-3) var(--sp-4); color: var(--text-2); font-size: var(--fs-13); }
.lng-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lng-person { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.lng-person:first-child { border-top: 0; }
.lng-rv-langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-1) var(--sp-3); border: 0; padding: 0; margin: var(--sp-3) 0 0; }
@media (max-width: 640px) {
  .lng-person { grid-template-columns: minmax(0, 1fr) auto; }
}

[data-catalog-restricted] { user-select: none; }
[data-catalog-restricted] textarea { user-select: text; }
[data-catalog-restricted] textarea { display: block; width: 100%; min-height: 8rem; }
@media print {
  [data-restricted-text], [data-catalog-restricted] { display: none !important; }
}
