.msndy-model-card-footer.msndy-model-card-footer {
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: end;
  gap: 10px 12px;
}

.msndy-model-card-footer.msndy-model-card-footer > div:first-child {
  grid-column: 1;
  grid-row: 2;
}

.msndy-model-card-footer .msndy-generation-stats {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 5px 12px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.xiaopan-success-rate {
  color: #0aa85b;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.xiaopan-average-latency {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.xiaopan-recent-status {
  grid-column: 1 / -1;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 18px;
}

.xiaopan-recent-label {
  flex: none;
  white-space: nowrap;
}

.xiaopan-status-bars {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 2px;
}

.xiaopan-status-bars .msndy-generation-status,
.xiaopan-status-bars .msndy-generation-status-0,
.xiaopan-status-bars .msndy-generation-status-1,
.xiaopan-status-bars .msndy-generation-status-2 {
  display: inline-block;
  width: 6px;
  height: 13px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--muted-foreground) 20%, transparent);
}

.xiaopan-status-bars .msndy-generation-status[data-state="healthy"] {
  background: #1fbd68;
}

.xiaopan-status-bars .msndy-generation-status[data-state="degraded"] {
  background: #f59e0b;
}

.xiaopan-status-bars .msndy-generation-status[data-state="failed"] {
  background: #ef4444;
}

.xiaopan-billing-pill,
.xiaopan-stability {
  display: inline-flex;
  width: max-content;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.xiaopan-billing-pill {
  color: #087f76;
  background: #dff7f4;
}

.xiaopan-stability {
  position: absolute;
  right: 0;
  bottom: 0;
  color: #277a43;
  background: #e3f4df;
}

.xiaopan-stability[data-state="degraded"] {
  color: #9a6700;
  background: #fff2c7;
}

.xiaopan-stability[data-state="failed"] {
  color: #b42318;
  background: #fee4e2;
}

.xiaopan-stability[data-state="unknown"] {
  color: var(--muted-foreground);
  background: var(--muted);
}

@media (max-width: 480px) {
  .msndy-model-card-footer .msndy-generation-stats {
    column-gap: 8px;
  }

  .xiaopan-success-rate,
  .xiaopan-average-latency,
  .xiaopan-recent-status,
  .xiaopan-billing-pill,
  .xiaopan-stability {
    font-size: 11px;
  }

  .xiaopan-status-bars .msndy-generation-status {
    width: 5px;
  }
}
