/* ==========================================================================
   Labour Life practice system: tasks.css. Owner: tasks (M5).
   The task list, New task, one task with its steps, and the notes
   (SPEC 7.5.2 to 7.5.5). Every class here starts with tk-. Nothing restates
   a class of the core files. Tokens only, no raw colours.
   Phone first: the base styles are the phone.

     .tk-phone-only, .tk-wide-only     shown under 720px only, from 720px only
     .tk-ref                           a reference number (LL-000123)
     .tk-who (__n)                     a person: avatar and name
     .tk-prog (__t)                    the progress bar and "3 of 21, 14%"
     .tk-meta, .tk-due (__t)           the badges of a row, a deadline with its badge
     .tk-title (__t __s), .tk-two (__s)   table cells with a second, quieter line
     .tk-col-prog, .tk-col-status, .tk-status-off   the Progress column, the Status column and its switch
     .tk-list                          the Tasks tab of a company or a worker
     .tk-filters (__top __btn __n __fields), .tk-sheet   the filters above the task list
     .tk-form (__note __foot), .tk-segf, .tk-refs (__rows __row), .tk-flowinfo (__steps __err)   New task
     .tk-eye, .tk-copy                 the reference with its Copy button above the title
     .tk-main, .tk-panel               the tabs of the task page, the body of a tab
     .tk-strip (__prog __row __v __step __meta __when)   where the task stands, under the header
     .tk-details, .tk-rows, .tk-row    the Details tab: label and value rows
     .tk-dd (__v), .tk-edit, .tk-cc, .tk-reflist, .tk-conf-line                    its rows
     .tk-steps (__top __foot), .tk-alldone   the step list
     .tk-step (.is-open .is-waiting .is-done .is-skipped .is-expanded)
       (__row __main __name __meta __note __details __chev __panel __why __h)   one step
     .tk-tick (.is-off .is-done .is-busy), .tk-num, .tk-count   the tick box, a waiting number, a small count
     .tk-pre                           text that keeps its line breaks
     .tk-smslist, .tk-sms (__top __to __body __err __meta)      the SMS tab
     .tk-notes (--step, __list __more __body __empty)           the notes
     .tk-notebox (__ta __foot __hint), .tk-mentions             the box to write, the @ list
     .tk-note (.is-flash, __b __top __who __when __step __text __acts)   one note
   ========================================================================== */

/* ---------- phone or computer ---------- */

.tk-wide-only { display: none; }
@media (min-width: 720px) {
  .tk-phone-only { display: none; }
  .tk-wide-only { display: inline-flex; }
}

/* ---------- small parts ---------- */

.tk-ref {
  font: 600 var(--fs-sm)/1.3 var(--font-mono);
  letter-spacing: 0; text-transform: none; white-space: nowrap;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
}

.tk-who { display: inline-flex; align-items: center; gap: var(--s2); min-width: 0; max-width: 100%; }
.tk-who__n { min-width: 0; overflow-wrap: anywhere; }

.tk-prog { display: grid; gap: var(--s1); min-width: 0; width: 100%; }
.tk-prog__t { font-size: var(--fs-sm); color: var(--ink-soft); line-height: var(--lh-snug); white-space: nowrap; }

.tk-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.tk-meta:empty { display: none; }

.tk-due { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.tk-due__t { color: var(--ink-mute); }

.tk-pre { white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- task tables ---------- */

.tk-title { display: grid; gap: 2px; min-width: 0; }
.tk-title__t { overflow-wrap: anywhere; }
.tk-title__s { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); font-size: var(--fs-sm); font-weight: 400; color: var(--ink-mute); }

.tk-two { display: grid; gap: 2px; min-width: 0; }
.tk-two__s { font-size: var(--fs-sm); color: var(--ink-mute); line-height: var(--lh-snug); }

@media (min-width: 720px) {
  .tk-col-prog { width: 150px; min-width: 130px; }
}
/* The Status column says something only when every status is listed. */
.tk-status-off th.tk-col-status, .tk-status-off td.tk-col-status { display: none; }
@media (max-width: 719px) { .tk-status-off .tbl--collapse td.tk-col-status { display: none; } }

.tk-list { display: grid; gap: var(--s3); min-width: 0; }

/* ---------- the filters above the task list ---------- */

.tk-filters { display: grid; gap: var(--s3); min-width: 0; }
.tk-filters__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); min-width: 0; }
.tk-filters__n {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 var(--s1);
  border-radius: var(--r-pill); background: var(--ink); color: var(--surface);
  font: 600 var(--fs-label)/1 var(--font-body);
}
/* On a phone the four fields sit behind the Filters button. From 720px they are in the page. */
.tk-filters__fields { display: none; }
@media (min-width: 720px) {
  .tk-filters__btn { display: none; }
  .tk-filters__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); max-width: 1000px; }
  .tk-filters__fields .field { margin-bottom: 0; }
}
.tk-sheet { display: grid; min-width: 0; }

