/* Stream A, ticket T4: Progress, Site work, Re-tag routes. Variant-scoped rules only.
   The shared report grammar in engvision.css draws the lead, band, panels and
   table wrapper; this file adds only what these three routes need on top. */

/* Lead aside on Progress: two pace figures, then the eight-week spark. */
[data-design="engvision"] .ev-aud-pace { min-width: 0; }
[data-design="engvision"] .ev-aud-pace__figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ev-space-4);
  margin: 0;
}
[data-design="engvision"] .ev-aud-pace__figure { min-width: 0; }
[data-design="engvision"] .ev-aud-pace__label {
  display: block;
  margin: 0 0 var(--ev-space-2);
  color: var(--ev-muted);
  font-size: var(--ev-type-eyebrow);
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.3;
  text-transform: uppercase;
}
[data-design="engvision"] .ev-aud-pace__reading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--ev-space-1);
  margin: 0;
}
[data-design="engvision"] .ev-aud-pace__value {
  color: var(--ev-emphasis);
  font-size: var(--ev-type-metric);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
[data-design="engvision"] .ev-aud-pace__value--word { font-size: var(--ev-type-panel-title); line-height: 1.2; }
[data-design="engvision"] .ev-aud-pace__unit { color: var(--ev-muted); font-size: var(--ev-type-small); font-weight: 500; }
[data-design="engvision"] .ev-aud-pace__meta {
  margin: var(--ev-space-1) 0 0;
  color: var(--ev-muted);
  font-size: var(--ev-type-small);
  line-height: 1.4;
}

/* The spark figure on a white ground, ruled off from the lead above it. */
[data-design="engvision"] .ev-aud-spark {
  margin: var(--ev-space-5) 0 0;
  padding: var(--ev-space-4) 0 0;
  border-top: 1px solid var(--ev-rule);
}
[data-design="engvision"] .ev-aud-spark__note {
  margin: var(--ev-space-2) 0 0;
  color: var(--ev-muted);
  font-size: var(--ev-type-small);
  line-height: 1.4;
}

/* Headlines break into even lines rather than leaving one word alone. */
[data-design="engvision"] .ev-aud .ev-lead__headline { text-wrap: balance; }

/* A band value that is a word, not a number. */
[data-design="engvision"] .ev-aud-word { font-size: var(--ev-type-panel-title); line-height: 1.2; }

/* Quiet links to the related worklists, each a 44px target. */
[data-design="engvision"] .ev-aud-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--ev-space-5);
  margin: 0 0 var(--ev-grid-gap);
}
[data-design="engvision"] .ev-aud-links__link {
  min-height: var(--ev-control-height);
  display: inline-flex;
  align-items: center;
  gap: var(--ev-space-2);
  padding: 0;
  background: none;
  border: 0;
  color: var(--ev-link);
  font-size: var(--ev-type-body);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
[data-design="engvision"] .ev-aud-links__label { text-decoration: underline; text-underline-offset: 4px; }
[data-design="engvision"] .ev-aud-links__count {
  color: var(--ev-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Register tables. The shared rules give 14px text, rules and right-aligned
   numbers; row headers read as body text, not as column heads. */
[data-design="engvision"] .ev-aud-table tbody th {
  padding: var(--ev-space-3) var(--ev-space-4);
  border-bottom: 1px solid var(--ev-rule);
  color: var(--ev-text);
  font-size: var(--ev-type-table);
  font-weight: 600;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}
[data-design="engvision"] .ev-aud-table tbody tr:last-child th { border-bottom: 0; }
/* Numbers, dates and codes keep their line; text such as owners and notes
   wraps, so the columns that matter on a phone stay in view. A table still
   wider than its panel scrolls inside EvTableWrap with the first column pinned. */
[data-design="engvision"] .ev-aud-table td { vertical-align: middle; }
[data-design="engvision"] .ev-aud-table .num,
[data-design="engvision"] .ev-aud-table .ev-aud-table__nowrap { white-space: nowrap; }
[data-design="engvision"] .ev-aud-table .ev-aud-table__text { min-width: 8rem; }
[data-design="engvision"] .ev-aud-table td.ev-aud-table__action-cell { padding-top: 0; padding-bottom: 0; }
[data-design="engvision"] .ev-aud-table tbody th.ev-aud-table__action-cell { padding-top: 0; padding-bottom: 0; }
[data-design="engvision"] .ev-aud-table__group th,
[data-design="engvision"] .ev-aud-table__group td { background: var(--ev-surface-sunk); }
[data-design="engvision"] .ev-aud-table tbody .ev-aud-table__group-head { color: var(--ev-emphasis); font-weight: 700; }
[data-design="engvision"] .ev-aud-table tbody th.ev-aud-table__indent { padding-left: var(--ev-space-7); font-weight: 500; }
[data-design="engvision"] .ev-panel--flush .ev-aud-table tbody th.ev-aud-table__indent { padding-left: var(--ev-space-7); }
[data-design="engvision"] .ev-aud-table__sub {
  display: block;
  margin: var(--ev-space-1) 0 0;
  color: var(--ev-muted);
  font-size: var(--ev-type-small);
  font-weight: 500;
}
[data-design="engvision"] .ev-aud-table__sub--review { color: var(--ev-review); }
[data-design="engvision"] .ev-aud-table__flag { display: block; margin: var(--ev-space-1) 0 0; }
[data-design="engvision"] .ev-aud-table__candidate { display: block; white-space: nowrap; }
[data-design="engvision"] .ev-aud-muted { color: var(--ev-muted); font-weight: 500; }

/* The first column stays in view while a wide table scrolls sideways. */
[data-design="engvision"] .ev-aud-table thead th:first-child,
[data-design="engvision"] .ev-aud-table tbody tr:not(.ev-aud-table__group) th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--ev-surface);
}
/* A sticky cell paints over its neighbours' focus rings; the focused one
   rises so its whole ring shows. */
[data-design="engvision"] .ev-aud-table thead th:first-child:focus-within,
[data-design="engvision"] .ev-aud-table tbody tr:not(.ev-aud-table__group) th:first-child:focus-within { z-index: 2; }

/* Links inside table rows: a drill to a level or an asset. */
[data-design="engvision"] .ev-aud-link {
  min-height: var(--ev-control-height);
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ev-link);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
[data-design="engvision"] .ev-aud-codes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ev-space-1) var(--ev-space-3);
}
/* A long asset code (a real equipment tag can run well past "MC-1002") has
   no spaces, only hyphens, so unset white-space lets it break word-internal
   at those hyphens. Inside a narrow table column at 390px that turns one
   chip into many short wrapped lines and the row balloons to match, leaving
   the row's other, single-line cells centred in a mass of blank space
   above and below their text. Keeping each code on its own line and
   letting the flex-wrap container carry the wrap between chips instead
   fixes the row height without hiding or truncating any code. */
