/* One record per customer, on phones and narrow tablets (899px and below).
   The whole interaction fits on one phone screen: the six systems are one compact row of icon buttons,
   the system being shown is named right under the row, and the record below keeps only its newest
   moments, so a tap and its result are visible together without scrolling. Wider screens are untouched. */
@media (max-width: 899px) {
  /* The single column must never grow past the screen (the record was being cut off on the right). */
  .v5-follow { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .v5-follow > * { min-width: 0; }
  .v5-follow .label { margin-bottom: 10px; font-size: 14px; letter-spacing: 0.08em; line-height: 1.4; }

  /* The systems: one row of six icon buttons (52px tall), the shown system's name on a line underneath. */
  .v5-follow .journey { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; padding: 0 0 34px; }
  .v5-follow .journey > div[data-i] {
    position: static; min-height: 52px; padding: 0; align-items: center; justify-content: center;
    border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel);
    font-size: 0; line-height: 0; color: var(--muted);
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: color 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
  }
  /* The names stay readable to screen readers; on screen only the shown system's name appears, under the row. */
  .v5-follow .journey > div[data-i] b {
    position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); transform: none;
  }
  .v5-follow .journey > div.on b {
    left: 0; right: 0; bottom: 0; width: auto; height: auto; overflow: visible; clip-path: none;
    font-size: 16px; font-weight: 500; color: var(--ink); animation: rec-in 0.45s var(--ease);
  }
  .v5-follow .journey > div[data-i]:hover { color: var(--muted); }
  .v5-follow .journey > div[data-i]:hover b { transform: none; }
  .v5-follow .journey > div.past { border-color: var(--line-strong); color: var(--turquoise); }
  .v5-follow .journey > div.on { border-color: var(--accent); background: var(--raised); color: var(--turquoise); box-shadow: 0 0 0 3px var(--accent-soft); }
  .v5-follow .journey > div.next { border-color: var(--turquoise); animation: v5-chip-glow 1.6s ease-in-out infinite; }
  .v5-follow .journey > div.next b::after { display: none; }
  .v5-follow .journey > div[data-i]:focus-visible { outline: 2px solid var(--turquoise); outline-offset: 2px; }
  .v5-follow .sys-icon { display: inline-flex; position: static; color: inherit; }
  .v5-follow .sys-icon svg { width: 22px; height: 22px; }
  .v5-follow .sys-icon.fl-logo svg, .v5-follow .sys-icon.fl-logo img { width: 22px; height: 22px; }
  .v5-follow .sys-icon.fl-logo { padding: 4px; border-radius: 8px; }
  .v5-follow .journey > div.on .sys-icon.fl-logo { transform: none; }
  /* The traveling picture of the customer only works along the wide-screen line; the record already shows her. */
  .v5-follow .journey-avatar { display: none; }
  .v5-follow .journey-hint { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

  /* The record: the address bar goes, the header and figures tighten into a few short lines. */
  .v5-follow .dash { font-size: 15px; }
  .v5-follow .dash-top { display: none; }
  .v5-follow .dash-body { padding: 12px; }
  .v5-follow .dash-person { gap: 10px; margin-bottom: 10px; }
  .v5-follow .dash-person .avatar { width: 36px; height: 36px; flex: 0 0 36px; }
  .v5-follow .dash-person b { font-size: 16px; }
  .v5-follow .dash-person span { font-size: 14px; line-height: 1.35; display: block; }
  .v5-follow .dash-stats { gap: 6px; margin-bottom: 10px; }
  .v5-follow .dash-stats div { padding: 6px 10px; min-width: 0; }
  .v5-follow .dash-stats small { font-size: 14px; letter-spacing: 0.02em; text-transform: none; line-height: 1.3; }
  .v5-follow .dash-stats strong { font-size: 19px; display: block; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Each moment: the date and the system on a small line, then what happened. */
  .v5-follow .timeline { margin-bottom: 10px; }
  .v5-follow .timeline::before { top: 12px; bottom: 12px; }
  .v5-follow .timeline li { flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 0; padding: 5px 0 5px 26px; font-size: 15px; line-height: 1.4; }
  .v5-follow .timeline li::before { top: 11px; }
  .v5-follow .timeline li::after { content: ""; order: -1; flex: 0 0 100%; height: 2px; }
  .v5-follow .timeline .when { order: -2; min-width: 0; font-size: 14px; }
  .v5-follow .timeline .src { order: -2; margin-left: 0; font-size: 14px; padding: 0 7px; }
  /* While the record fills in, only the newest three moments show, the newest one highlighted;
     the space for three is kept so nothing below jumps. Without motion every moment shows. */
  .v5-follow.filling .timeline { min-height: 162px; }
  .v5-follow.filling .timeline li:not(.shown) { display: none; }
  .v5-follow.filling .timeline li.shown:not(.fresh):not(:has(+ li.fresh)):not(:has(+ li + li.fresh)) { display: none; }
  /* At the end the agent's answer needs the room, so the newest two moments stay. */
  .v5-follow.filling:has(.ask.shown) .timeline { min-height: 0; }
  .v5-follow.filling:has(.ask.shown) .timeline li.shown:not(.fresh):not(:has(+ li.fresh)) { display: none; }
  .v5-follow .timeline li.fresh { color: var(--ink); }
  .v5-follow .ask { padding: 10px 12px; }
  .v5-follow .ask .q { font-size: 14px; margin-bottom: 4px; }
  .v5-follow .ask .a { font-size: 15px; line-height: 1.45; }
  /* The agent's answer appears once the whole story is in, right under the moments. */
  .v5-follow.filling .ask:not(.shown) { display: none; }
  .v5-follow.filling .ask.shown { animation: rec-in 0.6s var(--ease); }
  .v5-follow .caption { font-size: 15px; margin-top: 12px; }
}
@keyframes v5-chip-glow { 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }
@media (max-width: 899px) and (prefers-reduced-motion: reduce) {
  .v5-follow .journey > div.next { animation: none; box-shadow: 0 0 0 3px var(--accent-soft); }
  .v5-follow .journey > div.on b, .v5-follow.filling .ask.shown { animation: none; }
}
