/* Translator — layered on the shared design tokens in /static/css/style.css */

.tr-room {
  max-width: 47.5rem;
  margin: 0 0 4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.tr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.tr-head-label {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tr-state {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tr-dot {
  position: relative;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: var(--muted);
}

.tr-room.is-live .tr-dot {
  background: var(--accent);
}

/* The expanding ring reads as "we are listening" without adding motion noise. */
.tr-room.is-live .tr-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: tr-pulse 1.8s ease-out infinite;
}

@keyframes tr-pulse {
  from {
    transform: scale(1);
    opacity: 0.7;
  }
  to {
    transform: scale(3.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tr-room.is-live .tr-dot::after {
    animation: none;
  }
}

.tr-body {
  padding: 1.25rem;
}

/* Controls ----------------------------------------------------------------- */

.tr-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.875rem;
}

.tr-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 9rem;
  flex: 1 1 9rem;
}

.tr-label {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tr-field input,
.tr-field select {
  width: 100%;
  padding: 0.5rem 0.625rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tr-field input:focus-visible,
.tr-field select:focus-visible,
.tr-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.tr-field input:disabled,
.tr-field select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.tr-actions {
  display: flex;
  gap: 0.5rem;
}

.tr-btn {
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease;
}

.tr-btn:hover:not(:disabled) {
  border-color: var(--text);
}

.tr-btn:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.tr-btn-primary {
  color: var(--surface);
  background: var(--text);
  border-color: var(--text);
}

.tr-btn-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.tr-btn.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

/* Notes, roster ------------------------------------------------------------ */

.tr-note {
  margin: 0.875rem 0 0;
  font-size: 0.8125rem;
  color: var(--accent);
}

.tr-sub {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.tr-roster {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.tr-roster-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.tr-roster-list li {
  color: var(--muted);
}

.tr-roster-list .tr-who {
  color: var(--text);
}

.tr-selfline {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--muted);
}

/* Captions ----------------------------------------------------------------- */

.tr-captions {
  max-height: 26rem;
  overflow-y: auto;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tr-captions:empty {
  display: none;
}

/* Wrappers exist only to keep live rows pinned above finals; they must not
   interrupt the parent's flex gap. */
.tr-stack {
  display: contents;
}

.tr-caption {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.tr-caption.is-self {
  border-left: 2px solid var(--accent);
}

/* Partials are provisional, so they read as provisional. */
.tr-caption.is-partial {
  border-style: dashed;
  opacity: 0.72;
  font-style: italic;
}

.tr-caption-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tr-caption-who {
  color: var(--text);
  font-weight: 600;
}

.tr-caption-time {
  font-variant-numeric: tabular-nums;
}

.tr-caption-text {
  margin: 0;
  font-size: 0.9375rem;
  text-wrap: pretty;
}

.tr-caption-source {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--muted);
  text-wrap: pretty;
}

@media (max-width: 34rem) {
  .tr-actions {
    width: 100%;
  }

  .tr-actions .tr-btn {
    flex: 1;
  }
}
