/* ==========================================================================
   Backups
   The three facts above the list, the list of backups with its progress bar,
   and the start dialog's words. Every class here starts backup, so nothing
   on another page can match it. Widths are never fixed: everything wraps
   from 1920 down to 320.
   ========================================================================== */

/* --- what a backup is, said before the list ------------------------------- */

.backup-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.backup-fact {
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.backup-fact__title {
  margin: 0 0 4px;
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--txt);
}

.backup-fact p {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--txt-2);
}

/* One under another once three side by side would leave a few words a line. */
@container content (max-width: 900px) {
  .backup-facts { grid-template-columns: minmax(0, 1fr); }
}

@supports not (container-type: inline-size) {
  @media (max-width: 1100px) {
    .backup-facts { grid-template-columns: minmax(0, 1fr); }
  }
}

/* --- the list -------------------------------------------------------------- */

.backup-table__when { white-space: nowrap; }

.backup-table__state { min-width: 220px; }

/* A long name wraps over two lines rather than one word a line. */
.backup-table__by { min-width: 120px; overflow-wrap: anywhere; }

.backup-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.backup-progress__words {
  font-size: var(--fs-sm);
  color: var(--txt-2);
  overflow-wrap: anywhere;
}

.backup-progress__bar {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 6px;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--line);
}

.backup-progress__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 0.4s var(--ease);
}

.backup-table__note {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--txt-3);
  overflow-wrap: anywhere;
}

.backup-table__note--bad { color: var(--bad-fg); }

.backup-table .col-actions { width: 1%; }
.backup-table__actions { white-space: nowrap; }

.backup-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: var(--sp-2);
}

/* A table on a tablet or a 1280/1366 laptop has no room for both buttons
   side by side beside six columns: they stand one above the other there,
   and side by side only where the content column is wide. */
@container content (max-width: 1150px) {
  .backup-table__actions { white-space: normal; }
  .backup-actions { flex-wrap: wrap; }
  .backup-table__state { min-width: 170px; }
}

@supports not (container-type: inline-size) {
  @media (max-width: 1330px) {
    .backup-table__actions { white-space: normal; }
    .backup-actions { flex-wrap: wrap; }
  }
}

/* Stacked on a narrow column: the state's words read under their label
   rather than squeezed beside it, and the buttons sit at the row's foot. */
@container content (max-width: 760px) {
  .backup-table__state,
  .backup-table__by { min-width: 0; }
  .backup-table__actions { white-space: normal; padding-top: 8px; }
  .backup-actions { flex-wrap: wrap; }
  .backup-progress__bar { max-width: none; }
}

/* Under a finger every button here is a full 42px box. */
@media (pointer: coarse) {
  .backup-actions .btn,
  .backup-make { height: 42px; }
}

/* --- the start dialog ------------------------------------------------------ */

.confirm__box.backup-dialog { width: min(500px, 100%); }

.backup-dialog__words {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  text-align: left;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--txt-2);
}

.backup-dialog__words p { margin: 0; }

.backup-dialog__warn {
  padding: 9px 12px;
  border: 1px solid var(--warn);
  border-radius: var(--r-md);
  background: var(--warn-bg);
  color: var(--warn-fg);
}

.backup-dialog__warn strong { font-weight: var(--fw-bold); }

.backup-dialog__problem {
  align-self: stretch;
  border-color: var(--bad);
  background: var(--bad-bg);
  color: var(--bad-fg);
  text-align: left;
}
