.all-history-section {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}

.all-history-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  font-size: 12px;
  color: #b8bec9;
}

.all-history-badge[data-state="ready"] {
  color: #8ee5b0;
  border-color: rgba(81, 199, 126, .28);
}

.all-history-badge[data-state="running"] {
  color: #f4c86d;
  border-color: rgba(244, 200, 109, .32);
}

.all-history-badge[data-state="off"] {
  color: #e68b8b;
  border-color: rgba(230, 139, 139, .28);
}

.all-history-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 14px;
}

.all-history-stats > div {
  display: flex;
  flex-direction: column;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  background: rgba(0,0,0,.13);
}

.all-history-stats strong {
  font-size: 24px;
  line-height: 1.1;
  color: #fff;
}

.all-history-stats span {
  margin-top: 8px;
  color: #9199a8;
  font-size: 12px;
}

.all-history-overall {
  margin: 18px 0 10px;
  padding: 16px 18px;
  border: 1px solid rgba(225,179,82,.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(183,129,46,.1), rgba(0,0,0,.12));
}

.all-history-overall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.all-history-overall-head > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#all-history-overall-title {
  color: #bda06c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
}

#all-history-ratio {
  color: #f6f7f9;
  font-size: 16px;
}

#all-history-percent {
  color: #e1b352;
  font-size: 34px;
  line-height: 1;
  white-space: nowrap;
}

.all-history-progress {
  position: relative;
  height: 14px;
  margin: 15px 0 11px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

#all-history-progress-bar,
#all-history-failed-bar {
  position: absolute;
  top: 0;
  width: 0;
  height: 100%;
  transition: left .25s ease, width .25s ease;
}

#all-history-progress-bar {
  left: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(90deg, #b7812e, #e1b352);
}

#all-history-failed-bar {
  background: rgba(214, 98, 98, .62);
}

.all-history-progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #a9b0bc;
  font-size: 11px;
}

.all-history-progress-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.all-history-progress-legend strong {
  color: #f2f3f5;
}

.all-history-progress-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.all-history-progress-legend .is-success { background: #d9a847; }
.all-history-progress-legend .is-failed { background: #d66262; }
.all-history-progress-legend .is-pending { background: rgba(255,255,255,.2); }

.all-history-live {
  margin: 14px 0 8px;
  padding: 14px 16px;
  border: 1px solid rgba(225,179,82,.23);
  border-radius: 12px;
  background: rgba(183,129,46,.06);
}

.all-history-live[data-phase="error"] {
  border-color: rgba(230,139,139,.28);
  background: rgba(176,70,70,.06);
}

.all-history-live[data-phase="done"] {
  border-color: rgba(81,199,126,.24);
  background: rgba(81,199,126,.05);
}

.all-history-live-head,
.all-history-live-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.all-history-live-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.all-history-live-kicker {
  color: #9c8460;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
}

.all-history-live-head strong {
  color: #f6f7f9;
  font-size: 14px;
}

#all-history-live-counter {
  color: #f0c46b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.all-history-live-meter {
  height: 14px;
  margin: 12px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 999px;
  background: rgba(0,0,0,.26);
}

.all-history-live-meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b7812e, #e5b955);
  box-shadow: 0 0 14px rgba(225,179,82,.2);
  transition: width .35s ease;
}

.all-history-live[data-phase="waiting_rate_limit"] .all-history-live-meter i {
  animation: all-history-pulse 1.25s ease-in-out infinite;
}

.all-history-live-details span {
  color: #d5aa55;
  font-size: 11px;
  font-weight: 700;
}

.all-history-live-details strong {
  min-width: 0;
  overflow: hidden;
  color: #f5f6f8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#all-history-live-message {
  margin: 8px 0 0;
  color: #939aa7;
  font-size: 11px;
}

@keyframes all-history-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.all-history-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 8px;
}

.all-history-actions label {
  margin-left: auto;
  color: #9299a7;
  font-size: 12px;
}

.all-history-actions select {
  min-width: 118px;
}

.all-history-set-list {
  display: grid;
  gap: 8px;
  max-height: 330px;
  margin-top: 16px;
  overflow: auto;
}

.all-history-set-row {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 130px minmax(180px, auto);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  background: rgba(0,0,0,.12);
}

.all-history-set-row strong {
  color: #f5f6f8;
  font-size: 13px;
}

.all-history-set-row span,
.all-history-set-row small {
  color: #939aa7;
  font-size: 11px;
}

.all-history-set-meter {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
}

.all-history-set-meter i {
  display: block;
  height: 100%;
  background: #c7963f;
  border-radius: inherit;
}



.all-history-subtitle {
  margin: 20px 0 8px;
  color: #f5f6f8;
  font-size: 13px;
}

