/* ---------------------------------------------------------------------------
   Activity feed, in the company and contact drawers
   --------------------------------------------------------------------------- */
.feed { display: flex; flex-direction: column; gap: 18px }
.feed__day { display: flex; flex-direction: column }
.feed__date { font-size: 12px; font-weight: var(--weight-strong); color: var(--muted); margin-bottom: 8px }
.feed__item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding-bottom: 14px }
/* The rail: a line from each dot down to the next. */
.feed__item:not(:last-child)::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--hair);
}
.feed__dot {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--page); color: var(--muted);
}
.feed__dot .ms { font-size: 15px }
.feed__dot--reply, .feed__dot--warm { background: color-mix(in srgb, var(--teal) 22%, transparent); color: #04635C }
.feed__dot--stage { background: var(--ink); color: var(--on-ink) }
.feed__dot--wait { background: rgba(255, 179, 0, .22); color: #6B4A00 }
.feed__dot--good { background: var(--good); color: #FFF }
.feed__dot--bad { background: rgba(192, 54, 44, .14); color: var(--bad) }
.feed__body { flex: 1; min-width: 0; padding-top: 4px }
.feed__primary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px }
.feed__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere }
.feed__time { font-size: 12px; color: var(--muted); padding-top: 6px; font-variant-numeric: tabular-nums }
.feed__empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 120px; color: var(--muted); font-size: 13px; font-weight: var(--weight-strong) }
.feed__empty .ms { font-size: 40px }

/* Activity across the whole account. The kind chips are the key and the
   filter at once, so each carries its colour, its count and its word; the
   chart under them stacks the same colours by day. */
.actv { display: flex; flex-direction: column; gap: 18px }
.actv__kinds { row-gap: 4px }
/* Each kind's mark keeps its colour, chosen or not. */
.actv__kind .actv__glyph { display: inline-grid; place-items: center; color: var(--tone) }

.actv__chart { display: flex; flex-direction: column; gap: 20px }
.actv__charthead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap }
.actv__total { display: flex; flex-direction: column; gap: 4px }
.actv__readout { font-size: 32px; font-weight: var(--weight-strong); letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums }
.actv__periods { margin-left: 0; flex-wrap: wrap }
.actv__plot {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px;
  height: 180px; padding-bottom: 22px; border-bottom: 1px solid var(--line); position: relative;
}
.actv__col {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  height: 100%; padding: 0; border: 0; background: none; border-radius: 8px; cursor: pointer;
  font: inherit; color: inherit;
}
.actv__col:disabled { cursor: default }
.actv__col:hover:not(:disabled) .actv__stack, .actv__col:focus-visible .actv__stack { filter: brightness(1.08); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink) }
.actv__col:focus-visible { outline: none }
.actv__colnum { font-size: 12px; font-variant-numeric: tabular-nums; margin-bottom: 6px }
.actv__stack {
  display: flex; flex-direction: column-reverse; width: min(100%, 44px); min-height: 0;
  border-radius: 6px; overflow: hidden; transform-origin: bottom;
  animation: actv-grow .45s cubic-bezier(.16, 1, .3, 1) both;
}
.actv__stack i { display: block; min-height: 2px }
.actv__tick {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 6px;
  font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.actv__col--now .actv__tick { color: var(--text); font-weight: var(--weight-strong) }
@keyframes actv-grow { from { transform: scaleY(0) } }
@media (prefers-reduced-motion: reduce) { .actv__stack { animation: none } }

.actv__feed { display: flex; flex-direction: column; gap: 22px }
/* Getting started: the feed has nothing in it, so it holds the room its veil's card needs. */
.actv__feed--empty { min-height: 200px }
.actv__day { display: flex; flex-direction: column; scroll-margin-top: calc(var(--topbar-h) + 16px) }
.actv__date { display: flex; align-items: baseline; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--hair) }
.actv__date b { font-size: 14px }
.actv__daycount { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums }
.actv__row {
  display: grid; grid-template-columns: 32px minmax(0, 1.1fr) minmax(0, 1.4fr) auto auto; align-items: center; gap: 14px;
  margin: 0 -10px; padding: 9px 10px; min-height: 52px; border-radius: 12px; cursor: pointer;
}
.actv__row + .actv__row { box-shadow: inset 0 1px 0 var(--hair) }
.actv__row:not([role]) { cursor: default }
.actv__row[role]:hover { background: var(--page); box-shadow: none }
.actv__row[role]:hover + .actv__row { box-shadow: none }
.actv__row:focus-visible { outline: 2px solid var(--ink); outline-offset: 0 }
.actv__mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--coral); color: var(--on-coral); font-size: 11.5px; font-weight: var(--weight-strong);
}
.actv__who { display: flex; flex-direction: column; min-width: 0 }
.actv__name, .actv__co { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.actv__name { font-size: 13.5px }
.actv__co { font-size: 12.5px; color: var(--muted) }
.actv__what { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px }
.actv__what .actv__glyph { display: inline-grid; place-items: center; width: 18px; flex: 0 0 18px; color: var(--tone) }
.actv__what .actv__glyph > * { margin: 0 }
.actv__what .actv__glyph .ms { font-size: 17px }
.actv__text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.actv__actor {
  width: 26px; height: 26px; border-radius: var(--r-pill); display: grid; place-items: center;
  background: var(--page); color: var(--muted); font-size: 10.5px; font-weight: var(--weight-strong);
}
.actv__actor.is-none { visibility: hidden }
.actv__time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right }
.actv__more { align-self: flex-start; margin-top: 8px }
.actv__empty { display: grid; place-items: center; gap: 8px; padding: 48px 16px; color: var(--muted) }
.actv__empty .ms { font-size: 40px }
@media (max-width: 760px) {
  .actv__plot { gap: 3px; height: 140px }
  .actv__colnum { display: none }
  /* The row folds to two lines: who on top, what happened under it. */
  .actv__row { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "mark who time" "mark what what"; row-gap: 2px }
  .actv__mark { grid-area: mark; align-self: start }
  .actv__who { grid-area: who }
  .actv__what { grid-area: what }
  .actv__time { grid-area: time; align-self: start }
  .actv__actor { display: none }
}
