/* ===========================================================
   translation.css — the certified translation register.

   One thing this stylesheet is doing on purpose: a machine
   translation must never be able to be mistaken for a certified
   one at a glance. Certified rows are gold and settled; machine
   rows sit in their own block, under a warning, in a cooler
   colour, with the engine's name in the row itself. Two records
   of the same shape that mean completely different things is
   exactly the situation a screen is supposed to disambiguate,
   and the cost of getting it wrong is a machine translation in a
   production.

   The second is the undetermined marker. A document whose
   language could not be read is amber rather than grey, because
   "we could not tell" is a finding that needs a person, not a
   quieter version of "nothing to do".
   =========================================================== */

.tr-readable {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
}
.tr-readable input {
  flex: 1 1 auto; min-width: 0;
  background: var(--surface-2, rgba(255,255,255,.03));
  border: 1px solid var(--border); border-radius: var(--r-sm);
  color: var(--text); font-family: var(--mono); font-size: 12px;
  padding: 6px 10px; letter-spacing: normal; text-transform: none;
}
.tr-readable input:focus { outline: none; border-color: var(--border-gold); }

.tr-hint {
  margin: 0 0 14px; font-size: 12px; line-height: 1.55; color: var(--text-3);
  max-width: 56ch;
}

/* ---- the collection: what nobody here reads ---- */
.tr-need {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface, rgba(255,255,255,.02));
}
.tr-need-main { min-width: 0; flex: 1 1 auto; }
.tr-need-name {
  font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-need-meta { margin-top: 4px; font-size: 11px; color: var(--text-3); }
.tr-need-side {
  display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap;
  justify-content: flex-end;
}
.tr-need-side .btn { padding: 5px 11px; font-size: 10.5px; }

/* "we could not tell" is a finding, not a quieter nothing. */
.tr-und { color: var(--amber); }
.tr-machine { color: var(--cyan); }

/* ---- the register ---- */
.tr-sub {
  margin: 4px 0 10px; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-3);
}

.tr-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--border); border-left: 2px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface, rgba(255,255,255,.02));
}
.tr-row-main { min-width: 0; flex: 1 1 auto; }
.tr-row-name { font-size: 14px; color: var(--text); }
.tr-row-meta { margin-top: 5px; font-size: 11.5px; color: var(--text-2); }
.tr-row-purpose {
  margin-top: 7px; font-size: 12px; line-height: 1.5; color: var(--text-3);
  max-width: 70ch;
}
.tr-row-side {
  display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap;
  justify-content: flex-end; max-width: 40%;
}
.tr-row-side .btn { padding: 5px 11px; font-size: 10.5px; }

.tr-certified { border-left-color: var(--gold); }
.tr-out       { border-left-color: var(--cyan); }
.tr-cancelled { opacity: .55; }

/* A translation back from a translator that nobody has stood
   behind is the state most likely to be forgotten, so it is the
   one state that is allowed to look unfinished. */
.tr-returned { border-left-color: var(--amber); }
.tr-gap {
  margin-top: 9px; padding: 8px 11px; border-radius: var(--r-sm);
  background: rgba(224,170,94,.08); border: 1px solid rgba(224,170,94,.25);
  font-size: 12px; line-height: 1.5; color: var(--amber);
}

.tr-cert {
  margin-top: 9px; font-size: 11.5px; line-height: 1.55; color: var(--text-2);
}
.tr-hash {
  display: inline-block; margin-left: 8px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
}
.tr-late { color: var(--red); }

.tr-pill {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid var(--border); color: var(--text-3); white-space: nowrap;
}
.tr-ok   { color: var(--gold);  border-color: var(--border-gold); }
.tr-work { color: var(--cyan);  border-color: var(--cyan-soft); }
.tr-none { color: var(--text-3); }
.tr-mach { color: var(--cyan);  border-color: var(--cyan-soft); }

/* ---- machine translations, kept visibly apart ---- */
.tr-machine-block {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border);
}
.tr-warn {
  margin: 0 0 12px; font-size: 12px; line-height: 1.55; color: var(--text-3);
  max-width: 70ch;
}
.tr-machine-row { border-left-color: var(--cyan-soft); }

.tr-warnbox {
  margin-bottom: 14px; padding: 11px 14px; border-radius: var(--r-sm);
  background: rgba(224,122,112,.07); border: 1px solid rgba(224,122,112,.3);
  font-size: 12.5px; line-height: 1.55; color: var(--red);
}

.tr-draft {
  max-height: 46vh; overflow: auto; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: rgba(0,0,0,.25);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}

.tr-err { color: var(--red); }

@media (max-width: 1100px) {
  .tr-row { flex-direction: column; }
  .tr-row-side { max-width: none; justify-content: flex-start; }
}

/* ===========================================================
   The viewer's translation pane.

   One rule drives the whole layout: the original never leaves the
   screen. The pane is a second column, and the split only exists
   while there is something in it — a permanently halved viewer
   would make every English document harder to read in order to
   serve the foreign ones.

   The colour is doing work too. The machine pane is cool and
   carries a red not-evidence block; a certified pane is gold and
   carries the translator's name. A reviewer glancing up mid-
   sentence has to be able to tell which one they are reading
   without going back to the header.
   =========================================================== */

