/* ==========================================================================
   TeamTrek — the day trail
   --------------------------------------------------------------------------
   The complete-records instrument, inside the shared panel frame.

   Every other panel on the site sums something. This one does the opposite:
   it lays one day out end to end and shows that the stretches meet. A
   record is only evidence if nothing is missing, and the only way to show
   nothing is missing is to draw the whole day, including the parts that are
   not work.

   So the break is on the panel. It is drawn as a gap rather than coloured
   as an absence, and the row says what it was. A figure that quietly left
   it out would be making the page's claim by omission.

   Each row's width is its share of the day, so a reader can see the shape
   of the day as well as read it.

   The frame around it lives in panel.css. Everything here is the
   instrument.
   ========================================================================== */
.trail {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  padding: .875rem .875rem .5rem;
}

.trail__head,
.trail__row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 10rem 4rem;
  gap: .75rem;
  align-items: center;
}
.trail__head {
  margin: 0 0 .5rem;
  font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--neutral-500);
}
.trail__head span:last-child { text-align: right; }

/* ------------------------------------------------------------- the rows */
.trail__rows { display: grid; grid-auto-rows: minmax(0, 1fr); gap: .375rem; min-height: 0; }

.trail__when {
  font-size: .75rem; color: var(--neutral-600);
  font-variant-numeric: tabular-nums;
}

/* One stretch of the day, as wide as its share of it. The track behind it
   is the whole day, so a short stretch is visibly short. */
.trail__track {
  height: 22px;
  border-radius: var(--r-xs);
  background: var(--neutral-100);
  overflow: hidden;
}
.trail__seg {
  display: block; height: 100%;
  width: calc(var(--w, 0) * 1%);
  margin-left: calc(var(--at, 0) * 1%);
  border-radius: 2px;
  transition: background-color var(--dur-ui) var(--ease-ui);
}
.trail__seg--timed   { background: var(--primary-700); }
/* Recorded while there was no connection, and sent on when there was one.
   Hatched rather than tinted, because the hours are as real as the timed
   ones and only their journey was different. */
.trail__seg--offline {
  background: repeating-linear-gradient(
    135deg,
    var(--primary-400) 0 6px,
    var(--primary-200) 6px 12px
  );
}
.trail__seg--manual {
  background: var(--primary-100);
  box-shadow: inset 0 0 0 1.5px var(--primary-400);
}
/* Not work. Drawn, because leaving it out would be the one thing this
   panel must not do. */
.trail__seg--break {
  background: var(--neutral-200);
  box-shadow: inset 0 0 0 1px var(--neutral-300);
}

.trail__what { min-width: 0; font-size: .75rem; color: var(--neutral-500); }
.trail__what b {
  display: block;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.trail__long {
  text-align: right;
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}
.trail__row--break .trail__long { font-weight: 400; color: var(--neutral-500); }

/* The stretch being read, from the rail. */
.trail__row.is-now .trail__seg { box-shadow: inset 0 0 0 2px var(--primary-800); }
.trail__row.is-now .trail__what b { color: var(--primary-700); }

/* --------------------------------------------------------------- the key */
.trail__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);
}
.trail__key { display: inline-flex; align-items: center; gap: .375rem; }
.trail__key i { width: 11px; height: 11px; border-radius: 3px; background: var(--primary-700); }
.trail__key--offline i {
  background: repeating-linear-gradient(
    135deg,
    var(--primary-400) 0 3px,
    var(--primary-200) 3px 6px
  );
}
.trail__key--manual i {
  background: var(--primary-100);
  box-shadow: inset 0 0 0 1.5px var(--primary-400);
}
.trail__key--break i { background: var(--neutral-200); box-shadow: inset 0 0 0 1px var(--neutral-300); }

@media (prefers-reduced-motion: reduce) {
  .trail__seg { transition: none; }
}

/* ------------------------------------------------------------- narrower */
@media (max-width: 959px) {
  .trail { padding: .75rem .75rem .5rem; }
  .trail__head,
  .trail__row { grid-template-columns: 5rem minmax(0, 1fr) 8rem 3.5rem; }
  .trail__rows { grid-auto-rows: 40px; }
}

/* --------------------------------------------------------------- phones */
@media (max-width: 599px) {
  .trail { padding: .625rem .5rem .5rem; }
  /* The bar goes: at this width it is forty pixels of decoration, and the
     row's own words say the same thing better. */
  .trail__head,
  .trail__row { grid-template-columns: 4.5rem minmax(0, 1fr) 3.5rem; gap: .5rem; }
  .trail__head span:nth-child(2) { display: none; }
  .trail__track { display: none; }
  .trail__head { font-size: .75rem; letter-spacing: .04em; }
  .trail__when { font-size: .75rem; }
  .trail__long { font-size: .75rem; }
  .trail__foot { font-size: .75rem; gap: .25rem .75rem; }
}

/* ==========================================================================
   The record panel in section 04
   --------------------------------------------------------------------------
   The panel the goal pages share: a head, three people and the team row
   they add up to, each carrying a line of apps or captures when those
   switches are on.

   The height holds all of it, so the team total is on the panel rather
   than one scroll below it -- the row the section's claim rests on cannot
   be the row a reader has to go looking for.
   ========================================================================== */
@media (min-width: 860px) {
  [data-records] .report__preview {
    max-height: 18rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
