/* Text Message (experimental): a phone texting app. See js/modules/textMessage.js. */
.tm-phone { display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; height: min(680px, calc(100dvh - 150px)); min-height: 420px; background: var(--surface); border: 2px solid var(--border); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); }
.tm-top { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tm-avatar { width: 42px; height: 42px; font-size: 24px; }
.tm-top-text { flex: 1; min-width: 0; }
.tm-name { font-weight: 700; font-size: 1.02rem; }
.tm-status { font-size: .75rem; color: var(--text-muted); min-height: 1em; }
.tm-count { font-size: .75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tm-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; }
.tm-day { align-self: center; font-size: .72rem; color: var(--text-muted); background: var(--surface-2); padding: 2px 10px; border-radius: 999px; margin-bottom: 4px; }
.tm-messages .chat-row { max-width: 82%; }
.tm-messages .chat-bubble { font-size: 1.08rem; }
.chat-bubble.tm-in { background: var(--surface-2); color: var(--text); border-radius: 4px 4px 4px 4px; }
.chat-row.right .chat-bubble.tm-out { background: #2f7bf6; color: #fff; border-radius: 4px 4px 4px 4px; }
.tm-verdict { font-size: .72rem; font-weight: 700; color: var(--text-muted); padding: 0 6px; }
.tm-tray { border-top: 1px solid var(--border); background: var(--surface-2); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.tm-tray:empty { display: none; }
.tm-tray-label { font-size: .75rem; color: var(--text-muted); text-align: center; }
.tm-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; text-align: start; font: inherit; font-size: 1.05rem; line-height: 1.6; color: var(--text); background: var(--surface); border: 2px solid var(--border); border-radius: 4px; padding: 10px 14px; cursor: pointer; }
.tm-choice:has(ruby) { line-height: 2.1; }
.tm-choice:hover:not(:disabled) { border-color: var(--accent); }
.tm-choice-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.tm-choice-text { flex: 1; min-width: 0; }
/* A wrong pick: ✗ and words, a dashed border and struck-through text (never colour alone). */
.tm-choice.wrong { cursor: default; border-style: dashed; opacity: .85; }
.tm-choice.wrong .tm-choice-text, .tm-choice.wrong ruby { text-decoration: line-through; }
.tm-choice.wrong rt { text-decoration: none; }
.tm-choice.wrong .tm-choice-n { background: transparent; border: 1px dashed currentColor; color: var(--text-muted); }
.tm-why { flex-basis: 100%; font-size: .82rem; line-height: 1.4; color: var(--text-muted); }
.tm-why b { color: var(--text); }
.tm-done { text-align: center; padding: 6px 0; display: flex; flex-direction: column; gap: 10px; }
.tm-done-score { font-weight: 700; font-size: 1.05rem; }
.tm-note { font-size: .88rem; color: var(--text-muted); }
.tm-done-actions { display: flex; gap: 8px; justify-content: center; }
.tm-done-actions .btn { flex: 1; max-width: 200px; }
@media (max-width: 520px) {
  .tm-page .tm-phone { border-radius: 4px; height: calc(100dvh - 130px); }
}
