/* The toolbar's right-hand group (background actions, favourite, panel
   controls) keeps one rhythm: 24px cells, 6px apart, like the boxed tools. */
#transactions {
  min-width: var(--ui-toolbar-control);
  margin-inline-end: var(--ui-space-2);
  margin-inline-start: auto;
  padding-inline: 0;
}

#transactions .transaction_progress {
  display: flex;
  align-items: center;
  gap: var(--ui-space-2);
  min-width: var(--ui-toolbar-control);
  max-width: min(16rem, 100%);
  height: var(--ui-toolbar-control);
  min-height: 0;
  margin: 0;
  padding-inline: var(--ui-space-2);
}

/* Idle, the control is only its cog; the words appear while work runs.
   They remain the control's accessible name. */
#transactions .transaction_progress.idle {
  justify-content: center;
  padding-inline: 0;
}

#transactions .transaction_progress.idle .text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.transaction_progress .text {
  display: block;
  height: auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The cog matches the toolbar symbols beside it. */
.transaction_progress .transaction_icon {
  display: grid;
  place-items: center;
  flex: none;
  width: var(--ui-icon-size);
  height: var(--ui-icon-size);
  color: var(--color-text-secondary);
  line-height: 1;
}

.transaction_icon::before {
  font: var(--ui-toolbar-symbol-weight) var(--ui-icon-size)/1 var(--ui-icon-font-family);
  content: '\f013' var(--ui-icon-alt,);
}

@media (prefers-reduced-motion: no-preference) {
  #transactions:not([data-state='failed']) .transaction_progress:not(.idle) .transaction_icon {
    animation: fa-spin var(--ui-duration-background-work) linear infinite;
    /* Its own layer, so the slow turn is drawn at sub-pixel angles without a shake. */
    will-change: transform;
  }
}

.transactions.ui-popover:is(:popover-open, [data-popover-open]) {
  width: 24rem;
  padding: 0;
  color: var(--color-text);
  font-family: var(--ui-font-family);
  font-size: var(--ui-font-size-body);
  line-height: var(--ui-line-height-body);
  background: var(--color-input-background);
}

.transaction_heading,
.transaction_actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--ui-space-2);
  padding: var(--ui-space-2) var(--ui-space-4);
}

.transaction_heading .transaction_title {
  margin: 0;
  font-size: var(--ui-font-size-control);
  font-weight: var(--ui-weight-strong);
}

.transactions .button {
  min-width: var(--ui-touch-target);
  height: var(--ui-touch-target);
  margin: 0;
}

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

.transactions li {
  margin: 0;
  padding: var(--ui-space-3) var(--ui-space-4);
  border-block-start: 1px solid var(--color-border-faint);
}

.transactions li:has(.finished) {
  padding: 0;
}

.transactions .finished {
  display: grid;
  gap: var(--ui-space-1);
  box-sizing: border-box;
  width: 100%;
  min-height: var(--ui-touch-target);
  padding: var(--ui-space-3) var(--ui-space-4);
  color: inherit;
  font: inherit;
  text-align: start;
  background: transparent;
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.transactions .finished:hover {
  background: var(--color-toolbar-hover);
}

.transactions :is(button, .finished):focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: -2px;
}

.transaction_title,
.transaction_result {
  display: block;
  overflow-wrap: anywhere;
}

.transaction_title {
  font-weight: var(--ui-weight-medium);
}

.transaction_result {
  margin-block-start: var(--ui-space-1);
  font-size: var(--ui-font-size-small);
}

/* Stop on a running action that offers it. Once asked, "Stopping" replaces it. */
.transaction_stop {
  margin-block-start: var(--ui-space-2);
  min-height: var(--ui-touch-target);
}

.transaction_stopping {
  display: block;
  margin-block-start: var(--ui-space-1);
  font-size: var(--ui-font-size-small);
  font-style: italic;
}

.transactions .progress_bar {
  display: block;
  width: 100%;
  height: var(--ui-space-2);
  margin-block-start: var(--ui-space-2);
  overflow: hidden;
  background: var(--color-transactions-progress-track);
  border: 0;
  border-radius: var(--ui-radius-control);
  appearance: none;
}

.transactions .progress_bar::-webkit-progress-bar {
  background: var(--color-transactions-progress-track);
}

.transactions .progress_bar::-webkit-progress-value {
  background: var(--color-neutral);
}

.transactions .progress_bar::-moz-progress-bar {
  background: var(--color-neutral);
}

.transaction_status,
.transaction_empty {
  margin: 0;
  padding: var(--ui-space-3) var(--ui-space-4);
}

.transaction_status {
  border-block: 1px solid var(--color-attention);
}

.transaction_actions {
  justify-content: flex-end;
  border-block-start: 1px solid var(--color-border-faint);
}

.transactions [data-ui='transactions.refresh'] {
  padding-inline: var(--ui-space-6);
}

#transactions[data-state='failed'] .transaction_icon {
  color: var(--color-status-warning);
}
