/* Team messages (the B-Mensagens and C-Mensagens boards): the screen's own
   layout. The list and the open message side by side on a laptop; on a
   phone the list is one page and the message another (.msg-at-list on the
   index, .msg-at-message on a message's page). Rows, badges, buttons and
   chips are the library's (blocks.css). */

.msg-split { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: 24px; align-items: start; max-width: 1120px; }
/* The family's list is wider, so a title keeps its words beside "Confirm
   you read it" (C-Mensagens-D). */
.msg-split.is-family { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }

/* The list: the open message's line on pale blue, with a blue edge. */
.msg-list .row-item > svg { display: none; }
.msg-list .row-title { font-size: .9375rem; font-weight: 700; }
.msg-list .row-item.is-selected { background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.msg-list .show-more { margin-top: var(--space-3); }

/* The open message: a white card on a laptop. */
.msg-detail { padding: 22px 24px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg-back { display: none; }
.msg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; color: var(--muted); font-size: var(--text-small); }
.msg-title { margin: 8px 0 0; font-size: 1.375rem; letter-spacing: -.01em; }
.msg-body { max-width: 62ch; margin-top: 10px; font-size: .9375rem; line-height: 1.55; }
.msg-body p + p { margin-top: var(--space-2); }

.msg-part { margin-top: 24px; }
.msg-heading { margin: 0; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.msg-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.msg-figures:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.msg-figure { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.msg-figure b { display: block; font-size: 1.375rem; line-height: 1.1; }
.msg-figure span { color: var(--muted); font-size: var(--text-small); }
.msg-figure.is-apart { background: var(--surface-3); }
.msg-figure.is-apart span { color: var(--ink); }

.msg-readers { margin: 16px 0 0; padding: 0; list-style: none; }
.msg-readers li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--surface-3); font-size: var(--text-label); }
.msg-reader { flex: 1; min-width: 0; }
.msg-reader b { font-size: var(--text-label); }
.msg-reader small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-small); }
.msg-retry { margin-top: var(--space-3); }

.msg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--surface-3); color: var(--ink); font-size: var(--text-small); font-weight: 600; }
.msg-chip:hover { background: var(--blue-soft); color: var(--blue-deep); }
.msg-foot { margin: 14px 0 0; color: var(--faint); font-size: var(--text-small); }

/* The family's list: a mark before the title (the clock while a
   confirmation is due), the title bold while unread or to confirm; the state under the
   title in the side column. */
.msg-list .msg-mark { display: flex; width: 12px; justify-content: center; }
.msg-list.is-family .row-item:not(.is-due) .row-title { font-weight: 600; }
.msg-list.is-family .row-item.is-selected { box-shadow: none; }
.msg-list.is-family .row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-list.is-family .row-head { flex-wrap: nowrap; }
.msg-list.is-family .row-item .row-main { flex: 1 1 0; }
.msg-list.is-family .row-item .row-aside { order: 0; flex-basis: auto; padding-left: 0; }
.msg-list.is-family .row-item { flex-wrap: nowrap; gap: 12px; }
.msg-frame { display: block; min-width: 0; }

/* The family's open message: its text, then the confirmation under a line. */
.msg-detail.is-family { padding: 24px 28px; }
.msg-detail.is-family .msg-title { font-size: 1.5rem; }
.msg-detail.is-family .msg-body { max-width: 60ch; margin-top: 16px; font-size: 1rem; }
.msg-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.msg-confirm form { margin: 0; }
.msg-confirm p { margin: 0; color: var(--muted); font-size: var(--text-small); }
.msg-confirmed { display: inline-flex; align-items: center; gap: var(--space-2); }

@media (max-width: 1000px) {
  .msg-split, .msg-split.is-family { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .msg-at-list .msg-detail, .msg-at-list .msg-frame { display: none; }
  .msg-at-message :is(.page-head, .family-band, .msg-list) { display: none; }
  .msg-split { gap: 0; }
  .msg-at-list .msg-list .row-item.is-selected { background: none; box-shadow: none; }

  /* On its own page the message sits on the grey page, its parts in cards. */
  .msg-detail, .msg-detail.is-family { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .msg-back { display: inline-flex; margin-bottom: 12px; }
  .msg-title, .msg-detail.is-family .msg-title { margin-top: 6px; font-size: 1.5rem; letter-spacing: -.02em; }
  .msg-body, .msg-detail.is-family .msg-body { margin-top: 8px; font-size: .9375rem; line-height: 1.5; }
  .msg-part { margin: 22px -4px 0; }
  .msg-heading { margin: 0 4px 10px; }
  .msg-card { padding: 14px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
  .msg-figures, .msg-figures:has(> :nth-child(3):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 0; }
  .msg-figure { padding: 12px; }
  .msg-figure b { font-size: 1.25rem; }
  .msg-figure span { font-size: .75rem; }
  .msg-readers { margin-top: 14px; }
  .msg-readers li { padding: 12px 0 0; }
  .msg-reader b { font-size: .9375rem; }
  .msg-chips { margin: 0 4px; }
  .msg-chip { height: 32px; }
  .msg-laptop, .msg-foot { display: none; }
  .msg-confirm { flex-direction: column; align-items: stretch; }
  .msg-confirm .btn { width: 100%; }
}
