/* Production → Tasks: filter pills (§4.10) and task list items (§4.13). */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.filters a {
  padding: 5px 12px;
  border: var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.filters a[aria-current="page"] {
  border-color: var(--nav);
  background: var(--nav);
  color: var(--white);
}

.filters a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.tasks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tasks li {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: var(--border);
}

/* A task with a task view: its title's link covers the whole row. */
.tasks .tt a {
  color: inherit;
  text-decoration: none;
}

.tasks .tt a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.tasks li:has(.tt a) {
  transition: background-color var(--duration-fast) var(--ease);
}

.tasks li:has(.tt a):hover {
  background: var(--surface);
}

.tasks .tt a:focus-visible {
  outline: none;
}

.tasks li:has(.tt a:focus-visible) {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

/* The review-text task (§4.20): context chips under the header, then the text. */
.ctx {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -14px 0 18px;
}

.review-text__text {
  max-width: 72ch;
  line-height: 1.6;
}

.review-text__text p {
  margin: 0 0 12px;
}

.review-text__text p:last-child {
  margin-bottom: 0;
}

.tasks li:last-child {
  border-bottom: 0;
}

.tasks .ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--blue);
}

/* The text takes the row's width; on a phone the chip wraps below it instead. */
.tasks li > div {
  flex: 1;
  min-width: 0;
}

.tasks .tt {
  font-weight: 600;
}

.tasks .ds {
  color: var(--muted);
  font-size: 14px;
}

.tasks .when {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.tasks .rt {
  flex: none;
  margin-left: auto;
  text-align: right;
}

.tasks__empty {
  margin: 0;
  padding: 16px 20px;
  color: var(--muted);
}

.chip.err {
  background: var(--red-tint);
  color: var(--red);
}

@container app (max-width: 599px) {
  .tasks li {
    flex-wrap: wrap;
  }

  .tasks .rt {
    margin-left: 50px;
    text-align: left;
  }
}

/* "Return with comment": the comment form below the text, and the status while it is rewritten. */
#return_text {
  margin-top: 18px;
}

.review-text__help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.review-text__rewriting {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* A rewrite that did not pass: said above the text, which is the version from before. */
.review-text__failed {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  color: var(--red);
  font-size: 14px;
}

/* The form-error task: the form error with its explanation line, then the texts and the version list. */
.form-error__problems {
  margin: 0;
  font-weight: 600;
}

.form-error__explanation {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.form-error__explanation .ms {
  color: var(--blue);
}

.form-error__num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.t th.form-error__num {
  text-align: right;
}

/* The approve-texts task: the progress bar under the header, a row per short text with its chips,
   "Show text" and "Approve" on the right. */
.approve-texts__bar {
  max-width: 320px;
  margin-top: 10px;
}

.approve-texts__text {
  flex: 1;
  min-width: 0;
}

.approve-texts__ctx {
  margin: 6px 0;
}

.approve-texts summary {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.approve-texts details .review-text__text {
  margin-top: 8px;
}

/* Confirmations (#1349): a request of the person's AI per row, with its estimate and the two buttons. */
.confirmations {
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirmations > li {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: var(--border);
}

.confirmations > li:last-child {
  border-bottom: 0;
}

.confirmations .ic {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--blue);
}

.confirmations > li > div:not(.confirmations__actions) {
  flex: 1;
  min-width: 200px;
}

.confirmations .tt {
  font-weight: 600;
}

.confirmations .ds,
.confirmations .when {
  color: var(--muted);
  font-size: 14px;
}

.confirmations__estimate,
.confirmations__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0;
  padding: 0;
  list-style: none;
}

.confirmations__choices {
  color: var(--muted);
  font-size: 14px;
}

.confirmations__actions {
  display: flex;
  gap: 8px;
}

/* Open requests of the person in their other organizations, each with its switch (#1818). */
.confirmations__elsewhere {
  margin-bottom: 16px;
}

.confirmations__elsewhere p {
  margin: 0 0 8px;
}

.confirmations__elsewhere ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.confirmations__elsewhere li {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.confirmations__empty {
  margin: 0;
  padding: 20px;
  color: var(--muted);
}
