/* ==========================================================
   Lula Helpline - translated messages and language choices.
   Loaded by the caller page and the responder dashboard, after
   their own stylesheets, and drawn in their own colours: navy,
   Lula pink, white, and yellow only where something genuinely
   needs attention. Nothing here changes how any existing part
   of either page looks.
   ========================================================== */

/* ---------------- under a chat bubble ---------------- */

/* A translated bubble keeps its words-wide size; the note under it can be
   wider than a short message without stretching the bubble itself. */
.bubble.is-translated .bubble-body { width: fit-content; max-width: 100%; }
.bubble-mine.is-translated .bubble-body { margin-left: auto; }

.tr-bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px;
  margin-top: 4px; padding: 0 4px;
  font-size: .875rem; line-height: 1.4; color: var(--muted, #6b6b6b);
}
.tr-label { font-style: italic; }
.bubble-mine .tr-bar { justify-content: flex-end; text-align: right; }
.bubble-system .tr-bar { justify-content: center; }

.tr-action {
  font: inherit; font-size: .875rem; font-weight: 600; font-style: normal;
  color: var(--pink-deep, #c2305c);
  background: none; border: 0; padding: 2px 0; margin: 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.tr-action:hover { color: var(--navy, #0e2a47); }
.tr-action:disabled { color: var(--muted, #6b6b6b); cursor: default; text-decoration: none; }

/* What the other person received, opened from "View translation". */
.tr-delivered {
  width: fit-content; max-width: 100%;
  margin-top: 6px; padding: 9px 14px; border-radius: 14px;
  background: #fff; border: 1px dashed var(--line, #e8e3e6); color: var(--navy, #0e2a47);
  font-size: .9375rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; text-align: left;
}
.bubble-mine .tr-delivered { margin-left: auto; }

/* Translation unavailable, or a translation that may not be exact. */
.tr-notice {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px;
  margin-top: 6px; padding: 8px 12px; border-radius: 10px;
  font-size: .875rem; line-height: 1.45; color: var(--ink, #1e1e1e); text-align: left;
  background: var(--yellow-wash, #fff6e3); border: 1px solid var(--yellow, #f0b429);
}
.tr-caution { border-style: dashed; }
.bubble-system .tr-notice { display: inline-flex; max-width: 100%; }
html.high-contrast .tr-notice, html.high-contrast .tr-delivered { border: 2px solid #000; }

/* ---------------- responder dashboard ---------------- */

/* Which language the caller chose, above the conversation. */
.translation-banner {
  flex: 0 0 auto; margin: 0; padding: 9px 20px;
  background: var(--pink-wash, #fce8ed); border-bottom: 1px solid var(--pink-soft, #f9d8e0);
  color: var(--navy, #0e2a47); font-size: .9375rem; line-height: 1.45;
}
html.high-contrast .translation-banner { border-bottom: 2px solid #000; }

/* ---------------- caller page ---------------- */

/* The caller's bubbles from her responder sit beside the Lula badge, so
   everything added under them goes in the same column as the words. */
.caller-page .bubble-caller .tr-bar,
.caller-page .bubble-caller .tr-notice,
.caller-page .bubble-caller .tr-delivered { grid-column: 2; }
.caller-page .tr-bar { color: var(--c-grey-light); padding: 0 .3rem; }
.caller-page .tr-action { color: var(--c-pink-ink); }
.caller-page .tr-action:hover { color: var(--c-navy); }
.caller-page .tr-action:disabled { color: var(--c-grey-light); }
.caller-page .tr-action:focus-visible { outline: 3px solid var(--c-pink); outline-offset: 2px; border-radius: 4px; }
.caller-page .tr-delivered { border-color: var(--c-border); color: var(--c-navy); font-size: .95rem; }
.caller-page .tr-notice { color: var(--c-text); background: #fff6e3; border-color: var(--c-amber); }

/* Choosing a language before starting: the same look as "Where are you?" */
.caller-page .language-section {
  background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: 18px;
  padding: 1.4rem 1.4rem 1.2rem; margin: 0 0 1.5rem;
}
.caller-page .language-section h2 {
  font-size: 1rem; font-weight: 600; color: var(--c-navy); margin: 0 0 .5rem;
}
.caller-page .language-section > .hint {
  font-size: .95rem; color: var(--c-grey-text); line-height: 1.5; margin: 0 0 1.1rem;
}
.caller-page .choice-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Changing language during the conversation. */
.caller-page .chat-language {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem;
  margin: -.6rem 0 1.1rem;
}
.caller-page .chat-language label { font-size: .875rem; font-weight: 600; color: var(--c-navy); margin: 0; }
.caller-page .chat-language select { width: auto; min-width: 9.5rem; padding: .45rem .8rem; }

@media (max-width: 520px) {
  .caller-page .language-section { padding: 1.1rem 1rem 1rem; }
  .caller-page .choice-grid-three { grid-template-columns: minmax(0, 1fr); }
}
