/* ============================================================
   TRANSCRIBE SCREEN  (js/shell/screen-transcribe.js)

   Layout is deliberately top-heavy: the record button sits above the
   transcript rather than beside it, because dictating is a two-handed-phone,
   one-thumb activity and the control you press repeatedly should not be the
   one furthest from your thumb. Everything else reuses screens.css
   (.ts-card / .ts-cta / .ts-ghostbtn) so this screen cannot drift visually
   from Listen or Format.
   ============================================================ */

.ts-tr-intro .ts-card-note {
  padding: 0 1rem 0.875rem;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ts-text-dim);
}

/* ---- record control ---------------------------------------- */

.ts-tr-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0 1rem;
}

.ts-tr-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.5rem;
  height: 5.5rem;
  padding: 0;
  border: 1px solid var(--ts-border);
  border-radius: 50%;
  background: var(--ts-surface);
  color: var(--ts-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ts-tr-mic svg { width: 2.25rem; height: 2.25rem; }

.ts-tr-mic:active { filter: brightness(0.94); }

.ts-tr-mic:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Listening is the one state that must be readable at a glance from arm's
   length, so it changes fill, not just an outline. The pulse is a shadow
   rather than a transform so the button's hit target never moves under a
   thumb that is already resting on it. */
.ts-tr-mic.is-live {
  background: var(--ts-danger);
  border-color: var(--ts-danger);
  color: #fff;
  animation: ts-tr-pulse 1.6s ease-out infinite;
}

@keyframes ts-tr-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
  70%  { box-shadow: 0 0 0 1.1rem rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ts-tr-mic.is-live { animation: none; }
}

.ts-tr-status {
  min-height: 1.25rem;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--ts-text-dim);
}

.ts-tr-status[data-state="live"]   { color: var(--ts-danger); font-weight: 600; }
.ts-tr-status[data-state="error"]  { color: var(--ts-danger); }
/* Locked reads as an invitation, not a fault: accent, not the error red the
   two states above use. */
.ts-tr-status[data-state="locked"] { color: var(--ts-accent-text); font-weight: 600; }

/* ---- transcript -------------------------------------------- */

.ts-tr-label {
  display: block;
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ts-text-faint);
}

.ts-tr-text {
  width: 100%;
  box-sizing: border-box;
  padding: 0.875rem;
  border: 1px solid var(--ts-border);
  border-radius: var(--ts-radius-sm);
  background: var(--ts-surface);
  color: var(--ts-text);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.55;
  resize: vertical;
  /* 16px minimum: anything smaller makes Android zoom the viewport on focus,
     which would leave the shell's fixed chrome misaligned. */
  min-height: 9rem;
}

.ts-tr-text:focus {
  outline: none;
  border-color: var(--ts-accent);
}

.ts-tr-count {
  margin: 0.375rem 0 0.875rem;
  font-size: 0.75rem;
  text-align: right;
  color: var(--ts-text-faint);
}

/* ---- actions ------------------------------------------------ */

.ts-tr-actions { padding-bottom: 0.5rem; }

.ts-tr-actions .ts-ghostbtn { margin-top: 0.5rem; }

.ts-tr-actions .ts-cta:disabled {
  opacity: 0.45;
  cursor: default;
}

.ts-tr-clear { color: var(--ts-danger); }
