/* ==========================================================================
   Labour Life practice system: search.css. Owner: search (M4).
   The search screen (SPEC 7.4, and 7.6.7 for emails). Every class here starts with srch-. Nothing
   restates a class of the core files. Tokens only, no raw colours.
   Phone first: the base styles are the phone.

     .srch-box                  the search box under the page heading
     .srch-results              the groups, or the hint, or "Nothing found"
     .srch-group (__h __t)      one group: Companies, Workers, Documents, Tasks
     .srch-list                 the rows of a group, inside a flush card
     .srch-row (__top __t __sub)  one result: a full-width link of two lines
     .srch-dot, .srch-part      the middle dot between the parts of the second line
     .srch-code, .srch-figs     a code, and figures that line up (an ID number)
     .srch-ref                  a task's system reference (LL-000123), before its title
     .srch-date                 the date of an email, at the end of its first line
     .srch-snip                 the text of an email round the matched word, two lines at most
     .srch-files, .srch-clip    the attachment names of an email behind a paperclip
     .srch-chips, .srch-chip    what an email is linked to: a company code, a task reference
     .srch-more, .srch-foot     "Showing the first 8. Show all", and "Load more"
     .srch-back                 "All results"
   ========================================================================== */

.srch-box { max-width: none; }

.srch-results { display: grid; gap: var(--s5); min-width: 0; }
.srch-results[aria-busy="true"] { opacity: .6; transition: opacity var(--dur-2) ease var(--dur-2); }

/* ---------- a group ---------- */

.srch-group { display: grid; gap: var(--s2); min-width: 0; }
.srch-group__h {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4);
}
.srch-group__t {
  display: inline-flex; align-items: center; gap: var(--s2);
  font: 600 var(--fs-label)/1.25 var(--font-display);
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-soft);
}
.srch-back {
  display: inline-flex; align-items: center; gap: var(--s1);
  min-height: var(--tap); font-size: var(--fs-sm); font-weight: 600;
}

/* ---------- the rows ---------- */

.srch-list { list-style: none; margin: 0; }
.srch-list > li + li { border-top: 1px solid var(--line); }

.srch-row {
  display: grid; gap: 2px; min-width: 0; min-height: var(--tap);
  padding: var(--s3) var(--s4);
  color: var(--ink); text-decoration: none;
}
.srch-row:hover { background: var(--tint); }
.srch-row:active { background: var(--tint-2); }
.srch-row:focus-visible { outline-offset: -3px; }

.srch-row__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); min-width: 0; }
.srch-row__t { font-weight: 600; line-height: var(--lh-snug); overflow-wrap: anywhere; min-width: 0; }
.srch-row__sub {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); min-width: 0;
  font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--ink-mute);
}
.srch-part { min-width: 0; overflow-wrap: anywhere; }
.srch-dot { color: var(--ink-disabled); }
.srch-code { font-weight: 600; color: var(--ink-soft); }
.srch-figs { font-variant-numeric: tabular-nums; white-space: nowrap; }
.srch-ref {
  font: 600 var(--fs-sm)/1.3 var(--font-mono);
  font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-soft);
}

/* ---------- an email (Phase 3) ---------- */

.srch-date {
  margin-left: auto; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; color: var(--ink-mute);
}
.srch-snip {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  font-size: var(--fs-sm); line-height: var(--lh-snug); color: var(--ink-soft); overflow-wrap: anywhere;
}
.srch-files {
  display: flex; align-items: flex-start; gap: var(--s1); min-width: 0;
  font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--ink-mute);
}
.srch-clip { display: inline-grid; place-items: center; flex: none; height: calc(var(--fs-sm) * var(--lh-body)); color: var(--ink-soft); }
.srch-chips { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: 2px; }
/* A task's tag holds its title since 12 Nov 2026 (decision 473): one line, cut short with an ellipsis; the tooltip
   holds all of it. inline-block, not inline-flex: an ellipsis needs the text to be the box's own. */
.srch-chip {
  display: inline-block; max-width: min(100%, 44ch); padding: 2px var(--s2);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--sunken);
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; vertical-align: top;
}

/* ---------- under a group ---------- */

.srch-more { padding: 0 var(--s1); }
.srch-more .link { display: inline-block; padding: var(--s2) 0; font-weight: 600; }
.srch-foot { display: grid; justify-items: start; gap: var(--s2); }
.srch-foot:empty { display: none; }
@media (max-width: 719px) {
  .srch-foot .btn { width: 100%; }
}

@media (min-width: 720px) {
  .srch-row { padding: var(--s3) var(--s5); }
}