.all-history-items {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.all-history-items-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.all-history-items-head h4 {
  margin: 0;
  color: #f5f6f8;
  font-size: 14px;
}

.all-history-items-head p {
  margin: 5px 0 0;
  color: #939aa7;
  font-size: 11px;
}

.all-history-item-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.all-history-item-filters button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: #aab0bb;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.all-history-item-filters button[aria-pressed="true"] {
  color: #171108;
  border-color: #d8a94d;
  background: #d8a94d;
  font-weight: 700;
}

.all-history-item-filters span {
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

.all-history-item-list {
  display: grid;
  gap: 7px;
  max-height: 430px;
  overflow: auto;
}

.all-history-item-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 92px 92px 180px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  background: rgba(0,0,0,.12);
}

.all-history-item-identity {
  min-width: 0;
}

.all-history-item-identity strong,
.all-history-item-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-history-item-identity strong {
  color: #f5f6f8;
  font-size: 12px;
}

.all-history-item-identity small,
.all-history-item-detail,
.all-history-item-points {
  margin-top: 4px;
  color: #939aa7;
  font-size: 10px;
}

.all-history-item-status {
  justify-self: start;
  padding: 4px 7px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 999px;
  color: #b8bec9;
  font-size: 10px;
  white-space: nowrap;
}

.all-history-item-row[data-state="complete"] .all-history-item-status {
  color: #8ee5b0;
  border-color: rgba(81,199,126,.28);
}

.all-history-item-row[data-state="partial"] .all-history-item-status {
  color: #f4c86d;
  border-color: rgba(244,200,109,.28);
}

.all-history-item-row[data-state="failed"] .all-history-item-status {
  color: #e68b8b;
  border-color: rgba(230,139,139,.28);
}

.all-history-item-row[data-state="processing"] .all-history-item-status {
  color: #78c7ff;
  border-color: rgba(90,171,226,.3);
}

.all-history-item-points,
.all-history-item-detail {
  white-space: nowrap;
}

.all-history-item-more {
  display: block;
  margin: 12px auto 0;
}

