/* Thread page: read messages collapse to one-line rows, older ones wait
   behind "N earlier messages", and a round button opens or closes them all. */

.entries { position: relative; }
.entry { position: relative; }

/* Older entries load into this frame; its entries join the column's gap. */
.entries__earlier { display: contents; }

.entries__expander {
  display: block;
  padding-top: 1em;
  color: var(--color-accent);
  font-size: 17.6px;
  line-height: 22.88px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.entries__expander-label { display: inline-block; padding: 0.4em 0; }
.entries__expander:hover .entries__expander-label { text-decoration: underline; }
.entries__expander[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.entries__toggle-all {
  position: absolute;
  top: -1em;
  right: calc(max(0px, (100% - 1078px) / 2) + 55px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 35.2px;
  height: 35.2px;
  padding: 0;
  border: 1px solid rgb(var(--ink-rgb) / 0.15);
  border-radius: 50%;
  background: var(--color-sheet);
  color: var(--color-muted);
  cursor: pointer;
}

.entries__toggle-all:hover { color: var(--color-ink); background: rgb(246 245 243); }
.entries__toggle-all-icon { width: 18px; height: 18px; }

/* The New pill on messages since the last visit */
.entry__new-pill {
  position: absolute;
  top: -0.5em;
  left: 55px;
  z-index: 1;
  padding: 0 9px;
  border-radius: 33px;
  background: var(--popup-current);
  color: var(--popup-current-ink);
  font-size: 13.2px;
  line-height: 19.8px;
  font-weight: 500;
}

/* One-line row for a collapsed message */
.entry__summary { display: none; }

.entry--collapsed { padding-bottom: 0; }
.entry--collapsed .entry__details { display: none; }

.entry--collapsed .entry__summary {
  display: flex;
  align-items: center;
  gap: 9.9px;
  min-width: 0;
  height: 66px;
  font-size: 17.6px;
  line-height: 22.88px;
}

.entry__summary .avatar { flex: none; }
.entry__summary-sender { flex: 0 1 auto; max-width: 30%; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.entry__summary-excerpt {
  flex: 1 1 0;
  min-width: 0;
  margin-right: 6em;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 15.4px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry__summary-time { flex: none; color: var(--color-muted); }

/* Clicking anywhere on the row (or an open message's header) toggles it */
.entry__toggle {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 29.7px;
  background: none;
  cursor: pointer;
}

.entry__toggle:focus { outline: none; }
.entry__toggle:focus-visible { outline: 2px solid #a4d2ff; outline-offset: -2px; }
.entry--collapsed .entry__summary:hover { opacity: 0.85; }

.entry--collapsible .entry__header { position: relative; }
.entry--collapsible .entry__header > :not(.entry__toggle) { position: relative; z-index: 1; pointer-events: none; }
/* The date and ••• stay clickable (as specific as the rule above, so it wins) */
.entry--collapsible .entry__header > .entry__meta { pointer-events: auto; }