/* ---------- New task ---------- */

.tk-form > .note { margin-bottom: var(--s4); }
.tk-form__note { margin-bottom: var(--s4); }
.tk-form__foot { margin-top: var(--s5); }
@media (max-width: 519px) {
  .tk-form__foot .btn { flex: 1 1 100%; min-height: var(--control-h-lg); }
}

.tk-segf { display: flex; min-width: 0; }

.tk-refs { display: grid; gap: var(--s2); min-width: 0; }
.tk-refs__rows { display: grid; gap: var(--s2); }
.tk-refs__rows:empty { display: none; }
.tk-refs__row { display: flex; align-items: center; gap: var(--s1); min-width: 0; }
.tk-refs__row .input { flex: 1; min-width: 0; }

.tk-flowinfo { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); font-size: var(--fs-sm); color: var(--ink-soft); }
.tk-flowinfo .link { min-height: var(--control-h-sm); }
.tk-flowinfo__steps { flex: 1 1 100%; margin: 0; padding-left: var(--s5); color: var(--ink); line-height: var(--lh-body); }
.tk-flowinfo__err { list-style: none; color: var(--danger-ink); font-weight: 600; }

/* ---------- one task: the header ---------- */

.tk-eye { display: inline-flex; align-items: center; gap: var(--s1); }
.tk-eye .tk-ref { font-size: var(--fs-body); color: var(--ink); }
/* The Copy button keeps its full size for a finger but does not push the title down. */
.tk-copy { margin: -8px 0; }

/* ---------- one task: the layout ----------
   The header, the strip of where the task stands, the tabs and the open tab,
   one under the other, the whole width of the page (19 Oct 2026, item 107).
   The details are the tab Details. */

.tk-main { display: grid; gap: var(--s4); min-width: 0; align-content: start; }
.tk-main > * { min-width: 0; margin-top: 0; }
.tk-panel { display: grid; gap: var(--s4); min-width: 0; }
.tk-panel > * { min-width: 0; }

/* ---------- where the task stands: the strip under the header ----------
   The progress, Now and Last side by side where the page has room, one under
   the other where it has not (a phone, or the page beside the composer).
   flex-wrap decides, so it follows the width of the page, not of the screen. */

.tk-strip {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s3) var(--s5);
  min-width: 0; padding: var(--s3) var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-soft);
}
.tk-strip__prog { flex: 1 1 100%; min-width: 0; }
.tk-strip__prog .tk-prog__t { font-size: var(--fs-body); font-weight: 600; color: var(--ink); }
.tk-strip__prog .progress { height: 8px; }
.tk-strip__row {
  flex: 1 1 260px; min-width: 0;
  display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: var(--s3); align-items: baseline;
}
.tk-strip__v { display: grid; gap: var(--s1); min-width: 0; overflow-wrap: anywhere; }
.tk-strip__step { justify-self: start; font-weight: 600; }
.tk-strip__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); font-size: var(--fs-sm); color: var(--ink-soft); }
.tk-strip__when { font-size: var(--fs-sm); color: var(--ink-mute); }
@media (pointer: coarse) {
  /* A finger gets a taller target on the link to the open step, without a taller strip. */
  .tk-strip__step { padding-block: 11px; margin-block: -11px; }
}
@media (min-width: 720px) {
  .tk-strip__prog { flex: 1 1 200px; max-width: 280px; align-self: center; }
}

/* ---------- Details: label and value rows ---------- */

