/* The inbox showcase (js/inbox.js): the inbox as a mail app shows it, a toolbar over a window of seven message rows
   (unread dot, avatar, sender, bold subject and muted snippet, time) on a longer list, worked to zero on a loop. Its own
   classes (ib-) in the time-lapse board's family (css/timelapse.css): the 70px row (60px on a phone), the same type
   sizes and radii, the head's figure the live unread count; at 0 it says Inbox zero, the one win green. The rows move
   by --y (rows above) and --out (how far a handled one has slid away), written each frame by the loop, which reduced
   motion never runs. */
.ib-tools { display: flex; align-items: center; gap: var(--sp-16); height: var(--sp-32); padding: 0 var(--sp-12); margin-bottom: var(--sp-8); border-bottom: var(--hair) solid var(--sel); color: var(--muted); }
.ib-tools svg { width: var(--ic-s); height: var(--ic-s); flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ib-sep { width: var(--hair); height: var(--ic-s); background: var(--sel); }
.ib-range { margin-left: auto; font-size: var(--fs-meta); }
.ib-win { --row-h: 70px; position: relative; height: calc(7 * var(--row-h)); overflow: hidden; }
.ib-list { position: relative; }
.ib-mail { position: absolute; inset: 0 0 auto; display: grid; grid-template-columns: var(--sp-8) var(--sp-32) minmax(0, 1fr) auto; align-items: center; gap: var(--sp-12); height: var(--row-h); padding: 0 var(--sp-12) 0 var(--sp-6); background: var(--surface); border-bottom: var(--hair) solid var(--sel); opacity: calc(1 - var(--out, 0)); transform: translate(calc(var(--out, 0) * -1 * var(--sp-48)), calc(var(--y, 0) * var(--row-h))); }
.ib-dot { width: var(--sp-8); height: var(--sp-8); border-radius: var(--r-pill); background: var(--ink); visibility: hidden; }
.ib-mail.is-unread .ib-dot { visibility: visible; }
/* a person's initials, or a sender's 3D icon, on a round tile */
.ib-av { display: grid; place-items: center; width: var(--sp-32); height: var(--sp-32); border-radius: var(--r-pill); background: var(--ground); border: var(--hair) solid var(--sel); font-size: var(--fs-tiny); font-weight: 600; }
.ib-av .fx { width: var(--ic-m); height: var(--ic-m); }
.ib-main { display: grid; min-width: 0; font-size: var(--fs-small); line-height: var(--lh-small); }
.ib-l1, .ib-l2 { display: flex; align-items: center; gap: var(--sp-6); min-width: 0; white-space: nowrap; }
.ib-from { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.ib-subj { flex: none; max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.ib-snip { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.ib-mail.is-unread .ib-from, .ib-mail.is-unread .ib-subj { font-weight: 600; }
/* what was done to it: a label chip as it is handled (Receipts with the label's look), the reply's arrow */
.ib-chip { flex: none; padding: var(--hair) var(--sp-6); border-radius: var(--r-pill); background: var(--sel); color: var(--muted); font-size: var(--fs-tiny); font-style: normal; font-weight: 600; }
.ib-chip:empty { display: none; }
.ib-mail.is-handled { background: var(--ground); }
.ib-mail.is-label .ib-chip { background: var(--ink); color: var(--surface); }
.ib-side { display: grid; justify-items: end; gap: var(--sp-2); font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--muted); font-variant-numeric: tabular-nums; }
.ib-mail.is-unread time { color: var(--ink); font-weight: 600; }
.ib-mark { display: flex; gap: var(--sp-4); height: var(--ic-s); }
.ib-mark svg { width: var(--ic-s); height: var(--ic-s); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.ib-mail.is-replied .ib-mark svg { visibility: visible; color: var(--ink); }
.ib-mark .fx { width: var(--ic-s); height: var(--ic-s); opacity: var(--star, 0); }
/* the two left for you: starred, pinned on top, the first in an ink outline at the zero */
.ib-mail.is-starred { border-bottom-color: var(--sel); }
/* below the starred two at the zero: everything else is handled */
.ib-done { position: absolute; inset: auto 0 var(--sp-24); display: flex; align-items: center; justify-content: center; gap: var(--sp-8); font-size: var(--fs-small); color: var(--muted); opacity: 0; }
.ib-done .fx { width: var(--ic-m); height: var(--ic-m); }
#inbox .tl-head span { font-variant-numeric: tabular-nums; }
#inbox .tl-head span.is-zero { padding: var(--hair) var(--sp-6); border-radius: var(--r-pill); background: color-mix(in srgb, var(--win) 12%, var(--surface)); color: var(--win); font-weight: 600; }

@media (max-width: 640px) {
  .ib-win { --row-h: 60px; }
  .ib-mail { gap: var(--sp-8); padding-left: var(--sp-2); padding-right: var(--sp-6); }
  .ib-subj { max-width: 100%; flex: 0 1 auto; }
  .ib-snip { display: none; }
  .ib-mail.is-replied .ib-snip { display: block; }
  .ib-mail.is-replied .ib-subj { display: none; }
  /* "Inbox" and its total fit one line on a phone: the head keeps one height whether it reads 88 unread or Inbox zero */
  #inbox .tl-head span { flex-basis: auto; margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ib-mail { transition: none; }
}
