/* The download panel (js/recipient-progress.js): a sheet over the page that
   says how the files are being saved, shows progress, and ends in a
   friendly result. The client's page and the producer's own both draw it,
   with the same classes. It is app.css's .overlay and .sheet (a bottom sheet
   on a phone); this adds the progress block and the "Download one by one"
   queue, whose states are coloured words (app.css's .tag). Loaded after
   recipient.css.

     Preparing your download...               (title changes with the state)
     Putting your files in one zip file as they download. This works ...
     [==========-----------]  84 MB of 240 MB
     Now: IMG_0412.jpg
                                                    [ Cancel ]

   One by one, a queue under it:
     Download one by one
     IMG_0412.jpg        [Sent to your browser]   Send again
     IMG_0413.jpg        [Didn't download]        Try again

   A choice above one zip's limit is a plan in parts instead
   (js/recipient-parts-panel.js): the same sheet, with a notice for a large
   release, the parts as rows, and a status and a button on each.

     [ This is a large release (412 GB). ...                              ]
     [ [Download in parts] [Choose fewer files] [Get the file list]       ]
     This is 37.2 GB. It will download in 10 parts of up to 4 GB, ...
     Part 1  Wedding - part 01 of 10.zip                        [Saved]
             412 files, 3.9 GB
     Part 2  Wedding - part 02 of 10.zip                        [Downloading]
             [=======----------]  1.2 GB of 3.9 GB */

.rc-overlay { z-index: 60; }
.rc-dlp { max-width: 560px; }

.rc-dlp-how { margin: 0 0 var(--space-4); font-size: var(--text-l); line-height: 22px; color: var(--ink2); }
/* A sentence the page gives about the files of the run, above everything. */
.rc-dlp-note { margin: 0 0 var(--space-3); color: var(--ink2); }
.rc-dlp-result { margin: 0; font-size: var(--text-l); line-height: 22px; color: var(--ink); }
.rc-dlp-bar { height: var(--space-2); }
.rc-dlp-amount { margin: var(--space-2) 0 0; }
.rc-dlp-current { margin: var(--space-1) 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Files the server says are gone, by name, under the result. */
.rc-missing {
  margin: var(--space-3) 0 0;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  list-style: none;
  color: var(--ink2);
  font-size: var(--text-m);
  line-height: 18px;
  overflow-wrap: anywhere;
}
.rc-missing li + li { margin-top: var(--space-1); }

.rc-queue-title { margin: var(--space-4) 0 var(--space-2); font: 500 var(--text-ui)/20px var(--font-sans); color: var(--ink); }
.rc-queue {
  max-height: 40vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  list-style: none;
}
.rc-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  content-visibility: auto;
  contain-intrinsic-block-size: auto 36px;
}
.rc-queue-row + .rc-queue-row { border-top: 1px solid var(--line2); }
.rc-queue-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A phone keeps the row on one line; the name gives way to an ellipsis. */
@media (max-width: 520px) {
  .rc-queue-row { gap: var(--space-2); padding-inline: var(--space-2); }
  .rc-queue-row .btn { padding-inline: var(--space-1); }
}

/* --- a download in parts ------------------------------------------------ */

.rc-parts { max-width: 640px; }
.rc-parts-how { margin: 0 0 var(--space-3); }
.rc-parts-next { margin: 0 0 var(--space-2); }
.rc-parts-more { margin: var(--space-2) 0 0; }
.rc-parts-result { margin: 0 0 var(--space-3); }

/* The large-release notice and the free-space warning: calm, full width.
   The notice is information (callout.info), not the accent, which is for
   what the client chose: in callout.teal a heads-up reads as a
   selection. */
.rc-large { margin: 0 0 var(--space-4); max-width: none; }
.rc-large p { margin: 0 0 var(--space-3); font-size: var(--text-ui); line-height: 20px; }
.rc-large p.s { margin: var(--space-2) 0 0; font-size: var(--text-m); line-height: 18px; }
.rc-large [data-part=rc-file-list-progress]:empty { display: none; }
.rc-large-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.rc-parts-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  margin: 0 0 var(--space-3);
}

.rc-parts-list {
  max-height: 40vh;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  list-style: none;
}
.rc-part-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-2) var(--space-3);
}
.rc-part-row + .rc-part-row { border-top: 1px solid var(--line2); }

/* "Part 3" and its file name on one line when they fit; the size and any
   note under them. A producer's file name may have no break in it. */
.rc-part-main { display: flex; flex-wrap: wrap; align-items: baseline; min-width: 0; column-gap: var(--space-2); }
.rc-part-title { font-weight: 500; color: var(--ink); }
.rc-part-name { min-width: 0; color: var(--ink2); overflow-wrap: anywhere; }
.rc-part-size, .rc-part-note { flex-basis: 100%; overflow-wrap: anywhere; }
.rc-part-status { justify-self: start; }
.rc-part-progress { grid-column: 1 / -1; }
.rc-part-bar { height: var(--space-1); }
.rc-part-amount { margin: var(--space-1) 0 0; }

/* A phone: the name takes the whole row; status and button sit under it. */
@media (max-width: 520px) {
  .rc-part-row { grid-template-columns: minmax(0, 1fr) auto; padding-inline: var(--space-2); }
  .rc-part-main { grid-column: 1 / -1; }
}
