.attach-card {
  display: flex;       /* was: inline-flex to allow inline with text*/
  width: fit-content;  /* keeps the card as wide as its content, not full width */
  max-width: 100%;     /* if you want to revert to inline elements remove fit-content, max-width, and restore inline-flex */
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  margin: 0.4rem 0;
  border: 1px solid rgba(128, 128, 128, 0.35);
  border-radius: 6px;
  background: rgba(128, 128, 128, 0.08);
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}
.attach-card:hover {
  background: rgba(128, 128, 128, 0.18);
  border-color: rgba(128, 128, 128, 0.6);
}
.attach-icon {
  font-family: monospace;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #7c3aed;
  color: #fff;
}
.attach-name { word-break: break-all; }

.nested-links a.attach-card,
.nested-links a.attach-card:visited {
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nested-links a.attach-card:hover,
.nested-links a.attach-card:focus {
  color: inherit;
  text-decoration: none;
  background: rgba(128, 128, 128, 0.18);
  border-color: rgba(128, 128, 128, 0.6);
}