.tk-details { max-width: 760px; min-width: 0; }
.tk-rows { display: grid; margin: 0; min-width: 0; }
.tk-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--s3); align-items: baseline; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.tk-row:first-child { border-top: 0; padding-top: 0; }
.tk-row:last-child { padding-bottom: 0; }
.tk-row dt { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-mute); line-height: var(--lh-snug); }
.tk-row dd { margin: 0; min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.tk-row dd.is-empty { color: var(--ink-mute); }
@media (min-width: 420px) {
  .tk-row { grid-template-columns: 8rem minmax(0, 1fr); }
}
@media (min-width: 720px) {
  .tk-row { grid-template-columns: 11rem minmax(0, 1fr); }
}

.tk-dd { display: flex; align-items: flex-start; gap: var(--s2); }
.tk-dd__v { flex: 1; min-width: 0; }
/* The small Change button sits in the row without making it taller. */
.tk-edit { margin: -6px calc(var(--s2) * -1) -6px 0; }

.tk-cc { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.tk-reflist { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); }
.tk-reflist .tk-ref { color: var(--ink); white-space: normal; overflow-wrap: anywhere; }

.tk-conf-line { display: flex; align-items: flex-start; gap: var(--s2); color: var(--ink-soft); font-size: var(--fs-sm); }
.tk-conf-line svg { flex: none; margin-top: 2px; }

/* ---------- the steps ---------- */

.tk-steps__top { display: grid; gap: var(--s3); min-width: 0; }
.tk-steps__top:empty { display: none; }
.tk-alldone { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); font-weight: 600; }

.tk-steps {
  margin: 0; padding: 0; list-style: none;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-soft);
}
.tk-step { border-top: 1px solid var(--line); min-width: 0; }
.tk-step:first-child { border-top: 0; }

/* The tick box on the left edge, the words, then the menu. One tap ticks, one tap opens. */
.tk-step__row { display: flex; align-items: flex-start; gap: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); min-width: 0; }
.tk-step__row > .icon-btn { margin-top: 4px; }

.tk-step__main {
  flex: 1; min-width: 0;
  display: grid; gap: var(--s1); align-content: center;
  min-height: var(--tap); padding: var(--s1) var(--s2);
  border: 0; border-radius: var(--r-sm); background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: pointer;
}
.tk-step__main:hover { background: var(--tint); }
.tk-step__name { font-weight: 600; line-height: var(--lh-snug); overflow-wrap: anywhere; }
.tk-step__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3);
  font-size: var(--fs-sm); color: var(--ink-soft); line-height: var(--lh-snug);
}
.tk-step__note, .tk-step__details { font-size: var(--fs-sm); color: var(--ink-soft); white-space: pre-line; overflow-wrap: anywhere; }
.tk-step__chev { display: grid; place-items: center; flex: none; width: var(--control-h-sm); height: var(--tap); color: var(--ink-mute); }

.tk-step.is-open { background: var(--surface); }
.tk-step.is-open .tk-step__name { font-size: var(--fs-lg); }
.tk-step.is-waiting .tk-step__name { font-weight: 500; color: var(--ink-soft); }
.tk-step.is-done .tk-step__name { font-weight: 500; }
.tk-step.is-skipped .tk-step__name { font-weight: 500; color: var(--ink-mute); text-decoration: line-through; }
.tk-step.is-expanded { background: var(--bg); }

/* The tick box: 44px, the largest thing in the row. */
.tk-tick {
  display: grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap); padding: 0;
  border: 2px solid var(--field-line); border-radius: var(--r-sm);
  background: var(--surface); color: transparent; cursor: pointer;
  transition: border-color var(--dur-1) ease, background-color var(--dur-1) ease, color var(--dur-1) ease;
}
button.tk-tick:hover { border-color: var(--success); color: var(--success); background: var(--success-bg); }
button.tk-tick:active { background: var(--success-line); }
.tk-tick.is-busy { border-color: var(--success); background: var(--success-bg); color: var(--success); cursor: default; }
.tk-tick.is-off { cursor: default; border-color: var(--line-strong); }
.tk-tick.is-done { border-color: var(--success); background: var(--success); color: var(--surface); cursor: default; }

.tk-num {
  display: grid; place-items: center; flex: none;
  width: var(--tap); height: var(--tap);
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  color: var(--ink-mute); font-weight: 600; font-variant-numeric: tabular-nums;
}

.tk-count { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-mute); }

.tk-step__panel {
  display: grid; gap: var(--s3); min-width: 0;
  padding: var(--s2) var(--s3) var(--s4);
}
.tk-step__panel > * { min-width: 0; }
.tk-step__why { display: grid; gap: var(--s1); }
.tk-step__h { margin-top: var(--s2); font: 700 var(--fs-lg)/var(--lh-tight) var(--font-display); }
@media (min-width: 720px) {
  .tk-step__panel { padding-left: calc(var(--s3) + var(--tap) + var(--s2) + var(--s2)); padding-right: var(--s4); }
}

.tk-steps__foot:empty { display: none; }

/* ---------- SMS ---------- */