.all-history-item-more[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .all-history-items-head {
    align-items: stretch;
    flex-direction: column;
  }

  .all-history-item-filters {
    justify-content: flex-start;
  }

  .all-history-item-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .all-history-item-points,
  .all-history-item-detail {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .all-history-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .all-history-live-head,
  .all-history-live-details {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .all-history-live-details strong {
    width: 100%;
  }

  .all-history-set-row {
    grid-template-columns: 72px 1fr;
  }

  .all-history-set-row span,
  .all-history-set-row small {
    grid-column: 2;
  }

  .all-history-actions label {
    margin-left: 0;
  }
}

.manual-family-card {
  flex: 0 0 172px;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.manual-family-card > .card-family-tile {
  width: 100%;
  min-height: 88px;
  flex: none;
}

.manual-family-history,
.manual-selected-history {
  border: 1px solid rgba(213, 165, 76, 0.28);
  border-radius: 7px;
  color: #d7b777;
  background: rgba(213, 165, 76, 0.055);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.manual-family-history {
  width: 100%;
  min-height: 24px;
  padding: 3px 7px;
  font-size: 8px;
}

.manual-family-history:hover:not(:disabled),
.manual-selected-history:hover:not(:disabled) {
  border-color: #a57b37;
  background: rgba(213, 165, 76, 0.11);
}

.manual-family-history:disabled,
.manual-selected-history:disabled {
  opacity: 0.65;
  cursor: progress;
}

.manual-family-history[data-history-status="success"],
.manual-selected-history[data-history-status="success"] {
  color: #9bd8a9;
  border-color: rgba(91, 174, 111, 0.42);
  background: rgba(91, 174, 111, 0.08);
}

.manual-family-history[data-history-status="waiting_provider"],
.manual-selected-history[data-history-status="waiting_provider"] {
  color: #f0c97c;
  border-color: rgba(213, 165, 76, 0.5);
  background: rgba(213, 165, 76, 0.1);
}

.manual-family-history[data-history-status="unavailable"],
.manual-selected-history[data-history-status="unavailable"] {
  color: #aaaeb7;
  border-color: rgba(170, 174, 183, 0.28);
  background: rgba(170, 174, 183, 0.055);
}

.manual-family-history[data-history-status="failed"],
.manual-selected-history[data-history-status="failed"] {
  color: #ffadad;
  border-color: rgba(231, 89, 89, 0.42);
  background: rgba(231, 89, 89, 0.08);
}

.selected-price .manual-selected-history {
  margin-top: 7px;
  padding: 5px 9px;
  font-size: 9px;
  white-space: nowrap;
}

.manual-inline-family-detail {
  margin-top: 11px;
  padding-top: 13px;
  border-top: 1px solid var(--border-soft);
}

.manual-inline-family-detail[hidden] {
  display: none;
}

.manual-inline-family-layout {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(213, 165, 76, 0.2);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 14%, rgba(213, 165, 76, 0.08), transparent 30%),
    rgba(255, 255, 255, 0.012);
}

.manual-inline-family-art {
  position: relative;
  width: 100%;
  max-width: 190px;
  aspect-ratio: 63 / 88;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #433b2e;
  border-radius: 11px;
  background: #0b0c0f;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
}

.manual-inline-family-art img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.manual-inline-family-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: #f3ddb1;
  font-size: 28px;
  font-weight: 850;
  background: linear-gradient(145deg, #241916, #69491d 70%, #241916);
}

.manual-inline-family-copy {
  min-width: 0;
  padding-top: 3px;
}

.manual-inline-family-kicker {
  color: #d5a54c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual-inline-family-copy h3 {
  margin: 6px 0 3px;
  font-size: clamp(20px, 2.4vw, 28px);
}

.manual-inline-family-variant,
.manual-inline-family-set,
.manual-inline-family-meta {
  margin: 0;
}

.manual-inline-family-variant {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.manual-inline-family-set {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.manual-inline-family-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.manual-inline-family-stats > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.manual-inline-family-stats span {
  color: var(--faint);
  font-size: 8px;
  text-transform: uppercase;
}

.manual-inline-family-stats strong {
  font-size: 14px;
}

.manual-inline-family-meta {
  margin-top: 12px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.4;
}

.manual-inline-family-loading {
  padding: 14px;
  color: var(--muted);
  font-size: 10px;
}

.manual-inline-family-loading.is-error {
  color: #ffadad;
}

.manual-card-chart-dialog {
  width: min(1450px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  padding: 0;
  color: var(--text);
  border: 1px solid #3d372d;
  border-radius: 15px;
  background: #0e1014;
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.7);
}

.manual-card-chart-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
}

.manual-card-chart-shell {
  min-height: min(760px, calc(100vh - 26px));
  max-height: calc(100vh - 26px);
  display: flex;
  flex-direction: column;
}

.manual-card-chart-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 20px 13px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(14, 16, 20, 0.98);
}

.manual-card-chart-title > span {
  color: #d5a54c;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.manual-card-chart-title h2 {
  margin: 3px 0 2px;
  font-size: clamp(22px, 2.7vw, 34px);
}

.manual-card-chart-title p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.manual-card-chart-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.manual-card-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-soft);
}

.manual-card-chart-summary {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.manual-card-chart-summary strong {
  font-size: 20px;
}

.manual-card-chart-summary span,
.manual-card-chart-footer {
  color: var(--faint);
  font-size: 9px;
}

.manual-provider-status {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.012);
}

.manual-provider-chip,
.manual-provider-stored {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 4px 8px;
  color: #aeb2ba;
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 720;
}

.manual-provider-chip[data-status="success"] {
  color: #9bd8a9;
  border-color: rgba(91, 174, 111, 0.34);
  background: rgba(91, 174, 111, 0.075);
}

.manual-provider-chip[data-status="waiting"],
.manual-provider-chip[data-status="queued"],
.manual-provider-chip[data-status="running"] {
  color: #e3bf74;
  border-color: rgba(213, 165, 76, 0.35);
  background: rgba(213, 165, 76, 0.075);
}

.manual-provider-chip[data-status="failed"],
.manual-provider-chip[data-status="error"] {
  color: #ffadad;
  border-color: rgba(231, 89, 89, 0.35);
  background: rgba(231, 89, 89, 0.075);
}

.manual-provider-stored {
  margin-left: auto;
  color: #d7b777;
}

.manual-card-chart-job {
  margin: 0;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--faint);
  background: rgba(255, 255, 255, 0.018);
  font-size: 10px;
}

.manual-card-chart-job[data-status="queued"],
.manual-card-chart-job[data-status="running"],
.manual-card-chart-job[data-status="waiting_provider"] {
  color: #d7b777;
}

.manual-card-chart-job[data-status="success"] {
  color: #9bd8a9;
}

.manual-card-chart-job[data-status="unavailable"] {
  color: #aaaeb7;
}

.manual-card-chart-job[data-status="failed"] {
  color: #ffadad;
}

.manual-card-chart-canvas {
  min-height: 0;
  flex: 1 1 auto;
  padding: 8px 14px 0;
  overflow: hidden;
}

.manual-card-chart-canvas svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 520px;
}

.manual-card-chart-footer {
  padding: 8px 20px 12px;
  text-align: right;
}

.manual-chart-empty {
  fill: #8f9299;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .manual-card-chart-header,
  .manual-card-chart-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-card-chart-header-actions {
    justify-content: space-between;
  }

  .manual-card-chart-canvas svg {
    min-height: 360px;
  }

  .manual-family-card {
    flex-basis: 158px;
  }

  .manual-provider-stored {
    width: 100%;
    margin-left: 0;
  }

  .manual-inline-family-layout {
    grid-template-columns: 1fr;
  }

  .manual-inline-family-art {
    max-width: 170px;
    margin-inline: auto;
  }

  .manual-inline-family-stats {
    grid-template-columns: 1fr;
  }
}
