
/* Dropzone (empty state) */
.tr-dropzone { display: grid; place-items: center; min-height: 340px; padding: 28px; border: 2px dashed var(--border); border-radius: var(--radius); background: var(--panel); transition: border-color .15s, background .15s; }
.tr-dropzone.dragging { border-color: var(--accent); background: var(--panel-2); }
.tr-dropzone-inner { max-width: 520px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tr-dropzone-inner h3 { margin: 0; }
.tr-dropzone-inner p { margin: 0; color: var(--muted); font-size: 14px; }
.tr-dropzone code { padding: 1px 5px; border-radius: 4px; background: var(--panel-2); font-size: 12px; }

/* Reference picker (staged state) */
.tr-panel { max-width: 640px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.tr-panel h3 { margin: 0 0 6px; }
.tr-panel .hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.tr-ref-list { display: flex; flex-direction: column; gap: 8px; }
.tr-ref-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); cursor: pointer; }
.tr-ref-row:hover { border-color: var(--accent); }
.tr-ref-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.tr-ref-lang, .tr-ref-keys { color: var(--muted); font-size: 12px; }
.tr-panel-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Session: reference bar */
.tr-source { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.tr-source-label { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.tr-source-meta { margin-left: 10px; color: var(--muted); font-size: 12px; }
.tr-replace { flex: none; }

/* Session: stale-key banner */
.tr-stale-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; margin-bottom: 18px; border: 1px solid color-mix(in srgb, var(--warn-fg) 40%, var(--border)); border-radius: var(--radius); background: color-mix(in srgb, var(--warn-fg) 8%, var(--panel)); }
.tr-stale-banner strong { display: block; font-size: 14px; }
.tr-stale-banner .hint { color: var(--muted); font-size: 12px; }
.tr-stale-banner .btn { flex: none; }

/* Session: language picker */
.tr-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tr-toolbar .input { max-width: 300px; }
.tr-toolbar-actions { display: flex; gap: 6px; margin-left: auto; }
.tr-langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tr-lang { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); cursor: pointer; font-size: 13px; }
/* A `display` rule outranks the UA stylesheet's [hidden] { display: none }, so
   filtered-out cards would stay on screen without this. */
.tr-lang[hidden] { display: none; }
.tr-lang:hover { border-color: var(--accent); }
.tr-lang.selected { border-color: var(--accent); background: var(--panel-2); }
.tr-lang-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-lang-code { color: var(--muted); font-size: 11px; }
.tr-badge { flex: none; margin-left: auto; padding: 2px 6px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; }
/* Only the first badge gets the auto margin that pushes the group right; on a
   later badge it would eat the flex gap and butt it against its neighbour. */
.tr-badge + .tr-badge { margin-left: 0; }
.tr-badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); }
.tr-badge.partial { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.tr-badge.warn { color: var(--warn-fg); border-color: color-mix(in srgb, var(--warn-fg) 40%, var(--border)); }
.tr-badge.stale { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

/* Session: run bar */
.tr-run { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.tr-run-summary { color: var(--muted); font-size: 13px; }

/* Session: live progress */
.tr-progress { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.tr-progress.hidden { display: none; }
.tr-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tr-bar { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; position: relative; }
.tr-bar-fill { width: 0; height: 100%; border-radius: 999px; background: var(--accent); transition: width .25s; }
/* A batch is one AI call with no progress inside it. While one is in flight the
   bar keeps its real fill and runs a sweep over the remainder, so "waiting on
   the model" reads differently from "stopped". */
.tr-bar.waiting::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
  animation: tr-sweep 1.4s linear infinite;
}
@keyframes tr-sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .tr-bar.waiting::after { animation: none; opacity: .5; }
}
.tr-progress-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }
.tr-log { max-height: 190px; margin: 12px 0 0; padding: 0; overflow-y: auto; list-style: none; font-size: 13px; }
.tr-log li { padding: 5px 0; border-top: 1px solid var(--border); color: var(--muted); }
.tr-log li.ok { color: var(--ok); }
.tr-log li.warn { color: var(--warn-fg); }
.tr-log li.error { color: var(--danger); }