.tk-smslist { margin: 0; padding: 0; list-style: none; }
.tk-sms { display: grid; gap: var(--s1); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); min-width: 0; }
.tk-sms:first-child { border-top: 0; }
.tk-sms__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); }
.tk-sms__to { font-weight: 600; margin-right: auto; }
.tk-sms__err { color: var(--danger-ink); font-size: var(--fs-sm); font-weight: 600; }
.tk-sms__meta { display: flex; flex-wrap: wrap; gap: 0 var(--s3); }

/* ---------- notes ---------- */

.tk-notes { display: grid; gap: var(--s4); min-width: 0; }
.tk-notes__body { min-width: 0; }
.tk-notes__body > .loading { padding: var(--s5) var(--s4); }
.tk-notes__list { margin: 0; padding: 0; list-style: none; display: grid; }
.tk-notes__more { display: flex; justify-content: center; padding-top: var(--s3); }
.tk-notes__more:empty { display: none; }
.tk-notes--step { gap: var(--s3); }

.tk-notebox { display: grid; gap: var(--s2); min-width: 0; }
.tk-notebox__ta { min-height: 5.5rem; resize: vertical; }
.tk-notebox__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.tk-notebox__hint { margin-left: auto; }

.tk-mentions { min-width: 0; }

.tk-note {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3);
  padding: var(--s3) var(--s2); margin: 0 calc(var(--s2) * -1);
  border-top: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background-color var(--dur-3) ease;
}
.tk-note:first-child { border-top: 0; }
.tk-note.is-flash { background: var(--red-wash); transition: none; }
.tk-note__b { display: grid; gap: var(--s1); min-width: 0; }
.tk-note__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s3); }
.tk-note__who { font-weight: 600; }
.tk-note__when { font-size: var(--fs-sm); color: var(--ink-mute); }
.tk-note__step { justify-self: start; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.tk-note__step:hover { color: var(--link-hover); }
.tk-note__text { line-height: var(--lh-body); overflow-wrap: anywhere; }
.tk-note__acts { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s1) 0 0 calc(var(--s3) * -1); }

/* ---------- contrast, motion, print ---------- */

@media (forced-colors: active) {
  .tk-tick, .tk-num { border-color: ButtonText; }
  .tk-tick.is-done { background: Highlight; color: HighlightText; forced-color-adjust: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tk-tick, .tk-note { transition: none; }
}

@media print {
  .tk-filters, .tk-edit, .tk-copy, .tk-notebox, .tk-note__acts { display: none !important; }
}

/* "Coming soon" on a switched-off button (SMS while it is paused). */
.tk-soon {
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong, currentColor);
  border-radius: var(--radius, 2px);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Item 120 (21 Oct 2026): pictures in notes. In the box, the pictures waiting to
   go with the note, each with a cross; under a note, its pictures, each a link
   to its document page. Small squares that wrap, never wider than the column. */
.tk-notebox__pics, .tk-note__pics { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.tk-notebox__pics[hidden] { display: none; }
.tk-notebox__pic { position: relative; width: 88px; height: 88px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--sunken); }
.tk-notebox__pic img, .tk-note__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tk-notebox__unpic { position: absolute; top: 2px; right: 2px; background: var(--surface); border-radius: var(--r-pill); }
.tk-note__pic { display: grid; place-items: center; width: 120px; height: 120px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--sunken); text-align: center; padding: 0; }
.tk-note__pic:focus-visible { outline-offset: 2px; }
.tk-note__pic-wait { padding: var(--s2); }
@media (max-width: 519px) { .tk-note__pic { width: 96px; height: 96px; } }

/* Item 119 (21 Oct 2026): the Time tab. The timer bar, then one line per entry. */
.tk-time { display: grid; gap: var(--s3); min-width: 0; }
.tk-time__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.tk-time__on { display: inline-flex; align-items: center; gap: var(--s1); color: var(--danger-ink); font-weight: 600; }
.tk-time__clock { font-size: var(--fs-lg, 1.125rem); font-weight: 700; }
.tk-time__total { margin-left: auto; font-weight: 600; }
.tk-time__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.tk-time__row { display: grid; grid-template-columns: 8.5rem minmax(0, 10rem) 6rem minmax(0, 1fr) 2.75rem; gap: var(--s2); align-items: center;
  padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.tk-time__note { overflow-wrap: anywhere; }
.tk-time__when { display: grid; }
.tk-time__span { font-size: var(--fs-sm); color: var(--ink-mute); }
.tk-time__form { display: grid; gap: var(--s3); }
@media (max-width: 719px) {
  .tk-time__row { grid-template-columns: minmax(0, 1fr) auto 2.75rem; }
  .tk-time__who, .tk-time__note { grid-column: 1 / -1; }
  .tk-time__total { margin-left: 0; width: 100%; }
}
