.run-history-workspace,
.run-history-workspace *,
.run-history-workspace *::before,
.run-history-workspace *::after {
  box-sizing: border-box;
}

.run-history-workspace {
  --line: #d9dde4;
  --fa-control-font-size: 12px;
  --fa-control-height: 36px;
  font-family: var(--fa-font-sans);
  font-size: 16px;
  line-height: normal;
  text-align: left;
}

.run-history-workspace button,
.run-history-workspace input,
.run-history-workspace select {
  margin: 0;
  box-shadow: none;
  text-transform: none;
}

.run-history-workspace .history-filter {
  display: flex;
  gap: 0;
}

.run-history-workspace .history-filter select {
  min-height: 34px;
  margin: 0;
  padding: 0 32px 0 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.run-history-workspace .run-history-pagination label {
  display: flex;
  gap: 8px;
}

.run-history-workspace .run-history-pagination select {
  width: auto;
  min-width: 54px;
  min-height: 32px;
  margin: 0;
  padding: 0 24px 0 9px;
  box-shadow: none;
}

.run-history-workspace {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: #f9fafc;
  color: #182134;
}

.run-history-workspace button,
.run-history-workspace input,
.run-history-workspace select {
  font-family: inherit;
}

.run-history-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px var(--studio-gutter) 13px;
  background: #fff;
}

.history-load-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px;
  color: #657286;
  font-size: 12px;
}

.run-history-table-scroll > .history-load-more {
  position: sticky;
  bottom: 0;
  background: #fff;
}

.run-history-heading > div {
  min-width: 0;
}
.run-history-copy { grid-column: 2; grid-row: 1; text-align: center; }
.run-history-heading > .history-back { grid-column: 1; grid-row: 1; justify-self: start; }
.run-history-heading > .run-history-controls { grid-column: 3; grid-row: 1; }

.run-history-heading h1 {
  margin: 0 0 3px;
  font-size: 20px;
  line-height: 25px;
  letter-spacing: -.02em;
}

.run-history-heading h1:focus {
  outline: 0;
}

.run-history-heading p {
  max-width: 48ch;
  margin: 0 auto;
  text-wrap: balance;
  color: #6b778a;
  font-size: 11px;
  line-height: 16px;
}