[data-design="engvision"] .ev-aud-codes .ev-aud-link { white-space: nowrap; }

/* Buttons that act on a panel or table. */
[data-design="engvision"] .ev-aud-button {
  min-height: var(--ev-control-height);
  display: inline-flex;
  align-items: center;
  gap: var(--ev-space-2);
  padding: 0 var(--ev-space-4);
  background: var(--ev-surface);
  border: 1px solid var(--ev-border-strong);
  border-radius: var(--ev-radius-control);
  color: var(--ev-emphasis);
  font-size: var(--ev-type-body);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
[data-design="engvision"] .ev-aud-button[aria-pressed="true"] { background: var(--ev-primary); border-color: var(--ev-primary); color: var(--ev-on-primary); }

/* Re-tag controls: one ruled row directly above the worklist tables. */
[data-design="engvision"] .ev-aud-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--ev-space-3) var(--ev-space-4);
  margin: 0 0 var(--ev-grid-gap);
  padding: var(--ev-space-4) 0;
  border-top: 1px solid var(--ev-rule);
  border-bottom: 1px solid var(--ev-rule);
}
[data-design="engvision"] .ev-aud-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--ev-space-1);
}
[data-design="engvision"] .ev-aud-field--search { flex: 1 1 16rem; max-width: 26rem; }
[data-design="engvision"] .ev-aud-field--level { flex: 0 1 13rem; }
[data-design="engvision"] .ev-aud-field__label { color: var(--ev-text-2); font-size: var(--ev-type-small); font-weight: 600; }
[data-design="engvision"] .ev-aud-field__input {
  width: 100%;
  min-width: 0;
  min-height: var(--ev-input-height);
  padding: 0 var(--ev-space-3);
  background: var(--ev-surface);
  border: 1px solid var(--ev-border-strong);
  border-radius: var(--ev-radius-control);
  color: var(--ev-text);
  font-size: var(--ev-type-body);
}
[data-design="engvision"] .ev-aud-controls__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ev-space-2);
  margin-left: auto;
}

[data-design="engvision"] .ev-aud-para { max-width: 72ch; margin: 0 0 var(--ev-space-3); line-height: 1.5; }
[data-design="engvision"] .ev-aud-para:last-child { margin: 0; }

@media (max-width: 760px) {
  [data-design="engvision"] .ev-aud-controls__actions { width: 100%; margin-left: 0; }
  [data-design="engvision"] .ev-aud-field--search,
  [data-design="engvision"] .ev-aud-field--level { flex: 1 1 100%; max-width: none; }
}

@media (max-width: 520px) {
  [data-design="engvision"] .ev-aud-word { font-size: var(--ev-type-body); }
  [data-design="engvision"] .ev-aud-pace__value { font-size: var(--ev-type-lead); }
  [data-design="engvision"] .ev-aud-pace__value--word { font-size: var(--ev-type-body); }
  [data-design="engvision"] .ev-aud-links { gap: 0 var(--ev-space-4); }
  [data-design="engvision"] .ev-aud-table tbody th { padding: var(--ev-space-3) var(--ev-space-3); }
  [data-design="engvision"] .ev-panel--flush .ev-aud-table tbody th:first-child { padding-left: var(--ev-panel-padding-compact); }
  [data-design="engvision"] .ev-aud-table tbody th.ev-aud-table__action-cell { padding-top: 0; padding-bottom: 0; }
  [data-design="engvision"] .ev-panel--flush .ev-aud-table tbody th.ev-aud-table__indent { padding-left: var(--ev-space-6); }
}
