/*
 * Texts with a lead, on the lead card (lane t22-leadsms, 13 Oct 2026; js/v21_leadsms.js). One box in the lead's panel
 * (the l418-box look of js/v21_lead418.js) and one line on the board card. The desk's own tokens, so it follows every
 * theme, light and dark and High contrast. No inline styles.
 */

.lsms { grid-column: 1 / -1; }
.lsms-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.lsms-num { color: var(--ink-2); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lsms-chip {
  display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--practice, var(--warn));
  color: var(--ink); font-size: .75rem; font-weight: 700; line-height: 1.25rem;
}
.lsms-stop {
  margin: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--warn); color: var(--ink);
  font-size: .8125rem; line-height: 1.25rem;
}

/* the thread: theirs on the left, ours on the right; it scrolls inside its own box */
.lsms-thread {
  list-style: none; margin: 0; padding: 2px; display: flex; flex-direction: column; gap: 6px; max-height: 18rem;
  overflow: auto; overscroll-behavior: contain;
}
.lsms-msg {
  display: grid; gap: 2px; max-width: min(78%, 34rem); padding: 6px 10px; border-radius: 12px;
  border: 1px solid var(--glass-rim); background: var(--solid);
}
.lsms-msg.is-in { align-self: flex-start; border-bottom-left-radius: 4px; }
.lsms-msg.is-out { align-self: flex-end; border-bottom-right-radius: 4px; background: var(--brand-soft); border-color: var(--brand-soft); }
.lsms-msg.is-auto { border-style: dashed; }
.lsms-msg.is-failed { border-color: var(--danger); }
.lsms-body { margin: 0; color: var(--ink); font-size: .875rem; line-height: 1.3rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.lsms-meta { margin: 0; color: var(--ink-2); font-size: .75rem; line-height: 1.1rem; }
.lsms-msg.is-out .lsms-meta { text-align: right; }
.lsms-why { margin: 0; color: var(--danger); font-size: .75rem; font-weight: 600; line-height: 1.1rem; }
.lsms-line { margin: 0; color: var(--ink); font-size: .75rem; font-weight: 600; line-height: 1.1rem; }

/* the composer */
.lsms-compose { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid var(--glass-rim); }
.lsms-openers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lsms-hint { flex: 0 0 auto; color: var(--ink-2); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.lsms-opener {
  max-width: 100%; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--glass-rim); background: var(--solid);
  color: var(--ink); font: inherit; font-size: .75rem; line-height: 1.1rem; text-align: left; cursor: pointer;
  overflow-wrap: anywhere;
}
.lsms-opener:hover { border-color: var(--brand-text); }
.lsms-opener:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.lsms-opener:disabled { cursor: default; opacity: .6; }
.lsms-ta {
  width: 100%; min-height: 4.5rem; resize: vertical; padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--glass-rim); background: var(--solid); color: var(--ink); font: inherit; font-size: .875rem;
}
.lsms-ta:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.lsms-row { justify-content: space-between; }
.lsms-count { margin: 0; color: var(--ink-2); font-size: .75rem; font-weight: 600; }
.lsms-count.is-over { color: var(--danger); }

/* t22-fixAK: a Bad Lead texted again: the line, their texts and the one choice */
.lsms-back { display: grid; gap: 6px; padding: 8px; border-radius: 8px; border: 1px solid var(--warn); background: var(--solid); }
.lsms-back-line { margin: 0; color: var(--ink); font-size: .875rem; font-weight: 700; line-height: 1.3rem; }
.lsms-back-texts { margin: 0; padding-left: 18px; color: var(--ink); font-size: .8125rem; line-height: 1.25rem; overflow-wrap: anywhere; }
.lsms-back-opt { display: grid; gap: 2px; justify-items: start; }
.lsms-back-reply { margin: 0; color: var(--ink-2); font-size: .75rem; line-height: 1.1rem; overflow-wrap: anywhere; }
.lsms-back-tick { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: .75rem; font-weight: 600; }

/* the board card: "New text, 7:42 pm" under the stamp row */
.lsms-c { margin: 2px 0 0; color: var(--brand-text); font-size: .75rem; font-weight: 700; line-height: 1.1rem; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .lsms-msg { max-width: 88%; }
  .lsms-thread { max-height: 15rem; }
  .lsms-row { justify-content: flex-start; }
  /* the openers in one row that scrolls sideways inside the box, so the words box stays in view */
  .lsms-openers { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 2px; }
  .lsms-opener { flex: 0 0 auto; max-width: 15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* t29-desktext (js/v21_leadsms.js 1.3.0): the text part of a card (a phone message under its email), the pictures a
   client sent by text, and the line that says a text came. The desk's own tokens. No inline styles. */
.dtx { margin-top: 8px; }
.dtx-phone {
  display: flex; justify-content: flex-end; max-width: 26rem; padding: 10px 10px 12px; border-radius: 16px;
  border: 1px solid var(--glass-rim); background: var(--solid);
}
.dtx-phone.is-off { opacity: .55; }
.dtx-bubble { max-width: 100%; }
.dtx-row { justify-content: flex-start; align-items: center; gap: 10px; }
.dtx-fact { margin: 0; }
.dtx-from { margin: 0 0 6px; color: var(--ink); font-size: .875rem; font-weight: 600; line-height: 1.3rem; }
.dtx-pics { display: flex; flex-wrap: wrap; gap: 6px; }
.dtx-pic {
  padding: 2px; border-radius: 8px; border: 1px solid var(--glass-rim); background: var(--solid); color: var(--ink);
  font: inherit; font-size: .75rem; line-height: 1.1rem; cursor: pointer;
}
.dtx-pic.is-wait { padding: 2px 8px; color: var(--ink-2); cursor: default; }
.dtx-pic:hover { border-color: var(--brand-text); }
.dtx-pic:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.dtx-thumb { display: block; width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }
.dtx-pic-name { display: block; padding: 2px 8px; overflow-wrap: anywhere; }
