.apk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 150px));
  align-items: start;
  gap: 10px;
  margin: 1rem 0;
}

.apk-card.card.indexcard {
  position: relative;
  display: block;
  min-width: 0;
  margin: 0;
  padding: 7px;
  overflow: hidden;
  color: #111827;
  text-decoration: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(17, 24, 39, .03), transparent 32%),
    linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
  border: 1px solid #e5e7eb;
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, .06), 0 9px 20px rgba(17, 24, 39, .05);
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}

.apk-card.card.indexcard:hover,
.apk-card.card.indexcard:focus-visible {
  transform: translateY(-2px);
  border-color: #d1d5db;
  box-shadow: 0 9px 22px rgba(17, 24, 39, .1);
}

.apk-card .thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  isolation: isolate;
  background: #f3f4f6;
  border-radius: 10px;
}

.apk-card .thumb > img {
  display: block;
  width: 62%;
  height: 62%;
  object-fit: contain;
  border-radius: 18%;
}

.apk-icon-fallback {
  display: grid;
  place-items: center;
  width: 62%;
  height: 62%;
  color: #073b20;
  font-size: .9rem;
  font-weight: 800;
  background: #3ddc84;
  border-radius: 18%;
}

.apk-card .thumb-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  max-height: 42px;
  padding: 7px;
  overflow: hidden;
  color: #0f172a;
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .82));
  transform: translateY(0);
  transition: max-height .25s ease, background .2s ease;
}

.apk-card .title-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.apk-card .title {
  overflow: hidden;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apk-card .digest {
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  color: #4b5563;
  font-size: .65rem;
  line-height: 1.25;
  opacity: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: max-height .25s ease, margin-top .2s ease, opacity .2s ease;
}

.apk-card:hover .thumb-overlay,
.apk-card:focus-visible .thumb-overlay {
  max-height: 64px;
  background: rgba(255, 255, 255, .94);
}

.apk-card:hover .digest,
.apk-card:focus-visible .digest {
  max-height: 20px;
  margin-top: 4px;
  opacity: 1;
}

.apk-empty {
  padding: 1rem;
  color: #64748b;
  background: #f9fafc;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
}

@media (max-width: 420px) {
  .apk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
