/* ==========================================================================
   TeamTrek — the week mix
   --------------------------------------------------------------------------
   The small-business instrument, inside the shared panel frame.

   In a company of this size one person is billing, support, admin and sales
   in the same week, and nobody is only one of those. So the bar is not a
   day and not a place: it is a week, cut by the kind of work it went to,
   one bar per person.

   The segments keep the same order on every row -- billable, admin,
   support, sales -- because here the figure is read down a column rather
   than along a day. That is the opposite of the on-site page's bands, where
   the order is the order the day happened in.

   The frame around it lives in panel.css. Everything here is the
   instrument.
   ========================================================================== */
.mix {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: .875rem .875rem .5rem;
}

/* The scale, above the bars. The name column matches the rows' own. */
.mix__head,
.mix__row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) 4rem;
  gap: .75rem;
  align-items: center;
}
.mix__head {
  margin: 0 0 .5rem;
  font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--neutral-500);
}
.mix__head span:last-child { text-align: right; }

/* ------------------------------------------------------------- the rows */
.mix__rows { display: grid; grid-auto-rows: minmax(0, 1fr); gap: .375rem; min-height: 0; }

.mix__who { min-width: 0; font-size: .75rem; color: var(--neutral-500); }
.mix__who b {
  display: block;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* One week. Every bar is the same length because the figure compares how a
   week divided, not how long it was; the hours are stated beside it. */
.mix__bar {
  display: flex; gap: 2px;
  height: 24px;
  border-radius: var(--r-xs);
  background: var(--neutral-100);
  overflow: hidden;
}

/* One kind of work. Four tints of the one hue, so a column reads as more or
   less of the same thing rather than as four unrelated colours. */
.mix__seg {
  flex: var(--w, 1) 1 0;
  min-width: 2px;
  border-radius: 2px;
  background: var(--primary-200);
  transition: background-color var(--dur-ui) var(--ease-ui);
}
.mix__seg--bill    { background: var(--primary-700); }
.mix__seg--support { background: var(--primary-500); }
.mix__seg--admin   { background: var(--primary-300); }
/* The lightest of the four needs an edge, or a two-hour stretch of it at
   the end of a bar reads as the bar having run out. */
.mix__seg--sales   { background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--primary-200); }

/* The kind of work being read, from the rail. */
.mix__seg.is-now { box-shadow: inset 0 0 0 2px var(--primary-800); }

.mix__hours {
  text-align: right;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- the key */
.mix__foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .375rem 1rem;
  margin: .75rem 0 0; padding-top: .625rem;
  border-top: 1px solid var(--neutral-150);
  font-size: .625rem; color: var(--neutral-500);
}
.mix__key { display: inline-flex; align-items: center; gap: .375rem; }
.mix__key i { width: 11px; height: 11px; border-radius: 3px; background: var(--primary-700); }
.mix__key--support i { background: var(--primary-500); }
.mix__key--admin i   { background: var(--primary-300); }
.mix__key--sales i   { background: var(--primary-100); box-shadow: inset 0 0 0 1px var(--primary-200); }

@media (prefers-reduced-motion: reduce) {
  .mix__seg { transition: none; }
}

/* ------------------------------------------------------------- narrower */
@media (max-width: 959px) {
  .mix { padding: .75rem .75rem .5rem; }
  .mix__head,
  .mix__row { grid-template-columns: 7rem minmax(0, 1fr) 3.5rem; }
  .mix__rows { grid-auto-rows: 40px; }
}

/* --------------------------------------------------------------- phones */
@media (max-width: 599px) {
  .mix { padding: .625rem .5rem .5rem; }
  .mix__head,
  .mix__row { grid-template-columns: 5.5rem minmax(0, 1fr) 3.25rem; gap: .5rem; }
  .mix__head { font-size: .75rem; letter-spacing: .04em; }
  .mix__who b { font-size: .75rem; }
  .mix__who { font-size: 0; }
  .mix__hours { font-size: .75rem; }
  .mix__foot { font-size: .75rem; gap: .25rem .75rem; }
}
