#recents {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.recents-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 50px;
  padding: 0 var(--space-4);
}

.recents-ram {
  position: relative;
  top: 10px;
  right: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

body.has-wallpaper .recents-ram {
  color: var(--on-wallpaper);
  text-shadow: var(--on-wallpaper-shadow);
}

.recents-scroll {
  --card-w: min(72vw, 320px);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.recents-list {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
}

.recents-track {
  position: relative;
  flex: none;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) calc((100% - var(--card-w)) / 2);
  will-change: transform;
}

.recents-empty {
  margin: auto;
  text-align: center;
}

.recents-clear {
  flex: none;
  align-self: center;
  min-width: 168px;
  margin: var(--space-2) 0 var(--space-5);
  border-radius: var(--radius-full);
}

.recent-card {
  flex: none;
  display: flex;
  flex-direction: column;
  align-self: center;
  width: var(--card-w);
  height: calc(100% - 80px);
  max-height: 465px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  touch-action: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.recent-card.is-current {
  border-color: var(--accent);
}

.recent-card.is-dragging {
  transition: none;
}

.recent-card.is-leaving {
  max-width: 0 !important;
  margin-right: calc(var(--space-3) * -1);
  border-width: 0;
  opacity: 0;
  transform: translateY(-120%);
  pointer-events: none;
  transition:
    transform 0.22s ease,
    opacity 0.2s ease,
    max-width 0.2s ease 0.16s,
    margin-right 0.2s ease 0.16s,
    border-width 0.2s ease 0.16s;
}

.recent-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding-right: var(--space-1);
}

.recent-open {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  min-height: 56px;
  padding: 0 0 0 var(--space-4);
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.recent-icon {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.recent-text {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  min-width: 0;
}

.recent-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-sub {
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background: var(--surface-2);
  cursor: pointer;
}

.recent-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 24px;
  background: var(--surface);
}

.recent-tile img {
  display: block;
  width: 56px;
  height: 56px;
}

@media (prefers-reduced-motion: reduce) {
  .recent-card,
  .recent-card.is-leaving {
    transition: none;
  }
}