.history-back {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #445166;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.history-back:hover,
.history-back:focus-visible {
  color: #182134;
}

.history-back:focus-visible {
  outline: 2px solid #255bd8;
  outline-offset: 3px;
}

.run-history-controls {
  display: grid;
  grid-template-columns: 176px;
  align-items: center;
  justify-content: end;
  gap: 9px;
  padding: 0;
  border: 0;
  background: #fff;
}

.history-filter {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 36px;
  border: 1px solid #cbd2dc;
  border-radius: 7px;
  background: #fff;
}

.history-filter select:focus {
  outline: 0;
}

.history-filter:focus-within {
  border-color: #255bd8;
  box-shadow: 0 0 0 2px rgb(37 91 216 / 16%);
}

.history-filter select {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 0 32px 0 10px;
  border: 0;
  border-radius: 6px;
  appearance: none;
  background: transparent;
  color: #445166;
  font-size: 11px;
  font-weight: 750;
  line-height: 16px;
  cursor: pointer;
}

.history-filter > [data-fa-icon] {
  position: absolute;
  right: 10px;
  color: #59667a;
  pointer-events: none;
}

.run-history-ledger {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  margin: 12px var(--studio-gutter) 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.run-history-controls[hidden] {
  display: none;
}

.run-history-table-scroll {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.run-history-table {
  width: 100%;
  min-width: 860px;
  table-layout: fixed;
  border-collapse: collapse;
}

.run-history-table th,
.run-history-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.run-history-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 42px;
  background: #f7f9fc;
  color: #69768a;
  font-size: 10px;
  font-weight: 750;
  line-height: 14px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.run-history-table th:first-child { width: 29%; }
.run-history-table th:nth-child(2) { width: 18%; }
.run-history-table th:nth-child(3) { width: 8%; }
.run-history-table th:nth-child(4) { width: 9%; }
.run-history-table th:nth-child(5) { width: 15%; }
.run-history-table th:last-child { width: 21%; }

.run-history-table tbody tr {
  min-height: 58px;
  background: #fff;
}

.run-history-table tbody tr.is-openable { cursor: pointer; }
.run-history-table tbody tr.is-openable:hover,
.run-history-table tbody tr.is-openable:focus-within {
  background: #fbfcfe;
}

.run-history-table tbody tr:last-child td {
  border-bottom: 0;
}

.run-history-table td:first-child strong,
.run-history-table td:nth-child(2) strong {
  display: block;
  overflow: hidden;
  color: #202b3d;
  font-size: 12px;
  font-weight: 750;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-history-table small {
  display: block;
  margin-top: 1px;
  color: #758196;
  font-size: 10px;
  line-height: 15px;
}

.run-history-table small:not(.run-credit-summary) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-credit-summary {
  white-space: normal;
  overflow-wrap: break-word;
}

.run-history-table td:nth-child(3),
.run-history-table td:nth-child(4) {
  color: #364257;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.run-history-table td:last-child {
  text-align: right;
}

.history-row-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid #cbd2dc;
  border-radius: 7px;
  background: #fff;
  color: #354158;
  font-size: 11px;
  font-weight: 750;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
}

.history-row-action:hover {
  border-color: #9ca7b7;
  background: #f8fafc;
  color: #182134;
}

.history-row-action:focus-visible {
  outline: 2px solid #255bd8;
  outline-offset: 2px;
}

.history-row-action > [data-fa-icon] {
  flex: 0 0 auto;
}

.history-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #546176;
  font-size: 11px;
  font-weight: 750;
  line-height: 16px;
  white-space: nowrap;
}

.history-status > [data-fa-icon] {
  flex: 0 0 auto;
}

.history-status.is-completed { color: #16824a; }
.history-status.is-failed { color: #b43d34; }
.history-status.is-active { color: #245fc1; }
.history-status.is-uncertain { color: #936300; }
.history-status.is-partial,
.history-status.is-paused { color: #9d5d0b; }
.history-status.is-stopped { color: #687487; }

.run-history-empty {
  display: grid;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 32px 20px;
  color: #738096;
  text-align: center;
}

.run-history-empty strong {
  color: #283448;
  font-size: 12px;
}

.run-history-empty p {
  margin: 0;
  font-size: 11px;
}

.history-unavailable {
  color: #758196;
  font-size: 10px;
}

.run-history-pagination {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #667286;
  font-size: 11px;
}

.run-history-pagination > div,
.run-history-pagination label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-history-pagination label {
  position: relative;
  white-space: nowrap;
}

.run-history-pagination :global(.fotogenic-ai-custom-select) {
  width: 76px;
  flex: none;
}

.run-history-pagination select {
  min-width: 54px;
  min-height: 32px;
  padding: 0 24px 0 9px;
  border: 1px solid #d1d6df;
  border-radius: 7px;
  appearance: none;
  background: #fff;
  color: #354158;
  font-size: 11px;
  cursor: pointer;
}

.run-history-pagination label > [data-fa-icon] {
  position: absolute;
  right: 7px;
  color: #5d687a;
  pointer-events: none;
}

.run-history-pagination > div > button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid #d1d6df;
  border-radius: 7px;
  background: #fff;
  color: #354158;
  cursor: pointer;
}

.run-history-pagination > div > button:hover:not(:disabled) {
  border-color: #9ca7b7;
  background: #f8fafc;
}

.run-history-pagination > div > button:focus-visible,
.run-history-pagination select:focus-visible {
  outline: 2px solid #255bd8;
  outline-offset: 2px;
}

.run-history-pagination > div > button:disabled {
  color: #c6ccd5;
  cursor: not-allowed;
  opacity: .65;
}

.run-history-pagination strong {
  min-width: 34px;
  color: #4b586d;
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 1060px) {
  .run-history-table th:first-child { width: 27%; }
  .run-history-table th:nth-child(2) { width: 17%; }
  .run-history-table th:last-child { width: 23%; }
}

@container fotogenic-studio (max-width: 820px) {
  .run-history-workspace {
    grid-template-rows: auto auto;
    height: auto;
    overflow: visible;
  }

  .run-history-ledger {
    grid-template-rows: auto auto;
    align-self: start;
  }
  .run-history-workspace { --fa-control-height: 44px; }
  .run-history-pagination select { min-height: 44px; }
  .run-history-pagination > div > button { width: 44px; height: 44px; }
  .run-history-heading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .run-history-copy { grid-column: 1 / -1; }
  .run-history-heading > .history-back { grid-row: 2; }
  .run-history-heading > .run-history-controls { grid-column: 2; grid-row: 2; }

  .history-back {
    align-self: center;
  }

  .run-history-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .history-filter {
    width: 100%;
  }

  .run-history-ledger {
    min-height: 0;
  }

  .run-history-table-scroll {
    max-height: none;
    overflow: visible;
  }

  .run-history-table {
    min-width: 0;
    table-layout: auto;
  }

  .run-history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .run-history-table tbody,
  .run-history-table tr,
  .run-history-table td {
    display: block;
  }

  .run-history-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 12px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
  }

  .run-history-table td {
    padding: 0;
    border: 0;
  }

  .run-history-table td:first-child {
    grid-column: 1 / -1;
  }

  .run-history-table td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .run-history-table td:nth-child(3),
  .run-history-table td:nth-child(4) {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 11px;
  }

  .run-history-table td:nth-child(3)::before,
  .run-history-table td:nth-child(4)::before {
    content: attr(data-label);
    color: #788498;
    font-size: 10px;
  }

  .run-history-table td:nth-child(5) {
    grid-column: 1 / -1;
    margin-top: 3px;
    min-height: 20.5px;
  }

  .run-history-table td:last-child {
    grid-column: 1 / -1;
    margin-top: 4px;
    text-align: left;
  }

  .run-history-table td:first-child strong,
  .run-history-table td:nth-child(2) strong,
  .run-history-table small {
    white-space: normal;
  }

  .history-row-action {
    width: 100%;
  }

  .run-history-pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .run-history-pagination > div {
    width: 100%;
    justify-content: space-between;
  }

  .run-history-pagination label > span {
    display: none;
  }
}

@container fotogenic-studio (max-width: 540px) {
  .run-history-workspace .history-filter select { min-height: 38px; }
  .run-history-heading { grid-template-columns: auto minmax(0, 1fr); gap: 6px; padding: 12px var(--studio-gutter) 10px; }
  .run-history-heading h1 { font-size: 18px; line-height: 23px; }
  .run-history-heading p { font-size: 10px; line-height: 14px; }
  .history-back { min-height: 30px; font-size: 10px; }
  .run-history-controls { gap: 7px; padding: 0; }
  .history-filter select { min-height: 38px; font-size: 10.5px; }
  .run-history-table tbody tr { gap: 4px 9px; padding: 9px var(--studio-gutter); }
  .run-history-table td:first-child strong,
  .run-history-table td:nth-child(2) strong { font-size: 10.5px; line-height: 15px; }
  .run-history-table small,
  .run-history-table td:nth-child(3),
  .run-history-table td:nth-child(4) { font-size: 9px; line-height: 13px; }
  .history-status { font-size: 9.5px; line-height: 14px; }
  .history-row-action { min-height: 36px; font-size: 10px; }
  .run-history-pagination { gap: 6px; padding: 8px var(--studio-gutter); font-size: 9.5px; }
  .run-history-pagination select { min-height: 38px; }
  .run-history-pagination > div > button { width: 38px; height: 38px; }
}