.viewer-split {
  flex: 1; min-height: 0; display: flex; overflow: hidden;
}
.viewer-split > .viewer-body { flex: 1 1 100%; min-width: 0; }
.viewer-split.vt-split-on > .viewer-body {
  flex: 1 1 50%; border-right: 1px solid var(--border);
}
.viewer-trans {
  flex: 1 1 50%; min-width: 0; overflow-y: auto;
  padding: 18px 22px; background: rgba(143,212,222,.025);
}

.vt-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 9px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface-2, rgba(255,255,255,.03));
  font-size: 12px; color: var(--text-2);
}
.vt-bar b { color: var(--text); font-weight: 500; }
.vt-lang { flex: 0 1 auto; }
.vt-conf { color: var(--text-3); font-family: var(--mono); font-size: 10.5px; }
.vt-ok { color: var(--gold); }
.vt-pending { color: var(--cyan); font-size: 11px; }
.vt-busy { color: var(--cyan); font-size: 11.5px; }
.vt-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.vt-actions .btn { padding: 5px 12px; font-size: 10.5px; }
.vt-error {
  padding: 9px 24px; font-size: 11.5px; line-height: 1.5; color: var(--red);
  background: rgba(224,122,112,.06); border-bottom: 1px solid rgba(224,122,112,.25);
}

.vt-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.vt-tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--cyan); border: 1px solid var(--cyan-soft);
}
.vt-tag-cert { color: var(--gold); border-color: var(--border-gold); }
.vt-prov { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); }

/* Stated where the text is, not in a header somebody scrolls past. */
.vt-notevidence {
  padding: 10px 13px; margin-bottom: 12px; border-radius: var(--r-sm);
  background: rgba(224,122,112,.07); border: 1px solid rgba(224,122,112,.28);
  font-size: 11.5px; line-height: 1.55; color: var(--red);
}
.vt-summary-warn {
  padding: 10px 13px; margin-bottom: 12px; border-radius: var(--r-sm);
  background: rgba(224,170,94,.08); border: 1px solid rgba(224,170,94,.28);
  font-size: 11.5px; line-height: 1.55; color: var(--amber);
}

.vt-text {
  font-family: 'JetBrains Mono', var(--mono); font-size: 12px; line-height: 1.7;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}
.vt-working { padding: 30px 4px; font-size: 12px; color: var(--text-3); }
.vt-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.vt-foot .btn { padding: 6px 13px; font-size: 10.5px; }

/* Narrow: stack rather than squeeze. Two 300px columns of legal
   prose is worse than one column and a scroll. */
@media (max-width: 900px) {
  .viewer-split { flex-direction: column; }
  .viewer-split.vt-split-on > .viewer-body { border-right: none; border-bottom: 1px solid var(--border); }
}

/* A translation the model produced but the register refused. Red,
   like the not-evidence block, because both are limitations of what
   the reader is looking at rather than warnings about the text. */
.vt-unrecorded {
  padding: 10px 13px; margin-bottom: 12px; border-radius: var(--r-sm);
  background: rgba(224,122,112,.07); border: 1px solid rgba(224,122,112,.28);
  font-size: 11.5px; line-height: 1.55; color: var(--red);
}

/* Said before the click, not after a minute of waiting. */
.vt-note { font-size: 11px; color: var(--text-3); flex: 1 1 auto; min-width: 0; }

/* ---- Line by line (js/linetranslate.js) ---- */
.vt-linenote { font-size: 12px; color: var(--text-3); margin: 6px 0 8px; line-height: 1.5; }
.vt-lines { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.vt-lines th { text-align: left; font-weight: 600; color: var(--text-3); padding: 4px 6px; border-bottom: 1px solid var(--border-bright); }
.vt-lines td { vertical-align: top; padding: 5px 6px; border-bottom: 1px solid var(--border); white-space: pre-wrap; }
.vt-lines .vt-ts { font-family: var(--mono); color: var(--text-3); white-space: nowrap; }
.vt-lines .vt-who { color: var(--gold-bright); white-space: nowrap; }
.vt-lines .vt-orig { color: var(--text-2); width: 42%; }
.vt-lines .vt-same { font-size: 11px; color: var(--text-3); font-style: italic; }

/* ---- Translate in bulk (js/bulktranslate.js) ---- */
.tb-card { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--border-bright); border-radius: 10px; background: var(--surface-2); }
.tb-head { font-weight: 600; margin-bottom: 6px; }
.tb-note { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin: 0 0 10px; }
.tb-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tb-row select { min-width: 260px; }
.tb-line { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.tb-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.tb-bar span { display: block; height: 100%; background: var(--gold); }
.tb-actions { margin-top: 10px; }
.tb-failed { font-size: 12px; color: var(--text-2); margin-top: 6px; }
