/* What the producer's page shows of a file's availability and of the trail: a
   retracted file struck through with its reason, a file Theirway removed, the
   summary row above the files, the Retract, Reinstate and Prune sheets, and
   the Trail panel. Loaded after delivery-file-rows.css and file-meta.css,
   whose row, tile, sheet-field and count classes it reuses.
   Scripts: js/delivery-availability.js, delivery-availability-sheet.js,
   delivery-pruning.js, delivery-trail.js.

   A retracted row:

     [prog]  setup-2.4.1.msi  (struck through)                   [#] [x]
             48.2 MB   SHA-256 9f2c…e1a0 [Copy]
             [Retracted]  Your client reads: Breaks USB on rev B.

   Colours and sizes are tokens; the tags are app.css's .tag. */

/* --- a retracted file ------------------------------------------------------ */

.up-cell.is-retracted .up-name,
.up-cell.is-retracted .up-name-head,
.up-cell.is-retracted .up-name-tail { text-decoration: line-through; }
.up-cell.is-retracted .up-name,
.up-cell.is-removed .up-name { color: var(--mute); }

/* The line under a row's facts: a tag, then words that wrap under it on a
   phone rather than push the page sideways. */
.up-state {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  margin: var(--space-1) 0 0;
  min-width: 0;
}
.up-state .s { min-width: 0; overflow-wrap: anywhere; }

/* Download and Release beside a held file are text buttons: a finger gets the
   full control height, as the request panel's do (request.css). That is
   --control-l: --control is 44px only on a narrow screen, and a touch
   screen can be wider than that. */
@media (pointer: coarse), (max-width: 820px) {
  .up-state .btn.link.sm,
  .release-row .btn.sm { min-height: var(--control-l); }
}

/* The row above the files: "38 available, 3 retracted (3.1 GB)" and its chip. */
.up-availability { align-items: center; }
.up-availability:empty { display: none; }

/* Six buttons do not fit beside "2 selected" in the panel's column: the words
   go above them. */
.up-select-bar .up-summary-in { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.up-select-actions { justify-content: flex-start; }

/* Two groups of switches in Advanced options keep a step between them. */
.options .options-group + .options-group { margin-top: var(--space-4); }

/* --- the sheets -------------------------------------------------------------- */

#availability-sheet textarea { min-height: 88px; }
#availability-sheet .body p { margin: 0 0 var(--space-3); }
#availability-sheet .body .s { color: var(--ink2); }
/* Release: the files with the path the client will read, and Download beside
   each (js/delivery-release.js). The path is a stranger's word: it wraps. */
/* The title may carry a stranger's name, up to 80 characters with no break. */
#release-title { min-width: 0; overflow-wrap: anywhere; }
.release-list { margin: 0 0 var(--space-3); padding: 0; list-style: none; }
.release-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--line2);
}
.release-path { min-width: 0; overflow-wrap: anywhere; font-weight: 500; unicode-bidi: isolate; }
@media (max-width: 480px) {
  .release-row { grid-template-columns: minmax(0, 1fr) auto; }
  .release-row .btn { grid-column: 1 / -1; justify-self: start; margin-top: var(--space-1); }
}
.prune-kept-list { margin: 0 0 var(--space-3); padding-left: var(--space-5); overflow-wrap: anywhere; }

/* --- removed files: the lines a prune left, under the file list ------------- */

.removed-files { margin: var(--space-3) var(--space-1) 0; }
.removed-files > summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-s);
  list-style: none;
  cursor: pointer;
  border-radius: var(--radius-s);
  color: var(--ink2);
  font: 500 var(--text-m)/18px var(--font-sans);
}
.removed-files > summary::-webkit-details-marker { display: none; }
.removed-files > summary::after {
  content: "";
  flex: none;
  width: var(--icon-m);
  height: var(--icon-m);
  background: var(--mute);
  transition: transform var(--dur-fast) var(--ease-out);
  -webkit-mask: var(--chevron) center/contain no-repeat;
  mask: var(--chevron) center/contain no-repeat;
}
.removed-files[open] > summary::after { transform: rotate(180deg); }
.removed-files > .s { margin: var(--space-1) 0 var(--space-3); }
.removed-list { margin: 0; padding: 0; list-style: none; }
.removed-row {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
}
.removed-name { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.removed-size { white-space: nowrap; }
.removed-facts { grid-column: 1 / -1; min-width: 0; }
.removed-full { margin: var(--space-1) 0 0; }
/* The whole checksum: one click selects all of it, and it wraps anywhere. */
.removed-full code { overflow-wrap: anywhere; user-select: all; font: 400 var(--text-m)/18px var(--font-mono); }
.removed-when { margin: var(--space-1) 0 0; }

/* --- the trail ----------------------------------------------------------------- */

.trail > .s { margin: 0 0 var(--space-3); }
.trail-list { margin: 0 0 var(--space-3); }
.trail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: var(--space-3);
  row-gap: var(--space-1);
}
.trail-what { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.trail-when { white-space: nowrap; }
.trail-reason-line,
.trail-via { grid-column: 1 / -1; margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* A reason may hold line breaks; show them, here and on the row. */
.trail-reason-line,
.up-state [data-part=retraction-reason] { white-space: pre-line; }
